dawn-cmake/test/vk-gl-cts/graphicsfuzz/global-array-loops/0-opt.wgsl.expected.msl

214 lines
4.4 KiB
Plaintext
Raw Normal View History

2021-07-23 13:10:12 +00:00
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ float one;
};
struct tint_array_wrapper {
int arr[10];
};
struct tint_array_wrapper_1 {
int arr[2];
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf0& x_8, thread float4* const tint_symbol_4) {
bool x_68 = false;
int x_29 = 0;
int x_30 = 0;
int x_31 = 0;
tint_array_wrapper globalNumbers = {};
int x_17 = 0;
int acc = 0;
int i_1 = 0;
tint_array_wrapper_1 localNumbers = {};
int param = 0;
int x_24 = 0;
int x_24_phi = 0;
int x_23_phi = 0;
acc = 0;
i_1 = 0;
x_24_phi = 0;
x_23_phi = 0;
while (true) {
int x_33 = 0;
int x_92 = 0;
bool x_76_phi = false;
int x_34_phi = 0;
int x_25_phi = 0;
x_24 = x_24_phi;
int const x_23 = x_23_phi;
if ((x_23 < 4)) {
} else {
break;
}
x_68 = false;
x_76_phi = false;
while (true) {
bool x_81 = false;
int x_32 = 0;
bool x_81_phi = false;
int x_32_phi = 0;
int x_33_phi = 0;
bool x_90_phi = false;
bool const x_76 = x_76_phi;
x_30 = 0;
x_81_phi = x_76;
x_32_phi = 0;
while (true) {
x_81 = x_81_phi;
x_32 = x_32_phi;
float const x_86 = x_8.one;
x_33_phi = 0;
x_90_phi = x_81;
if ((x_32 < int(x_86))) {
} else {
break;
}
x_68 = true;
x_29 = x_32;
x_33_phi = x_32;
x_90_phi = true;
break;
{
x_81_phi = false;
x_32_phi = 0;
}
}
x_33 = x_33_phi;
bool const x_90 = x_90_phi;
x_34_phi = x_33;
if (x_90) {
break;
}
x_92 = 0;
x_68 = true;
x_29 = x_92;
x_34_phi = x_92;
break;
{
x_76_phi = false;
}
}
int const x_34 = x_34_phi;
x_31 = x_34;
int const x_93 = x_31;
tint_array_wrapper_1 const x_21 = localNumbers;
tint_array_wrapper_1 x_22_1 = x_21;
x_22_1.arr[1u] = x_93;
tint_array_wrapper_1 const x_22 = x_22_1;
localNumbers = x_22;
globalNumbers.arr[0] = 0;
int const x_13 = x_22.arr[1u];
param = x_13;
x_17 = 0;
x_25_phi = 0;
while (true) {
int const x_25 = x_25_phi;
if ((x_25 <= x_13)) {
} else {
break;
}
int const x_102_save = x_13;
int const x_18 = globalNumbers.arr[x_102_save];
if ((x_18 <= 1)) {
globalNumbers.arr[x_102_save] = 1;
}
{
int const x_19 = (x_25 + 1);
x_17 = x_19;
x_25_phi = x_19;
}
}
float const x_107 = x_8.one;
int const x_14 = globalNumbers.arr[(int(x_107) - 1)];
int const x_15 = as_type<int>((x_24 + as_type<int>(x_14)));
acc = x_15;
{
int const x_16 = (x_23 + 1);
i_1 = x_16;
x_24_phi = x_15;
x_23_phi = x_16;
}
}
if ((x_24 == as_type<int>(4))) {
*(tint_symbol_4) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_4) = float4(0.0f, 0.0f, 0.0f, 1.0f);
}
return;
}
fragment tint_symbol_1 tint_symbol(constant buf0& x_8 [[buffer(0)]]) {
thread float4 tint_symbol_5 = 0.0f;
main_1(x_8, &(tint_symbol_5));
main_out const tint_symbol_2 = {.x_GLF_color_1=tint_symbol_5};
tint_symbol_1 const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_2.x_GLF_color_1};
return tint_symbol_3;
}
int yieldsZero_(constant buf0& x_8) {
bool x_116 = false;
int x_20 = 0;
int i = 0;
int x_26 = 0;
int x_134 = 0;
bool x_118_phi = false;
int x_27_phi = 0;
x_118_phi = false;
while (true) {
bool x_123 = false;
int x_28 = 0;
bool x_123_phi = false;
int x_28_phi = 0;
int x_26_phi = 0;
bool x_132_phi = false;
bool const x_118 = x_118_phi;
i = 0;
x_123_phi = x_118;
x_28_phi = 0;
while (true) {
x_123 = x_123_phi;
x_28 = x_28_phi;
float const x_128 = x_8.one;
x_26_phi = 0;
x_132_phi = x_123;
if ((x_28 < int(x_128))) {
} else {
break;
}
x_116 = true;
x_20 = x_28;
x_26_phi = x_28;
x_132_phi = true;
break;
{
x_123_phi = false;
x_28_phi = 0;
}
}
x_26 = x_26_phi;
bool const x_132 = x_132_phi;
x_27_phi = x_26;
if (x_132) {
break;
}
x_134 = 0;
x_116 = true;
x_20 = x_134;
x_27_phi = x_134;
break;
{
x_118_phi = false;
}
}
int const x_27 = x_27_phi;
return x_27;
}