1 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
4 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
5 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
7 define spir_kernel void @test_two_switch_same_register(i32 %value) {
8 ; CHECK-SPIRV: OpSwitch %[[#REGISTER:]] %[[#DEFAULT1:]] 1 %[[#CASE1:]] 0 %[[#CASE2:]]
9 switch i32 %value, label %default1 [
21 switch i32 %value, label %default2 [
35 ; CHECK-SPIRV: %[[#CASE1]] = OpLabel
36 ; CHECK-SPIRV-NEXT: OpBranch %[[#DEFAULT1]]
38 ; CHECK-SPIRV: %[[#CASE2]] = OpLabel
39 ; CHECK-SPIRV-NEXT: OpBranch %[[#DEFAULT1]]
41 ; CHECK-SPIRV: %[[#DEFAULT1]] = OpLabel
42 ; CHECK-SPIRV-NEXT: OpSwitch %[[#REGISTER]] %[[#DEFAULT2:]] 0 %[[#CASE3:]] 1 %[[#CASE4:]]
44 ; CHECK-SPIRV: %[[#CASE3]] = OpLabel
45 ; CHECK-SPIRV-NEXT: OpBranch %[[#DEFAULT2]]
47 ; CHECK-SPIRV: %[[#CASE4:]] = OpLabel
48 ; CHECK-SPIRV-NEXT: OpBranch %[[#DEFAULT2]]
50 ; CHECK-SPIRV: %[[#DEFAULT2]] = OpLabel
51 ; CHECK-SPIRV-NEXT: OpReturn