| SKIP: FAILED |
| |
| ../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: QuicksortObject = struct @align(4) { |
| numbers:array<i32, 10> @offset(0) |
| } |
| |
| BST = struct @align(4) { |
| data:i32 @offset(0) |
| leftIndex:i32 @offset(4) |
| rightIndex:i32 @offset(8) |
| } |
| |
| buf0 = struct @align(8) { |
| injectionSwitch:vec2<f32> @offset(0) |
| } |
| |
| main_out = struct @align(16) { |
| x_GLF_color_1:vec4<f32> @offset(0), @location(0) |
| } |
| |
| $B1: { # root |
| %obj:ptr<private, QuicksortObject, read_write> = var |
| %tree:ptr<private, array<BST, 10>, read_write> = var |
| %x_50:ptr<uniform, buf0, read> = var @binding_point(0, 0) |
| %x_GLF_color:ptr<private, vec4<f32>, read_write> = var |
| } |
| |
| %makeTreeNode_struct_BST_i1_i1_i11_i1_ = func(%node:ptr<function, BST, read_write>, %data:ptr<function, i32, read_write>):void { |
| $B2: { |
| %8:i32 = load %data |
| %x_208:i32 = let %8 |
| %10:ptr<function, i32, read_write> = access %node, 0u |
| store %10, %x_208 |
| %11:ptr<function, i32, read_write> = access %node, 1u |
| store %11, -1i |
| %12:ptr<function, i32, read_write> = access %node, 2u |
| store %12, -1i |
| ret |
| } |
| } |
| %insert_i1_i1_ = func(%treeIndex:ptr<function, i32, read_write>, %data_1:ptr<function, i32, read_write>):void { |
| $B3: { |
| %baseIndex:ptr<function, i32, read_write> = var |
| %param:ptr<function, BST, read_write> = var |
| %param_1:ptr<function, i32, read_write> = var |
| %param_2:ptr<function, BST, read_write> = var |
| %param_3:ptr<function, i32, read_write> = var |
| store %baseIndex, 0i |
| loop [b: $B4, c: $B5] { # loop_1 |
| $B4: { # body |
| %21:i32 = load %baseIndex |
| %x_217:i32 = let %21 |
| %23:i32 = load %treeIndex |
| %x_218:i32 = let %23 |
| %25:bool = lte %x_217, %x_218 |
| if %25 [t: $B6, f: $B7] { # if_1 |
| $B6: { # true |
| exit_if # if_1 |
| } |
| $B7: { # false |
| exit_loop # loop_1 |
| } |
| } |
| %26:i32 = load %data_1 |
| %x_221:i32 = let %26 |
| %28:i32 = load %baseIndex |
| %x_222:i32 = let %28 |
| %30:ptr<private, i32, read_write> = access %tree, %x_222, 0u |
| %31:i32 = load %30 |
| %x_224:i32 = let %31 |
| %33:bool = lte %x_221, %x_224 |
| if %33 [t: $B8, f: $B9] { # if_2 |
| $B8: { # true |
| %34:i32 = load %baseIndex |
| %x_229:i32 = let %34 |
| %36:ptr<private, i32, read_write> = access %tree, %x_229, 1u |
| %37:i32 = load %36 |
| %x_231:i32 = let %37 |
| %39:bool = eq %x_231, -1i |
| if %39 [t: $B10, f: $B11] { # if_3 |
| $B10: { # true |
| %40:i32 = load %baseIndex |
| %x_236:i32 = let %40 |
| %42:i32 = load %treeIndex |
| %x_237:i32 = let %42 |
| %44:ptr<private, i32, read_write> = access %tree, %x_236, 1u |
| store %44, %x_237 |
| %45:i32 = load %treeIndex |
| %x_239:i32 = let %45 |
| %47:ptr<private, BST, read_write> = access %tree, %x_239 |
| %48:BST = load %47 |
| %x_241:BST = let %48 |
| store %param, %x_241 |
| %50:i32 = load %data_1 |
| %x_242:i32 = let %50 |
| store %param_1, %x_242 |
| %52:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param, %param_1 |
| %53:BST = load %param |
| %x_244:BST = let %53 |
| %55:ptr<private, BST, read_write> = access %tree, %x_239 |
| store %55, %x_244 |
| ret |
| } |
| $B11: { # false |
| %56:i32 = load %baseIndex |
| %x_246:i32 = let %56 |
| %58:ptr<private, i32, read_write> = access %tree, %x_246, 1u |
| %59:i32 = load %58 |
| %x_248:i32 = let %59 |
| store %baseIndex, %x_248 |
| continue # -> $B5 |
| } |
| } |
| exit_if # if_2 |
| } |
| $B9: { # false |
| %61:i32 = load %baseIndex |
| %x_249:i32 = let %61 |
| %63:ptr<private, i32, read_write> = access %tree, %x_249, 2u |
| %64:i32 = load %63 |
| %x_251:i32 = let %64 |
| %66:bool = eq %x_251, -1i |
| if %66 [t: $B12, f: $B13] { # if_4 |
| $B12: { # true |
| %67:i32 = load %baseIndex |
| %x_256:i32 = let %67 |
| %69:i32 = load %treeIndex |
| %x_257:i32 = let %69 |
| %71:ptr<private, i32, read_write> = access %tree, %x_256, 2u |
| store %71, %x_257 |
| %72:i32 = load %treeIndex |
| %x_259:i32 = let %72 |
| %74:ptr<private, BST, read_write> = access %tree, %x_259 |
| %75:BST = load %74 |
| %x_261:BST = let %75 |
| store %param_2, %x_261 |
| %77:i32 = load %data_1 |
| %x_262:i32 = let %77 |
| store %param_3, %x_262 |
| %79:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_2, %param_3 |
| %80:BST = load %param_2 |
| %x_264:BST = let %80 |
| %82:ptr<private, BST, read_write> = access %tree, %x_259 |
| store %82, %x_264 |
| ret |
| } |
| $B13: { # false |
| %83:i32 = load %baseIndex |
| %x_266:i32 = let %83 |
| %85:ptr<private, i32, read_write> = access %tree, %x_266, 2u |
| %86:i32 = load %85 |
| %x_268:i32 = let %86 |
| store %baseIndex, %x_268 |
| continue # -> $B5 |
| } |
| } |
| exit_if # if_2 |
| } |
| } |
| unreachable |
| } |
| $B5: { # continuing |
| next_iteration # -> $B4 |
| } |
| } |
| ret |
| } |
| } |
| %identity_i1_ = func(%a:ptr<function, i32, read_write>):i32 { |
| $B14: { |
| %90:i32 = load %a |
| %x_202:i32 = let %90 |
| %92:i32 = load %a |
| %x_203:i32 = let %92 |
| %94:ptr<private, i32, read_write> = access %obj, 0u, %x_202 |
| store %94, %x_203 |
| %95:ptr<private, i32, read_write> = access %obj, 0u, 2i |
| %96:i32 = load %95 |
| %x_206:i32 = let %96 |
| ret %x_206 |
| } |
| } |
| %search_i1_ = func(%t:ptr<function, i32, read_write>):i32 { |
| $B15: { |
| %index:ptr<function, i32, read_write> = var |
| %currentNode:ptr<function, BST, read_write> = var |
| %x_270:ptr<function, i32, read_write> = var |
| store %index, 0i |
| loop [b: $B16, c: $B17] { # loop_2 |
| $B16: { # body |
| %103:i32 = load %index |
| %x_275:i32 = let %103 |
| %105:bool = neq %x_275, -1i |
| if %105 [t: $B18, f: $B19] { # if_5 |
| $B18: { # true |
| exit_if # if_5 |
| } |
| $B19: { # false |
| exit_loop # loop_2 |
| } |
| } |
| %106:i32 = load %index |
| %x_278:i32 = let %106 |
| %108:ptr<private, BST, read_write> = access %tree, %x_278 |
| %109:BST = load %108 |
| %x_280:BST = let %109 |
| store %currentNode, %x_280 |
| %111:ptr<function, i32, read_write> = access %currentNode, 0u |
| %112:i32 = load %111 |
| %x_282:i32 = let %112 |
| %114:i32 = load %t |
| %x_283:i32 = let %114 |
| %116:bool = eq %x_282, %x_283 |
| if %116 [t: $B20] { # if_6 |
| $B20: { # true |
| %117:i32 = load %t |
| %x_287:i32 = let %117 |
| ret %x_287 |
| } |
| } |
| %119:i32 = load %t |
| %x_288:i32 = let %119 |
| %121:ptr<function, i32, read_write> = access %currentNode, 0u |
| %122:i32 = load %121 |
| %x_290:i32 = let %122 |
| %124:bool = gt %x_288, %x_290 |
| if %124 [t: $B21, f: $B22] { # if_7 |
| $B21: { # true |
| %125:ptr<function, i32, read_write> = access %currentNode, 2u |
| %126:i32 = load %125 |
| %x_296:i32 = let %126 |
| store %x_270, %x_296 |
| exit_if # if_7 |
| } |
| $B22: { # false |
| %128:ptr<function, i32, read_write> = access %currentNode, 1u |
| %129:i32 = load %128 |
| %x_298:i32 = let %129 |
| store %x_270, %x_298 |
| exit_if # if_7 |
| } |
| } |
| %131:i32 = load %x_270 |
| %x_299:i32 = let %131 |
| store %index, %x_299 |
| continue # -> $B17 |
| } |
| $B17: { # continuing |
| next_iteration # -> $B16 |
| } |
| } |
| ret -1i |
| } |
| } |
| %main_1 = func():void { |
| $B23: { |
| %treeIndex_1:ptr<function, i32, read_write> = var |
| %param_4:ptr<function, BST, read_write> = var |
| %param_5:ptr<function, i32, read_write> = var |
| %param_6:ptr<function, i32, read_write> = var |
| %param_7:ptr<function, i32, read_write> = var |
| %param_8:ptr<function, i32, read_write> = var |
| %param_9:ptr<function, i32, read_write> = var |
| %param_10:ptr<function, i32, read_write> = var |
| %param_11:ptr<function, i32, read_write> = var |
| %param_12:ptr<function, i32, read_write> = var |
| %param_13:ptr<function, i32, read_write> = var |
| %param_14:ptr<function, i32, read_write> = var |
| %param_15:ptr<function, i32, read_write> = var |
| %param_16:ptr<function, i32, read_write> = var |
| %param_17:ptr<function, i32, read_write> = var |
| %param_18:ptr<function, i32, read_write> = var |
| %param_19:ptr<function, i32, read_write> = var |
| %param_20:ptr<function, i32, read_write> = var |
| %param_21:ptr<function, i32, read_write> = var |
| %param_22:ptr<function, i32, read_write> = var |
| %param_23:ptr<function, i32, read_write> = var |
| %pp:ptr<function, i32, read_write> = var |
| %looplimiter0:ptr<function, i32, read_write> = var |
| %i:ptr<function, i32, read_write> = var |
| %param_24:ptr<function, i32, read_write> = var |
| %count:ptr<function, i32, read_write> = var |
| %i_1:ptr<function, i32, read_write> = var |
| %result:ptr<function, i32, read_write> = var |
| %param_25:ptr<function, i32, read_write> = var |
| store %treeIndex_1, 0i |
| %163:ptr<private, BST, read_write> = access %tree, 0i |
| %164:BST = load %163 |
| %x_101:BST = let %164 |
| store %param_4, %x_101 |
| store %param_5, 9i |
| %166:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_4, %param_5 |
| %167:BST = load %param_4 |
| %x_103:BST = let %167 |
| %169:ptr<private, BST, read_write> = access %tree, 0i |
| store %169, %x_103 |
| %170:i32 = load %treeIndex_1 |
| %x_105:i32 = let %170 |
| %172:i32 = add %x_105, 1i |
| store %treeIndex_1, %172 |
| %173:i32 = load %treeIndex_1 |
| %x_107:i32 = let %173 |
| store %param_6, %x_107 |
| store %param_7, 5i |
| %175:void = call %insert_i1_i1_, %param_6, %param_7 |
| %176:i32 = load %treeIndex_1 |
| %x_109:i32 = let %176 |
| %178:i32 = add %x_109, 1i |
| store %treeIndex_1, %178 |
| %179:i32 = load %treeIndex_1 |
| %x_111:i32 = let %179 |
| store %param_8, %x_111 |
| store %param_9, 12i |
| %181:void = call %insert_i1_i1_, %param_8, %param_9 |
| %182:i32 = load %treeIndex_1 |
| %x_113:i32 = let %182 |
| %184:i32 = add %x_113, 1i |
| store %treeIndex_1, %184 |
| %185:i32 = load %treeIndex_1 |
| %x_115:i32 = let %185 |
| store %param_10, %x_115 |
| store %param_11, 15i |
| %187:void = call %insert_i1_i1_, %param_10, %param_11 |
| %188:i32 = load %treeIndex_1 |
| %x_117:i32 = let %188 |
| %190:i32 = add %x_117, 1i |
| store %treeIndex_1, %190 |
| %191:i32 = load %treeIndex_1 |
| %x_119:i32 = let %191 |
| store %param_12, %x_119 |
| store %param_13, 7i |
| %193:void = call %insert_i1_i1_, %param_12, %param_13 |
| %194:i32 = load %treeIndex_1 |
| %x_121:i32 = let %194 |
| %196:i32 = add %x_121, 1i |
| store %treeIndex_1, %196 |
| %197:i32 = load %treeIndex_1 |
| %x_123:i32 = let %197 |
| store %param_14, %x_123 |
| store %param_15, 8i |
| %199:void = call %insert_i1_i1_, %param_14, %param_15 |
| %200:i32 = load %treeIndex_1 |
| %x_125:i32 = let %200 |
| %202:i32 = add %x_125, 1i |
| store %treeIndex_1, %202 |
| %203:i32 = load %treeIndex_1 |
| %x_127:i32 = let %203 |
| store %param_16, %x_127 |
| store %param_17, 2i |
| %205:void = call %insert_i1_i1_, %param_16, %param_17 |
| %206:i32 = load %treeIndex_1 |
| %x_129:i32 = let %206 |
| %208:i32 = add %x_129, 1i |
| store %treeIndex_1, %208 |
| %209:i32 = load %treeIndex_1 |
| %x_131:i32 = let %209 |
| store %param_18, %x_131 |
| store %param_19, 6i |
| %211:void = call %insert_i1_i1_, %param_18, %param_19 |
| %212:i32 = load %treeIndex_1 |
| %x_133:i32 = let %212 |
| %214:i32 = add %x_133, 1i |
| store %treeIndex_1, %214 |
| %215:i32 = load %treeIndex_1 |
| %x_135:i32 = let %215 |
| store %param_20, %x_135 |
| store %param_21, 17i |
| %217:void = call %insert_i1_i1_, %param_20, %param_21 |
| %218:i32 = load %treeIndex_1 |
| %x_137:i32 = let %218 |
| %220:i32 = add %x_137, 1i |
| store %treeIndex_1, %220 |
| %221:i32 = load %treeIndex_1 |
| %x_139:i32 = let %221 |
| store %param_22, %x_139 |
| store %param_23, 13i |
| %223:void = call %insert_i1_i1_, %param_22, %param_23 |
| store %pp, 0i |
| store %looplimiter0, 0i |
| store %i, 0i |
| loop [b: $B24, c: $B25] { # loop_3 |
| $B24: { # body |
| %224:i32 = load %i |
| %x_145:i32 = let %224 |
| %226:bool = lt %x_145, 10000i |
| if %226 [t: $B26, f: $B27] { # if_8 |
| $B26: { # true |
| exit_if # if_8 |
| } |
| $B27: { # false |
| exit_loop # loop_3 |
| } |
| } |
| %227:i32 = load %looplimiter0 |
| %x_148:i32 = let %227 |
| %229:ptr<uniform, vec2<f32>, read> = access %x_50, 0u |
| %230:f32 = load_vector_element %229, 1u |
| %x_150:f32 = let %230 |
| %232:i32 = call %tint_f32_to_i32, %x_150 |
| %234:bool = gte %x_148, %232 |
| if %234 [t: $B28] { # if_9 |
| $B28: { # true |
| %235:ptr<uniform, vec2<f32>, read> = access %x_50, 0u |
| %236:f32 = load_vector_element %235, 1u |
| %x_156:f32 = let %236 |
| %238:i32 = call %tint_f32_to_i32, %x_156 |
| %239:i32 = add 1i, %238 |
| store %param_24, %239 |
| %240:i32 = call %identity_i1_, %param_24 |
| %x_159:i32 = let %240 |
| store %pp, %x_159 |
| exit_loop # loop_3 |
| } |
| } |
| %242:i32 = load %looplimiter0 |
| %x_160:i32 = let %242 |
| %244:i32 = add %x_160, 1i |
| store %looplimiter0, %244 |
| continue # -> $B25 |
| } |
| $B25: { # continuing |
| %245:i32 = load %i |
| %x_162:i32 = let %245 |
| %247:i32 = add %x_162, 1i |
| store %i, %247 |
| next_iteration # -> $B24 |
| } |
| } |
| %248:i32 = load %pp |
| %x_164:i32 = let %248 |
| %250:bool = neq %x_164, 2i |
| if %250 [t: $B29] { # if_10 |
| $B29: { # true |
| ret |
| } |
| } |
| store %count, 0i |
| store %i_1, 0i |
| loop [b: $B30, c: $B31] { # loop_4 |
| $B30: { # body |
| %251:i32 = load %i_1 |
| %x_172:i32 = let %251 |
| %253:bool = lt %x_172, 20i |
| if %253 [t: $B32, f: $B33] { # if_11 |
| $B32: { # true |
| exit_if # if_11 |
| } |
| $B33: { # false |
| exit_loop # loop_4 |
| } |
| } |
| %254:i32 = load %i_1 |
| %x_175:i32 = let %254 |
| store %param_25, %x_175 |
| %256:i32 = call %search_i1_, %param_25 |
| %x_176:i32 = let %256 |
| store %result, %x_176 |
| %258:i32 = load %i_1 |
| %x_177:i32 = let %258 |
| switch %x_177 [c: (2i 5i 6i 7i 8i 9i 12i 13i 15i 17i, $B34), c: (default, $B35)] { # switch_1 |
| $B34: { # case |
| %260:i32 = load %result |
| %x_187:i32 = let %260 |
| %262:i32 = load %i_1 |
| %x_188:i32 = let %262 |
| %264:bool = eq %x_187, %x_188 |
| if %264 [t: $B36] { # if_12 |
| $B36: { # true |
| %265:i32 = load %count |
| %x_192:i32 = let %265 |
| %267:i32 = add %x_192, 1i |
| store %count, %267 |
| exit_if # if_12 |
| } |
| } |
| exit_switch # switch_1 |
| } |
| $B35: { # case |
| %268:i32 = load %result |
| %x_181:i32 = let %268 |
| %270:bool = eq %x_181, -1i |
| if %270 [t: $B37] { # if_13 |
| $B37: { # true |
| %271:i32 = load %count |
| %x_185:i32 = let %271 |
| %273:i32 = add %x_185, 1i |
| store %count, %273 |
| exit_if # if_13 |
| } |
| } |
| exit_switch # switch_1 |
| } |
| } |
| continue # -> $B31 |
| } |
| $B31: { # continuing |
| %274:i32 = load %i_1 |
| %x_194:i32 = let %274 |
| %276:i32 = add %x_194, 1i |
| store %i_1, %276 |
| next_iteration # -> $B30 |
| } |
| } |
| %277:i32 = load %count |
| %x_196:i32 = let %277 |
| %279:bool = eq %x_196, 20i |
| if %279 [t: $B38, f: $B39] { # if_14 |
| $B38: { # true |
| store %x_GLF_color, vec4<f32>(1.0f, 0.0f, 0.0f, 1.0f) |
| exit_if # if_14 |
| } |
| $B39: { # false |
| store %x_GLF_color, vec4<f32>(0.0f, 0.0f, 1.0f, 1.0f) |
| exit_if # if_14 |
| } |
| } |
| ret |
| } |
| } |
| %tint_symbol = @fragment func():main_out { |
| $B40: { |
| %281:void = call %main_1 |
| %282:vec4<f32> = load %x_GLF_color |
| %283:main_out = construct %282 |
| ret %283 |
| } |
| } |
| %tint_f32_to_i32 = func(%value:f32):i32 { |
| $B41: { |
| %285:i32 = convert %value |
| %286:bool = gte %value, -2147483648.0f |
| %287:i32 = select -2147483648i, %285, %286 |
| %288:bool = lte %value, 2147483520.0f |
| %289:i32 = select 2147483647i, %287, %288 |
| ret %289 |
| } |
| } |
| |
| unhandled variable address space |
| ******************************************************************** |
| * The tint shader compiler has encountered an unexpected error. * |
| * * |
| * Please help us fix this issue by submitting a bug report at * |
| * crbug.com/tint with the source program that triggered the bug. * |
| ******************************************************************** |