blob: 4083d4b00f28660c13deed84694b079ae3245526 [file] [log] [blame]
SKIP: FAILED
../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: 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
%tree_1:ptr<private, array<BST, 10>, read_write> = var
%x_16: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(%tree:ptr<function, BST, read_write>, %data:ptr<function, i32, read_write>):void {
$B2: {
%7:i32 = load %data
%x_165:i32 = let %7
%9:ptr<function, i32, read_write> = access %tree, 0u
store %9, %x_165
%10:ptr<function, i32, read_write> = access %tree, 1u
store %10, -1i
%11:ptr<function, i32, read_write> = access %tree, 2u
store %11, -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
%x_170: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_175:i32 = let %21
%23:i32 = load %treeIndex
%x_176:i32 = let %23
%25:bool = lte %x_175, %x_176
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_179:i32 = let %26
%28:i32 = load %baseIndex
%x_180:i32 = let %28
%30:ptr<private, i32, read_write> = access %tree_1, %x_180, 0u
%31:i32 = load %30
%x_182:i32 = let %31
%33:bool = lte %x_179, %x_182
if %33 [t: $B8, f: $B9] { # if_2
$B8: { # true
%34:i32 = load %baseIndex
%x_187:i32 = let %34
%36:ptr<private, i32, read_write> = access %tree_1, %x_187, 1u
%37:i32 = load %36
%x_189:i32 = let %37
%39:bool = eq %x_189, -1i
if %39 [t: $B10, f: $B11] { # if_3
$B10: { # true
%40:i32 = load %baseIndex
%x_194:i32 = let %40
%42:i32 = load %treeIndex
%x_195:i32 = let %42
%44:ptr<private, i32, read_write> = access %tree_1, %x_194, 1u
store %44, %x_195
%45:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%46:f32 = load_vector_element %45, 0u
%x_198:f32 = let %46
%48:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%49:f32 = load_vector_element %48, 1u
%x_200:f32 = let %49
%51:bool = lt %x_198, %x_200
if %51 [t: $B12] { # if_4
$B12: { # true
%52:i32 = load %treeIndex
%x_204:i32 = let %52
%54:ptr<private, BST, read_write> = access %tree_1, %x_204
%55:BST = load %54
%x_206:BST = let %55
store %param, %x_206
%57:i32 = load %data_1
%x_207:i32 = let %57
store %param_1, %x_207
%59:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param, %param_1
%60:BST = load %param
%x_209:BST = let %60
%62:ptr<private, BST, read_write> = access %tree_1, %x_204
store %62, %x_209
exit_if # if_4
}
}
%63:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%64:f32 = load_vector_element %63, 0u
%x_212:f32 = let %64
%66:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%67:f32 = load_vector_element %66, 1u
%x_214:f32 = let %67
%69:bool = lt %x_212, %x_214
if %69 [t: $B13] { # if_5
$B13: { # true
ret
}
}
exit_if # if_3
}
$B11: { # false
%70:i32 = load %baseIndex
%x_218:i32 = let %70
%72:ptr<private, i32, read_write> = access %tree_1, %x_218, 1u
%73:i32 = load %72
%x_220:i32 = let %73
store %baseIndex, %x_220
continue # -> $B5
}
}
exit_if # if_2
}
$B9: { # false
%75:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%76:f32 = load_vector_element %75, 0u
%x_222:f32 = let %76
%78:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%79:f32 = load_vector_element %78, 1u
%x_224:f32 = let %79
%81:bool = lt %x_222, %x_224
if %81 [t: $B14, f: $B15] { # if_6
$B14: { # true
%82:i32 = load %baseIndex
%x_229:i32 = let %82
%84:ptr<private, i32, read_write> = access %tree_1, %x_229, 2u
%85:i32 = load %84
%x_231:i32 = let %85
store %x_170, %x_231
exit_if # if_6
}
$B15: { # false
%87:i32 = load %baseIndex
%x_232:i32 = let %87
%89:ptr<private, i32, read_write> = access %tree_1, %x_232, 2u
%90:i32 = load %89
%x_234:i32 = let %90
store %x_170, %x_234
exit_if # if_6
}
}
%92:i32 = load %x_170
%x_235:i32 = let %92
%94:bool = eq %x_235, -1i
if %94 [t: $B16, f: $B17] { # if_7
$B16: { # true
%95:i32 = load %baseIndex
%x_240:i32 = let %95
%97:i32 = load %treeIndex
%x_241:i32 = let %97
%99:ptr<private, i32, read_write> = access %tree_1, %x_240, 2u
store %99, %x_241
%100:i32 = load %treeIndex
%x_243:i32 = let %100
%102:ptr<private, BST, read_write> = access %tree_1, %x_243
%103:BST = load %102
%x_245:BST = let %103
store %param_2, %x_245
%105:i32 = load %data_1
%x_246:i32 = let %105
store %param_3, %x_246
%107:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_2, %param_3
%108:BST = load %param_2
%x_248:BST = let %108
%110:ptr<private, BST, read_write> = access %tree_1, %x_243
store %110, %x_248
ret
}
$B17: { # false
%111:i32 = load %baseIndex
%x_250:i32 = let %111
%113:ptr<private, i32, read_write> = access %tree_1, %x_250, 2u
%114:i32 = load %113
%x_252:i32 = let %114
store %baseIndex, %x_252
continue # -> $B5
}
}
exit_if # if_2
}
}
%116:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%117:f32 = load_vector_element %116, 0u
%x_254:f32 = let %117
%119:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%120:f32 = load_vector_element %119, 1u
%x_256:f32 = let %120
%122:bool = gt %x_254, %x_256
if %122 [t: $B18] { # if_8
$B18: { # true
ret
}
}
continue # -> $B5
}
$B5: { # continuing
next_iteration # -> $B4
}
}
ret
}
}
%search_i1_ = func(%t:ptr<function, i32, read_write>):i32 {
$B19: {
%index:ptr<function, i32, read_write> = var
%currentNode:ptr<function, BST, read_write> = var
%x_261:ptr<function, i32, read_write> = var
store %index, 0i
loop [b: $B20, c: $B21] { # loop_2
$B20: { # body
%128:i32 = load %index
%x_266:i32 = let %128
%130:bool = neq %x_266, -1i
if %130 [t: $B22, f: $B23] { # if_9
$B22: { # true
exit_if # if_9
}
$B23: { # false
exit_loop # loop_2
}
}
%131:i32 = load %index
%x_269:i32 = let %131
%133:ptr<private, BST, read_write> = access %tree_1, %x_269
%134:BST = load %133
%x_271:BST = let %134
store %currentNode, %x_271
%136:ptr<function, i32, read_write> = access %currentNode, 0u
%137:i32 = load %136
%x_273:i32 = let %137
%139:i32 = load %t
%x_274:i32 = let %139
%141:bool = eq %x_273, %x_274
if %141 [t: $B24] { # if_10
$B24: { # true
%142:i32 = load %t
%x_278:i32 = let %142
ret %x_278
}
}
%144:i32 = load %t
%x_279:i32 = let %144
%146:ptr<function, i32, read_write> = access %currentNode, 0u
%147:i32 = load %146
%x_281:i32 = let %147
%149:bool = gt %x_279, %x_281
if %149 [t: $B25, f: $B26] { # if_11
$B25: { # true
%150:ptr<function, i32, read_write> = access %currentNode, 2u
%151:i32 = load %150
%x_287:i32 = let %151
store %x_261, %x_287
exit_if # if_11
}
$B26: { # false
%153:ptr<function, i32, read_write> = access %currentNode, 1u
%154:i32 = load %153
%x_289:i32 = let %154
store %x_261, %x_289
exit_if # if_11
}
}
%156:i32 = load %x_261
%x_290:i32 = let %156
store %index, %x_290
continue # -> $B21
}
$B21: { # continuing
next_iteration # -> $B20
}
}
ret -1i
}
}
%main_1 = func():void {
$B27: {
%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
%count:ptr<function, i32, read_write> = var
%i:ptr<function, i32, read_write> = var
%result:ptr<function, i32, read_write> = var
%param_24:ptr<function, i32, read_write> = var
store %treeIndex_1, 0i
%184:ptr<private, BST, read_write> = access %tree_1, 0i
%185:BST = load %184
%x_91:BST = let %185
store %param_4, %x_91
store %param_5, 9i
%187:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_4, %param_5
%188:BST = load %param_4
%x_93:BST = let %188
%190:ptr<private, BST, read_write> = access %tree_1, 0i
store %190, %x_93
%191:i32 = load %treeIndex_1
%x_95:i32 = let %191
%193:i32 = add %x_95, 1i
store %treeIndex_1, %193
%194:i32 = load %treeIndex_1
%x_97:i32 = let %194
store %param_6, %x_97
store %param_7, 5i
%196:void = call %insert_i1_i1_, %param_6, %param_7
%197:i32 = load %treeIndex_1
%x_99:i32 = let %197
%199:i32 = add %x_99, 1i
store %treeIndex_1, %199
%200:i32 = load %treeIndex_1
%x_101:i32 = let %200
store %param_8, %x_101
store %param_9, 12i
%202:void = call %insert_i1_i1_, %param_8, %param_9
%203:i32 = load %treeIndex_1
%x_103:i32 = let %203
%205:i32 = add %x_103, 1i
store %treeIndex_1, %205
%206:i32 = load %treeIndex_1
%x_105:i32 = let %206
store %param_10, %x_105
store %param_11, 15i
%208:void = call %insert_i1_i1_, %param_10, %param_11
%209:i32 = load %treeIndex_1
%x_107:i32 = let %209
%211:i32 = add %x_107, 1i
store %treeIndex_1, %211
%212:i32 = load %treeIndex_1
%x_109:i32 = let %212
store %param_12, %x_109
store %param_13, 7i
%214:void = call %insert_i1_i1_, %param_12, %param_13
%215:i32 = load %treeIndex_1
%x_111:i32 = let %215
%217:i32 = add %x_111, 1i
store %treeIndex_1, %217
%218:i32 = load %treeIndex_1
%x_113:i32 = let %218
store %param_14, %x_113
store %param_15, 8i
%220:void = call %insert_i1_i1_, %param_14, %param_15
%221:i32 = load %treeIndex_1
%x_115:i32 = let %221
%223:i32 = add %x_115, 1i
store %treeIndex_1, %223
%224:i32 = load %treeIndex_1
%x_117:i32 = let %224
store %param_16, %x_117
store %param_17, 2i
%226:void = call %insert_i1_i1_, %param_16, %param_17
%227:i32 = load %treeIndex_1
%x_119:i32 = let %227
%229:i32 = add %x_119, 1i
store %treeIndex_1, %229
%230:i32 = load %treeIndex_1
%x_121:i32 = let %230
store %param_18, %x_121
store %param_19, 6i
%232:void = call %insert_i1_i1_, %param_18, %param_19
%233:i32 = load %treeIndex_1
%x_123:i32 = let %233
%235:i32 = add %x_123, 1i
store %treeIndex_1, %235
%236:i32 = load %treeIndex_1
%x_125:i32 = let %236
store %param_20, %x_125
store %param_21, 17i
%238:void = call %insert_i1_i1_, %param_20, %param_21
%239:i32 = load %treeIndex_1
%x_127:i32 = let %239
%241:i32 = add %x_127, 1i
store %treeIndex_1, %241
%242:i32 = load %treeIndex_1
%x_129:i32 = let %242
store %param_22, %x_129
store %param_23, 13i
%244:void = call %insert_i1_i1_, %param_22, %param_23
store %count, 0i
store %i, 0i
loop [b: $B28, c: $B29] { # loop_3
$B28: { # body
%245:i32 = load %i
%x_135:i32 = let %245
%247:bool = lt %x_135, 20i
if %247 [t: $B30, f: $B31] { # if_12
$B30: { # true
exit_if # if_12
}
$B31: { # false
exit_loop # loop_3
}
}
%248:i32 = load %i
%x_138:i32 = let %248
store %param_24, %x_138
%250:i32 = call %search_i1_, %param_24
%x_139:i32 = let %250
store %result, %x_139
%252:i32 = load %i
%x_140:i32 = let %252
switch %x_140 [c: (2i 5i 6i 7i 8i 9i 12i 13i 15i 17i, $B32), c: (default, $B33)] { # switch_1
$B32: { # case
%254:i32 = load %result
%x_150:i32 = let %254
%256:i32 = load %i
%x_151:i32 = let %256
%258:bool = eq %x_150, %x_151
if %258 [t: $B34] { # if_13
$B34: { # true
%259:i32 = load %count
%x_155:i32 = let %259
%261:i32 = add %x_155, 1i
store %count, %261
exit_if # if_13
}
}
exit_switch # switch_1
}
$B33: { # case
%262:i32 = load %result
%x_144:i32 = let %262
%264:bool = eq %x_144, -1i
if %264 [t: $B35] { # if_14
$B35: { # true
%265:i32 = load %count
%x_148:i32 = let %265
%267:i32 = add %x_148, 1i
store %count, %267
exit_if # if_14
}
}
exit_switch # switch_1
}
}
continue # -> $B29
}
$B29: { # continuing
%268:i32 = load %i
%x_157:i32 = let %268
%270:i32 = add %x_157, 1i
store %i, %270
next_iteration # -> $B28
}
}
%271:i32 = load %count
%x_159:i32 = let %271
%273:bool = eq %x_159, 20i
if %273 [t: $B36, f: $B37] { # if_15
$B36: { # true
store %x_GLF_color, vec4<f32>(1.0f, 0.0f, 0.0f, 1.0f)
exit_if # if_15
}
$B37: { # false
store %x_GLF_color, vec4<f32>(0.0f, 0.0f, 1.0f, 1.0f)
exit_if # if_15
}
}
ret
}
}
%tint_symbol = @fragment func():main_out {
$B38: {
%275:void = call %main_1
%276:vec4<f32> = load %x_GLF_color
%277:main_out = construct %276
ret %277
}
}
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. *
********************************************************************