Skip to content

Commit 328e12c

Browse files
Auto-generate checks
1 parent 29acb3c commit 328e12c

File tree

1 file changed

+80
-28
lines changed

1 file changed

+80
-28
lines changed

llvm/test/CodeGen/NVPTX/unreachable.ll

Lines changed: 80 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,103 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
12
; RUN: llc < %s -march=nvptx -mcpu=sm_20 -verify-machineinstrs -trap-unreachable=false \
2-
; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-NOTRAP
3+
; RUN: | FileCheck %s --check-prefixes=CHECK,NO-TRAP-UNREACHABLE
34
; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -verify-machineinstrs -trap-unreachable=false \
4-
; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-NOTRAP
5+
; RUN: | FileCheck %s --check-prefixes=CHECK,NO-TRAP-UNREACHABLE
56
; RUN: llc < %s -march=nvptx -mcpu=sm_20 -verify-machineinstrs -trap-unreachable -no-trap-after-noreturn \
6-
; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-NOTRAP
7+
; RUN: | FileCheck %s --check-prefixes=CHECK,NO-TRAP-AFTER-NORETURN
78
; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -verify-machineinstrs -trap-unreachable -no-trap-after-noreturn \
8-
; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-NOTRAP
9+
; RUN: | FileCheck %s --check-prefixes=CHECK,NO-TRAP-AFTER-NORETURN
910
; RUN: llc < %s -march=nvptx -mcpu=sm_20 -verify-machineinstrs -trap-unreachable -no-trap-after-noreturn=false \
10-
; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-TRAP
11+
; RUN: | FileCheck %s --check-prefixes=CHECK,TRAP
1112
; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -verify-machineinstrs -trap-unreachable -no-trap-after-noreturn=false \
12-
; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-TRAP
13+
; RUN: | FileCheck %s --check-prefixes=CHECK,TRAP
1314
; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -verify-machineinstrs -trap-unreachable -mattr=+ptx83 \
14-
; RUN: | FileCheck %s --check-prefix=CHECK-BUG-FIXED
15+
; RUN: | FileCheck %s --check-prefixes=BUG-FIXED
1516
; RUN: %if ptxas && !ptxas-12.0 %{ llc < %s -march=nvptx -mcpu=sm_20 -verify-machineinstrs | %ptxas-verify %}
1617
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 -verify-machineinstrs | %ptxas-verify %}
1718

18-
; CHECK: .extern .func throw
19+
target triple = "nvptx-unknown-cuda"
20+
1921
declare void @throw() #0
2022
declare void @llvm.trap() #0
2123

22-
; CHECK-LABEL: .entry kernel_func
2324
define void @kernel_func() {
24-
; CHECK: call.uni
25-
; CHECK: throw,
25+
; NO-TRAP-UNREACHABLE-LABEL: kernel_func(
26+
; NO-TRAP-UNREACHABLE: {
27+
; NO-TRAP-UNREACHABLE-EMPTY:
28+
; NO-TRAP-UNREACHABLE-EMPTY:
29+
; NO-TRAP-UNREACHABLE-NEXT: // %bb.0:
30+
; NO-TRAP-UNREACHABLE-NEXT: { // callseq 0, 0
31+
; NO-TRAP-UNREACHABLE-NEXT: call.uni
32+
; NO-TRAP-UNREACHABLE-NEXT: throw,
33+
; NO-TRAP-UNREACHABLE-NEXT: (
34+
; NO-TRAP-UNREACHABLE-NEXT: );
35+
; NO-TRAP-UNREACHABLE-NEXT: } // callseq 0
36+
; NO-TRAP-UNREACHABLE-NEXT: // begin inline asm
37+
; NO-TRAP-UNREACHABLE-NEXT: exit;
38+
; NO-TRAP-UNREACHABLE-NEXT: // end inline asm
39+
;
40+
; NO-TRAP-AFTER-NORETURN-LABEL: kernel_func(
41+
; NO-TRAP-AFTER-NORETURN: {
42+
; NO-TRAP-AFTER-NORETURN-EMPTY:
43+
; NO-TRAP-AFTER-NORETURN-EMPTY:
44+
; NO-TRAP-AFTER-NORETURN-NEXT: // %bb.0:
45+
; NO-TRAP-AFTER-NORETURN-NEXT: { // callseq 0, 0
46+
; NO-TRAP-AFTER-NORETURN-NEXT: call.uni
47+
; NO-TRAP-AFTER-NORETURN-NEXT: throw,
48+
; NO-TRAP-AFTER-NORETURN-NEXT: (
49+
; NO-TRAP-AFTER-NORETURN-NEXT: );
50+
; NO-TRAP-AFTER-NORETURN-NEXT: } // callseq 0
51+
; NO-TRAP-AFTER-NORETURN-NEXT: // begin inline asm
52+
; NO-TRAP-AFTER-NORETURN-NEXT: exit;
53+
; NO-TRAP-AFTER-NORETURN-NEXT: // end inline asm
54+
; NO-TRAP-AFTER-NORETURN-NEXT: trap; exit;
55+
;
56+
; TRAP-LABEL: kernel_func(
57+
; TRAP: {
58+
; TRAP-EMPTY:
59+
; TRAP-EMPTY:
60+
; TRAP-NEXT: // %bb.0:
61+
; TRAP-NEXT: { // callseq 0, 0
62+
; TRAP-NEXT: call.uni
63+
; TRAP-NEXT: throw,
64+
; TRAP-NEXT: (
65+
; TRAP-NEXT: );
66+
; TRAP-NEXT: } // callseq 0
67+
; TRAP-NEXT: trap; exit;
68+
;
69+
; BUG-FIXED-LABEL: kernel_func(
70+
; BUG-FIXED: {
71+
; BUG-FIXED-EMPTY:
72+
; BUG-FIXED-EMPTY:
73+
; BUG-FIXED-NEXT: // %bb.0:
74+
; BUG-FIXED-NEXT: { // callseq 0, 0
75+
; BUG-FIXED-NEXT: call.uni
76+
; BUG-FIXED-NEXT: throw,
77+
; BUG-FIXED-NEXT: (
78+
; BUG-FIXED-NEXT: );
79+
; BUG-FIXED-NEXT: } // callseq 0
80+
; BUG-FIXED-NEXT: trap;
2681
call void @throw()
27-
; CHECK-TRAP-NOT: exit;
28-
; CHECK-TRAP: trap;
29-
30-
; CHECK-NOTRAP-NOT: trap;
31-
; CHECK: exit;
32-
33-
; CHECK-BUG-FIXED-NOT: exit;
34-
; CHECK-BUG-FIXED: trap;
3582
unreachable
3683
}
3784

38-
; CHECK-LABEL: kernel_func_2
3985
define void @kernel_func_2() {
40-
; CHECK: trap; exit;
41-
; CHECK-BUG-FIXED: trap;
42-
; CHECK-BUG-FIXED-NOT: trap; exit;
86+
; CHECK-LABEL: kernel_func_2(
87+
; CHECK: {
88+
; CHECK-EMPTY:
89+
; CHECK-EMPTY:
90+
; CHECK-NEXT: // %bb.0:
91+
; CHECK-NEXT: trap; exit;
92+
;
93+
; BUG-FIXED-LABEL: kernel_func_2(
94+
; BUG-FIXED: {
95+
; BUG-FIXED-EMPTY:
96+
; BUG-FIXED-EMPTY:
97+
; BUG-FIXED-NEXT: // %bb.0:
98+
; BUG-FIXED-NEXT: trap;
4399
call void @llvm.trap()
44-
45-
;; Make sure we avoid emitting two trap instructions.
46-
; CHECK-NOT: trap;
47-
; CHECK-NOT: exit;
48-
; CHECK-BUG-FIXED-NOT: trap;
100+
; Make sure we avoid emitting two trap instructions.
49101
unreachable
50102
}
51103

0 commit comments

Comments
 (0)