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 void @test_switch_with_unreachable_block(i1 %a) {
8 %value = zext i1 %a to i32
9 ; CHECK-SPIRV: OpSwitch %[[#]] %[[#UNREACHABLE:]] 0 %[[#REACHABLE:]] 1 %[[#REACHABLE:]]
10 switch i32 %value, label %unreachable [
11 i32 0, label %reachable
12 i32 1, label %reachable
15 ; CHECK-SPIRV: %[[#UNREACHABLE]] = OpLabel
16 ; CHECK-SPIRV-NEXT: OpUnreachable
18 ; CHECK-SPIRV-NEXT: %[[#REACHABLE]] = OpLabel
20 ; CHECK-SPIRV-NEXT: OpReturn