Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/transcoding/OpSwitchEmpty.ll

raw
1 ; Source:
2 ; void kk(int x){
3 ; switch(x) {
4 ; default: return;
5 ; }
6 ; }
7
8 ; Command:
9 ; clang -cc1 -triple spir -emit-llvm -o test/SPIRV/OpSwitchEmpty.ll OpSwitchEmpty.cl -disable-llvm-passes
10
11 ; RUN: llvm-as %s -o %t.bc
12 ; RUN: llvm-spirv %t.bc -spirv-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
13 ; RUN: llvm-spirv %t.bc -o %t.spv
14 ; RUN: spirv-val %t.spv
15 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o - | FileCheck %s --check-prefix=CHECK-LLVM
16
17 ; CHECK-SPIRV: FunctionParameter {{[0-9]+}} [[X:[0-9]+]]
18 ; CHECK-SPIRV: Switch [[X]] [[DEFAULT:[0-9]+]] {{$}}
19 ; CHECK-SPIRV: Label [[DEFAULT]]
20
21 ; ModuleID = 'test/SPIRV/OpSwitchEmpty.ll'
22 target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
23 target triple = "spir"
24
25 ; Function Attrs: nounwind
26 define spir_func void @kk(i32 %x) #0 {
27 entry:
28 switch i32 %x, label %sw.default [
29 ]
30 ; CHECK-LLVM: switch i32 %x, label %sw.default [
31 ; CHECK-LLVM-NEXT: ]
32
33 sw.default: ; preds = %entry
34 ret void
35 }
36
37 attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
38
39 !llvm.module.flags = !{!0}
40 !opencl.enable.FP_CONTRACT = !{}
41 !opencl.ocl.version = !{!1}
42 !opencl.spir.version = !{!2}
43 !opencl.used.extensions = !{!3}
44 !opencl.used.optional.core.features = !{!3}
45 !opencl.compiler.options = !{!3}
46
47 !0 = !{i32 1, !"wchar_size", i32 4}
48 !1 = !{i32 1, i32 0}
49 !2 = !{i32 1, i32 2}
50 !3 = !{}