blob: 579c4cd46a36c6c88fe965a6f86b1d0e3c2886c7 [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:ptr<function, i32, read_write> = access %tree, 0u
%8:i32 = load %data
store %7, %8
%9:ptr<function, i32, read_write> = access %tree, 1u
store %9, -1i
%10:ptr<function, i32, read_write> = access %tree, 2u
store %10, -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
%20:i32 = load %baseIndex
%21:i32 = load %treeIndex
%22:bool = lte %20, %21
if %22 [t: $B6, f: $B7] { # if_1
$B6: { # true
exit_if # if_1
}
$B7: { # false
exit_loop # loop_1
}
}
%23:i32 = load %data_1
%24:i32 = load %baseIndex
%25:ptr<private, i32, read_write> = access %tree_1, %24, 0u
%26:i32 = load %25
%27:bool = lte %23, %26
if %27 [t: $B8, f: $B9] { # if_2
$B8: { # true
%28:i32 = load %baseIndex
%29:ptr<private, i32, read_write> = access %tree_1, %28, 1u
%30:i32 = load %29
%31:bool = eq %30, -1i
if %31 [t: $B10, f: $B11] { # if_3
$B10: { # true
%32:i32 = load %baseIndex
%x_194:i32 = let %32
%34:ptr<private, i32, read_write> = access %tree_1, %x_194, 1u
%35:i32 = load %treeIndex
store %34, %35
%36:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%37:f32 = load_vector_element %36, 0u
%38:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%39:f32 = load_vector_element %38, 1u
%40:bool = lt %37, %39
if %40 [t: $B12] { # if_4
$B12: { # true
%41:i32 = load %treeIndex
%x_204:i32 = let %41
%43:ptr<private, BST, read_write> = access %tree_1, %x_204
%44:BST = load %43
store %param, %44
%45:i32 = load %data_1
store %param_1, %45
%46:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param, %param_1
%47:ptr<private, BST, read_write> = access %tree_1, %x_204
%48:BST = load %param
store %47, %48
exit_if # if_4
}
}
%49:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%50:f32 = load_vector_element %49, 0u
%51:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%52:f32 = load_vector_element %51, 1u
%53:bool = lt %50, %52
if %53 [t: $B13] { # if_5
$B13: { # true
ret
}
}
exit_if # if_3
}
$B11: { # false
%54:i32 = load %baseIndex
%55:ptr<private, i32, read_write> = access %tree_1, %54, 1u
%56:i32 = load %55
store %baseIndex, %56
continue # -> $B5
}
}
exit_if # if_2
}
$B9: { # false
%57:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%58:f32 = load_vector_element %57, 0u
%59:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%60:f32 = load_vector_element %59, 1u
%61:bool = lt %58, %60
if %61 [t: $B14, f: $B15] { # if_6
$B14: { # true
%62:i32 = load %baseIndex
%63:ptr<private, i32, read_write> = access %tree_1, %62, 2u
%64:i32 = load %63
store %x_170, %64
exit_if # if_6
}
$B15: { # false
%65:i32 = load %baseIndex
%66:ptr<private, i32, read_write> = access %tree_1, %65, 2u
%67:i32 = load %66
store %x_170, %67
exit_if # if_6
}
}
%68:i32 = load %x_170
%69:bool = eq %68, -1i
if %69 [t: $B16, f: $B17] { # if_7
$B16: { # true
%70:i32 = load %baseIndex
%x_240:i32 = let %70
%72:ptr<private, i32, read_write> = access %tree_1, %x_240, 2u
%73:i32 = load %treeIndex
store %72, %73
%74:i32 = load %treeIndex
%x_243:i32 = let %74
%76:ptr<private, BST, read_write> = access %tree_1, %x_243
%77:BST = load %76
store %param_2, %77
%78:i32 = load %data_1
store %param_3, %78
%79:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_2, %param_3
%80:ptr<private, BST, read_write> = access %tree_1, %x_243
%81:BST = load %param_2
store %80, %81
ret
}
$B17: { # false
%82:i32 = load %baseIndex
%83:ptr<private, i32, read_write> = access %tree_1, %82, 2u
%84:i32 = load %83
store %baseIndex, %84
continue # -> $B5
}
}
exit_if # if_2
}
}
%85:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%86:f32 = load_vector_element %85, 0u
%87:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%88:f32 = load_vector_element %87, 1u
%89:bool = gt %86, %88
if %89 [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
%95:i32 = load %index
%96:bool = neq %95, -1i
if %96 [t: $B22, f: $B23] { # if_9
$B22: { # true
exit_if # if_9
}
$B23: { # false
exit_loop # loop_2
}
}
%97:i32 = load %index
%98:ptr<private, BST, read_write> = access %tree_1, %97
%99:BST = load %98
store %currentNode, %99
%100:ptr<function, i32, read_write> = access %currentNode, 0u
%101:i32 = load %100
%102:i32 = load %t
%103:bool = eq %101, %102
if %103 [t: $B24] { # if_10
$B24: { # true
%104:i32 = load %t
%x_278:i32 = let %104
ret %x_278
}
}
%106:i32 = load %t
%107:ptr<function, i32, read_write> = access %currentNode, 0u
%108:i32 = load %107
%109:bool = gt %106, %108
if %109 [t: $B25, f: $B26] { # if_11
$B25: { # true
%110:ptr<function, i32, read_write> = access %currentNode, 2u
%111:i32 = load %110
store %x_261, %111
exit_if # if_11
}
$B26: { # false
%112:ptr<function, i32, read_write> = access %currentNode, 1u
%113:i32 = load %112
store %x_261, %113
exit_if # if_11
}
}
%114:i32 = load %x_261
store %index, %114
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
%141:ptr<private, BST, read_write> = access %tree_1, 0i
%142:BST = load %141
store %param_4, %142
store %param_5, 9i
%143:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_4, %param_5
%144:ptr<private, BST, read_write> = access %tree_1, 0i
%145:BST = load %param_4
store %144, %145
%146:i32 = load %treeIndex_1
%147:i32 = add %146, 1i
store %treeIndex_1, %147
%148:i32 = load %treeIndex_1
store %param_6, %148
store %param_7, 5i
%149:void = call %insert_i1_i1_, %param_6, %param_7
%150:i32 = load %treeIndex_1
%151:i32 = add %150, 1i
store %treeIndex_1, %151
%152:i32 = load %treeIndex_1
store %param_8, %152
store %param_9, 12i
%153:void = call %insert_i1_i1_, %param_8, %param_9
%154:i32 = load %treeIndex_1
%155:i32 = add %154, 1i
store %treeIndex_1, %155
%156:i32 = load %treeIndex_1
store %param_10, %156
store %param_11, 15i
%157:void = call %insert_i1_i1_, %param_10, %param_11
%158:i32 = load %treeIndex_1
%159:i32 = add %158, 1i
store %treeIndex_1, %159
%160:i32 = load %treeIndex_1
store %param_12, %160
store %param_13, 7i
%161:void = call %insert_i1_i1_, %param_12, %param_13
%162:i32 = load %treeIndex_1
%163:i32 = add %162, 1i
store %treeIndex_1, %163
%164:i32 = load %treeIndex_1
store %param_14, %164
store %param_15, 8i
%165:void = call %insert_i1_i1_, %param_14, %param_15
%166:i32 = load %treeIndex_1
%167:i32 = add %166, 1i
store %treeIndex_1, %167
%168:i32 = load %treeIndex_1
store %param_16, %168
store %param_17, 2i
%169:void = call %insert_i1_i1_, %param_16, %param_17
%170:i32 = load %treeIndex_1
%171:i32 = add %170, 1i
store %treeIndex_1, %171
%172:i32 = load %treeIndex_1
store %param_18, %172
store %param_19, 6i
%173:void = call %insert_i1_i1_, %param_18, %param_19
%174:i32 = load %treeIndex_1
%175:i32 = add %174, 1i
store %treeIndex_1, %175
%176:i32 = load %treeIndex_1
store %param_20, %176
store %param_21, 17i
%177:void = call %insert_i1_i1_, %param_20, %param_21
%178:i32 = load %treeIndex_1
%179:i32 = add %178, 1i
store %treeIndex_1, %179
%180:i32 = load %treeIndex_1
store %param_22, %180
store %param_23, 13i
%181:void = call %insert_i1_i1_, %param_22, %param_23
store %count, 0i
store %i, 0i
loop [b: $B28, c: $B29] { # loop_3
$B28: { # body
%182:i32 = load %i
%183:bool = lt %182, 20i
if %183 [t: $B30, f: $B31] { # if_12
$B30: { # true
exit_if # if_12
}
$B31: { # false
exit_loop # loop_3
}
}
%184:i32 = load %i
store %param_24, %184
%185:i32 = call %search_i1_, %param_24
%x_139:i32 = let %185
store %result, %x_139
%187:i32 = load %i
%x_140:i32 = let %187
switch %x_140 [c: (2i 5i 6i 7i 8i 9i 12i 13i 15i 17i, $B32), c: (default, $B33)] { # switch_1
$B32: { # case
%189:i32 = load %result
%190:i32 = load %i
%191:bool = eq %189, %190
if %191 [t: $B34] { # if_13
$B34: { # true
%192:i32 = load %count
%193:i32 = add %192, 1i
store %count, %193
exit_if # if_13
}
}
exit_switch # switch_1
}
$B33: { # case
%194:i32 = load %result
%195:bool = eq %194, -1i
if %195 [t: $B35] { # if_14
$B35: { # true
%196:i32 = load %count
%197:i32 = add %196, 1i
store %count, %197
exit_if # if_14
}
}
exit_switch # switch_1
}
}
continue # -> $B29
}
$B29: { # continuing
%198:i32 = load %i
%199:i32 = add %198, 1i
store %i, %199
next_iteration # -> $B28
}
}
%200:i32 = load %count
%201:bool = eq %200, 20i
if %201 [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: {
%203:void = call %main_1
%204:vec4<f32> = load %x_GLF_color
%205:main_out = construct %204
ret %205
}
}
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. *
********************************************************************