blob: 667a4ad4402faa58aaa6b6495e34228d6f0f7fc5 [file] [log] [blame]
SKIP: FAILED
../../src/tint/lang/msl/writer/printer/printer.cc:1257 internal compiler error: BST = struct @align(4) {
data:i32 @offset(0)
leftIndex:i32 @offset(4)
rightIndex:i32 @offset(8)
}
main_out = struct @align(16) {
x_GLF_color_1:vec4<f32> @offset(0), @location(0)
}
$B1: { # root
%tree:ptr<private, array<BST, 10>, read_write> = var
%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: {
%6:ptr<function, i32, read_write> = access %node, 0u
%7:i32 = load %data
store %6, %7
%8:ptr<function, i32, read_write> = access %node, 1u
store %8, -1i
%9:ptr<function, i32, read_write> = access %node, 2u
store %9, -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
%18:i32 = load %baseIndex
%19:i32 = load %treeIndex
%20:bool = lte %18, %19
if %20 [t: $B6, f: $B7] { # if_1
$B6: { # true
exit_if # if_1
}
$B7: { # false
exit_loop # loop_1
}
}
%21:i32 = load %data_1
%22:i32 = load %baseIndex
%23:ptr<private, i32, read_write> = access %tree, %22, 0u
%24:i32 = load %23
%25:bool = lte %21, %24
if %25 [t: $B8, f: $B9] { # if_2
$B8: { # true
%26:i32 = load %baseIndex
%27:ptr<private, i32, read_write> = access %tree, %26, 1u
%28:i32 = load %27
%29:bool = eq %28, -1i
if %29 [t: $B10, f: $B11] { # if_3
$B10: { # true
%30:i32 = load %baseIndex
%x_186:i32 = let %30
%32:ptr<private, i32, read_write> = access %tree, %x_186, 1u
%33:i32 = load %treeIndex
store %32, %33
%34:i32 = load %treeIndex
%x_189:i32 = let %34
%36:ptr<private, BST, read_write> = access %tree, %x_189
%37:BST = load %36
store %param, %37
%38:i32 = load %data_1
store %param_1, %38
%39:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param, %param_1
%40:ptr<private, BST, read_write> = access %tree, %x_189
%41:BST = load %param
store %40, %41
ret
}
$B11: { # false
%42:i32 = load %baseIndex
%43:ptr<private, i32, read_write> = access %tree, %42, 1u
%44:i32 = load %43
store %baseIndex, %44
continue # -> $B5
}
}
exit_if # if_2
}
$B9: { # false
%45:i32 = load %baseIndex
%46:ptr<private, i32, read_write> = access %tree, %45, 2u
%47:i32 = load %46
%48:bool = eq %47, -1i
if %48 [t: $B12, f: $B13] { # if_4
$B12: { # true
%49:i32 = load %baseIndex
%x_206:i32 = let %49
%51:ptr<private, i32, read_write> = access %tree, %x_206, 2u
%52:i32 = load %treeIndex
store %51, %52
%53:i32 = load %treeIndex
%x_209:i32 = let %53
%55:ptr<private, BST, read_write> = access %tree, %x_209
%56:BST = load %55
store %param_2, %56
%57:i32 = load %data_1
store %param_3, %57
%58:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_2, %param_3
%59:ptr<private, BST, read_write> = access %tree, %x_209
%60:BST = load %param_2
store %59, %60
ret
}
$B13: { # false
%61:i32 = load %baseIndex
%62:ptr<private, i32, read_write> = access %tree, %61, 2u
%63:i32 = load %62
store %baseIndex, %63
continue # -> $B5
}
}
exit_if # if_2
}
}
unreachable
}
$B5: { # continuing
next_iteration # -> $B4
}
}
ret
}
}
%search_i1_ = func(%t:ptr<function, i32, read_write>):i32 {
$B14: {
%index:ptr<function, i32, read_write> = var
%currentNode:ptr<function, BST, read_write> = var
%x_220:ptr<function, i32, read_write> = var
store %index, 0i
loop [b: $B15, c: $B16] { # loop_2
$B15: { # body
%69:i32 = load %index
%70:bool = neq %69, -1i
if %70 [t: $B17, f: $B18] { # if_5
$B17: { # true
exit_if # if_5
}
$B18: { # false
exit_loop # loop_2
}
}
%71:i32 = load %index
%72:ptr<private, BST, read_write> = access %tree, %71
%73:BST = load %72
store %currentNode, %73
%74:ptr<function, i32, read_write> = access %currentNode, 0u
%75:i32 = load %74
%76:i32 = load %t
%77:bool = eq %75, %76
if %77 [t: $B19] { # if_6
$B19: { # true
%78:i32 = load %t
%x_237:i32 = let %78
ret %x_237
}
}
%80:i32 = load %t
%81:ptr<function, i32, read_write> = access %currentNode, 0u
%82:i32 = load %81
%83:bool = gt %80, %82
if %83 [t: $B20, f: $B21] { # if_7
$B20: { # true
%84:ptr<function, i32, read_write> = access %currentNode, 2u
%85:i32 = load %84
store %x_220, %85
exit_if # if_7
}
$B21: { # false
%86:ptr<function, i32, read_write> = access %currentNode, 1u
%87:i32 = load %86
store %x_220, %87
exit_if # if_7
}
}
%88:i32 = load %x_220
store %index, %88
continue # -> $B16
}
$B16: { # continuing
next_iteration # -> $B15
}
}
ret -1i
}
}
%main_1 = func():void {
$B22: {
%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
%115:ptr<private, BST, read_write> = access %tree, 0i
%116:BST = load %115
store %param_4, %116
store %param_5, 9i
%117:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_4, %param_5
%118:ptr<private, BST, read_write> = access %tree, 0i
%119:BST = load %param_4
store %118, %119
%120:i32 = load %treeIndex_1
%121:i32 = add %120, 1i
store %treeIndex_1, %121
%122:i32 = load %treeIndex_1
store %param_6, %122
store %param_7, 5i
%123:void = call %insert_i1_i1_, %param_6, %param_7
%124:i32 = load %treeIndex_1
%125:i32 = add %124, 1i
store %treeIndex_1, %125
%126:i32 = load %treeIndex_1
store %param_8, %126
store %param_9, 12i
%127:void = call %insert_i1_i1_, %param_8, %param_9
%128:i32 = load %treeIndex_1
%129:i32 = add %128, 1i
store %treeIndex_1, %129
%130:i32 = load %treeIndex_1
store %param_10, %130
store %param_11, 15i
%131:void = call %insert_i1_i1_, %param_10, %param_11
%132:i32 = load %treeIndex_1
%133:i32 = add %132, 1i
store %treeIndex_1, %133
%134:i32 = load %treeIndex_1
store %param_12, %134
store %param_13, 7i
%135:void = call %insert_i1_i1_, %param_12, %param_13
%136:i32 = load %treeIndex_1
%137:i32 = add %136, 1i
store %treeIndex_1, %137
%138:i32 = load %treeIndex_1
store %param_14, %138
store %param_15, 8i
%139:void = call %insert_i1_i1_, %param_14, %param_15
%140:i32 = load %treeIndex_1
%141:i32 = add %140, 1i
store %treeIndex_1, %141
%142:i32 = load %treeIndex_1
store %param_16, %142
store %param_17, 2i
%143:void = call %insert_i1_i1_, %param_16, %param_17
%144:i32 = load %treeIndex_1
%145:i32 = add %144, 1i
store %treeIndex_1, %145
%146:i32 = load %treeIndex_1
store %param_18, %146
store %param_19, 6i
%147:void = call %insert_i1_i1_, %param_18, %param_19
%148:i32 = load %treeIndex_1
%149:i32 = add %148, 1i
store %treeIndex_1, %149
%150:i32 = load %treeIndex_1
store %param_20, %150
store %param_21, 17i
%151:void = call %insert_i1_i1_, %param_20, %param_21
%152:i32 = load %treeIndex_1
%153:i32 = add %152, 1i
store %treeIndex_1, %153
%154:i32 = load %treeIndex_1
store %param_22, %154
store %param_23, 13i
%155:void = call %insert_i1_i1_, %param_22, %param_23
store %count, 0i
store %i, 0i
loop [b: $B23, c: $B24] { # loop_3
$B23: { # body
%156:i32 = load %i
%157:bool = lt %156, 20i
if %157 [t: $B25, f: $B26] { # if_8
$B25: { # true
exit_if # if_8
}
$B26: { # false
exit_loop # loop_3
}
}
%158:i32 = load %i
store %param_24, %158
%159:i32 = call %search_i1_, %param_24
%x_132:i32 = let %159
store %result, %x_132
%161:i32 = load %i
%x_133:i32 = let %161
switch %x_133 [c: (2i 5i 6i 7i 8i 9i 12i 13i 15i 17i, $B27), c: (default, $B28)] { # switch_1
$B27: { # case
%163:i32 = load %result
%164:i32 = load %i
%165:bool = eq %163, %164
if %165 [t: $B29] { # if_9
$B29: { # true
%166:i32 = load %count
%167:i32 = add %166, 1i
store %count, %167
exit_if # if_9
}
}
exit_switch # switch_1
}
$B28: { # case
%168:i32 = load %result
%169:bool = eq %168, -1i
if %169 [t: $B30] { # if_10
$B30: { # true
%170:i32 = load %count
%171:i32 = add %170, 1i
store %count, %171
exit_if # if_10
}
}
exit_switch # switch_1
}
}
continue # -> $B24
}
$B24: { # continuing
%172:i32 = load %i
%173:i32 = add %172, 1i
store %i, %173
next_iteration # -> $B23
}
}
%174:i32 = load %count
%175:bool = eq %174, 20i
if %175 [t: $B31, f: $B32] { # if_11
$B31: { # true
store %x_GLF_color, vec4<f32>(1.0f, 0.0f, 0.0f, 1.0f)
exit_if # if_11
}
$B32: { # false
store %x_GLF_color, vec4<f32>(0.0f, 0.0f, 1.0f, 1.0f)
exit_if # if_11
}
}
ret
}
}
%tint_symbol = @fragment func():main_out {
$B33: {
%177:void = call %main_1
%178:vec4<f32> = load %x_GLF_color
%179:main_out = construct %178
ret %179
}
}
invalid entry point IO struct uses
********************************************************************
* 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. *
********************************************************************