1 ; RUN: llc < %s -march=nvptx64 -mattr=+ptx64 -mcpu=sm_30 | FileCheck %s
2 ; RUN: %if ptxas %{llc < %s -march=nvptx64 -mattr=+ptx60 -mcpu=sm_30 | %ptxas-verify %}
4 @function_pointer = addrspace(1) global ptr null
6 ; CHECK: .func trap_wrapper
8 ; CHECK-NEXT: .noreturn;
10 declare void @trap_wrapper() #0
12 ; CHECK: .func {{.*}} non_void_noreturn()
13 ; CHECK-NOT: .noreturn
15 define i32 @non_void_noreturn() #0 {
19 ; CHECK: .func true_noreturn0()
20 ; CHECK-NEXT: .noreturn
22 define void @true_noreturn0() #0 {
23 call void @trap_wrapper()
27 ; CHECK: .entry ignore_kernel_noreturn()
28 ; CHECK-NOT: .noreturn
30 define void @ignore_kernel_noreturn() #0 {
34 ; CHECK-LABEL: .entry callprototype_noreturn(
35 ; CHECK: prototype_{{[0-9]+}} : .callprototype ()_ (.param .b32 _) .noreturn;
36 ; CHECK: prototype_{{[0-9]+}} : .callprototype (.param .b32 _) _ (.param .b32 _);
38 define void @callprototype_noreturn(i32) {
39 %fn = load ptr, ptr addrspace(1) @function_pointer
40 call void %fn(i32 %0) #0
41 %non_void = bitcast ptr %fn to ptr
42 %2 = call i32 %non_void(i32 %0) #0
46 attributes #0 = { noreturn }
48 !nvvm.annotations = !{!0, !1}
50 !0 = !{ptr @ignore_kernel_noreturn, !"kernel", i32 1}
51 !1 = !{ptr @callprototype_noreturn, !"kernel", i32 1}