[LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)
[llvm-project.git] / llvm / test / CodeGen / SPIRV / branching / OpSwitchBranches.ll
blob145c43c6da32b68d80ac7fd8d83102baacf07caf
1 ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
3 define i32 @test_switch_branches(i32 %a) {
4 entry:
5   %alloc = alloca i32
6 ; CHECK-SPIRV:      OpSwitch %[[#]] %[[#DEFAULT:]] 1 %[[#CASE1:]] 2 %[[#CASE2:]] 3 %[[#CASE3:]]
7   switch i32 %a, label %default [
8     i32 1, label %case1
9     i32 2, label %case2
10     i32 3, label %case3
11   ]
13 ; CHECK-SPIRV:      %[[#CASE1]] = OpLabel
14 case1:
15   store i32 1, ptr %alloc
16 ; CHECK-SPIRV:      OpBranch %[[#END:]]
17   br label %end
19 ; CHECK-SPIRV:      %[[#CASE2]] = OpLabel
20 case2:
21   store i32 2, ptr %alloc
22 ; CHECK-SPIRV:      OpBranch %[[#END]]
23   br label %end
25 ; CHECK-SPIRV:      %[[#CASE3]] = OpLabel
26 case3:
27   store i32 3, ptr %alloc
28 ; CHECK-SPIRV:      OpBranch %[[#END]]
29   br label %end
31 ; CHECK-SPIRV:      %[[#DEFAULT]] = OpLabel
32 default:
33   store i32 0, ptr %alloc
34 ; CHECK-SPIRV:      OpBranch %[[#END]]
35   br label %end
37 ; CHECK-SPIRV:      %[[#END]] = OpLabel
38 end:
39   %result = load i32, ptr %alloc
40   ret i32 %result