| 1 |
; RUN: llc -mtriple=spirv-unknown-vulkan-compute -O0 %s -o - | FileCheck %s |
| 2 |
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan-compute %s -o - -filetype=obj | spirv-val %} |
| 3 |
|
| 4 |
; |
| 5 |
; [numthreads(1, 1, 1)] |
| 6 |
; void main() { |
| 7 |
; /////////////////////////////// |
| 8 |
; // 32-bit int literal switch // |
| 9 |
; /////////////////////////////// |
| 10 |
; switch (0) { |
| 11 |
; case 0: |
| 12 |
; return; |
| 13 |
; default: |
| 14 |
; return; |
| 15 |
; } |
| 16 |
; |
| 17 |
; /////////////////////////////// |
| 18 |
; // 64-bit int literal switch // |
| 19 |
; /////////////////////////////// |
| 20 |
; switch (12345678910) { |
| 21 |
; case 12345678910: |
| 22 |
; return; |
| 23 |
; } |
| 24 |
; |
| 25 |
; return; |
| 26 |
; } |
| 27 |
|
| 28 |
; CHECK: %[[#func_3:]] = OpFunction %[[#void:]] DontInline %[[#]] |
| 29 |
; CHECK: %[[#bb6:]] = OpLabel |
| 30 |
; CHECK: OpReturn |
| 31 |
; CHECK: OpFunctionEnd |
| 32 |
; CHECK: %[[#func_4:]] = OpFunction %[[#void:]] None %[[#]] |
| 33 |
; CHECK: %[[#bb7:]] = OpLabel |
| 34 |
; CHECK: OpReturn |
| 35 |
; CHECK: OpFunctionEnd |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-G1" |
| 40 |
target triple = "spirv-unknown-vulkan1.3-compute" |
| 41 |
|
| 42 |
; Function Attrs: convergent noinline norecurse nounwind optnone |
| 43 |
define internal spir_func void @main() #0 { |
| 44 |
entry: |
| 45 |
%0 = call token @llvm.experimental.convergence.entry() |
| 46 |
ret void |
| 47 |
} |
| 48 |
|
| 49 |
; Function Attrs: convergent norecurse |
| 50 |
define void @main.1() #1 { |
| 51 |
entry: |
| 52 |
call void @main() |
| 53 |
ret void |
| 54 |
} |
| 55 |
|
| 56 |
; Function Attrs: convergent nocallback nofree nosync nounwind willreturn memory(none) |
| 57 |
declare token @llvm.experimental.convergence.entry() #2 |
| 58 |
|
| 59 |
attributes #0 = { convergent noinline norecurse nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" } |
| 60 |
attributes #1 = { convergent norecurse "frame-pointer"="all" "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" "no-trapping-math"="true" "stack-protector-buffer-size"="8" } |
| 61 |
attributes #2 = { convergent nocallback nofree nosync nounwind willreturn memory(none) } |
| 62 |
|
| 63 |
!llvm.module.flags = !{!0, !1, !2} |
| 64 |
|
| 65 |
|
| 66 |
!0 = !{i32 1, !"wchar_size", i32 4} |
| 67 |
!1 = !{i32 4, !"dx.disable_optimizations", i32 1} |
| 68 |
!2 = !{i32 7, !"frame-pointer", i32 2} |
| 69 |
|
| 70 |
|