blob: 0062e62756d36517115542e2c29ca582ee0ec0df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
; RUN: llc < %s -mtriple=nvptx64 -mattr=+ptx64 -mcpu=sm_30 | FileCheck %s
; RUN: %if ptxas-isa-6.0 %{llc < %s -mtriple=nvptx64 -mattr=+ptx60 -mcpu=sm_30 | %ptxas-verify %}
@function_pointer = addrspace(1) global ptr null
; CHECK: .func trap_wrapper
; CHECK-NEXT: ()
; CHECK-NEXT: .noreturn;
declare void @trap_wrapper() #0
; CHECK: .func {{.*}} non_void_noreturn()
; CHECK-NOT: .noreturn
define i32 @non_void_noreturn() #0 {
ret i32 54
}
; CHECK: .func true_noreturn0()
; CHECK-NEXT: .noreturn
define void @true_noreturn0() #0 {
call void @trap_wrapper()
ret void
}
; CHECK: .entry ignore_kernel_noreturn()
; CHECK-NOT: .noreturn
define ptx_kernel void @ignore_kernel_noreturn() #0 {
unreachable
}
; CHECK-LABEL: .entry callprototype_noreturn(
; CHECK: prototype_{{[0-9]+}} : .callprototype ()_ (.param .b32 _) .noreturn;
; CHECK: prototype_{{[0-9]+}} : .callprototype (.param .b32 _) _ (.param .b32 _);
define ptx_kernel void @callprototype_noreturn(i32) {
%fn = load ptr, ptr addrspace(1) @function_pointer
call void %fn(i32 %0) #0
%non_void = bitcast ptr %fn to ptr
%2 = call i32 %non_void(i32 %0) #0
ret void
}
attributes #0 = { noreturn }
|