annotate clang/test/CodeGen/catch-implicit-integer-sign-changes-incdec.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
1 // RUN: %clang_cc1 -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=CHECK-NOSANITIZE
150
anatofuz
parents:
diff changeset
2
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
3 // RUN: %clang_cc1 -fsanitize=implicit-integer-sign-change -fno-sanitize-recover=implicit-integer-sign-change -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
4 // RUN: %clang_cc1 -fsanitize=implicit-integer-sign-change -fsanitize-recover=implicit-integer-sign-change -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
5 // RUN: %clang_cc1 -fsanitize=implicit-integer-sign-change -fsanitize-trap=implicit-integer-sign-change -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK-SANITIZE,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE
150
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 // CHECK-SANITIZE-ANYRECOVER-DAG: @[[INT:.*]] = {{.*}} c"'int'\00" }
anatofuz
parents:
diff changeset
8 // CHECK-SANITIZE-ANYRECOVER-DAG: @[[UNSIGNED_SHORT:.*]] = {{.*}} c"'unsigned short'\00" }
anatofuz
parents:
diff changeset
9 // CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_100:.*]] = {{.*}}, i32 100, i32 11 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 3 }
anatofuz
parents:
diff changeset
10 // CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_200:.*]] = {{.*}}, i32 200, i32 11 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 3 }
anatofuz
parents:
diff changeset
11 // CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_300:.*]] = {{.*}}, i32 300, i32 10 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 3 }
anatofuz
parents:
diff changeset
12 // CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_400:.*]] = {{.*}}, i32 400, i32 10 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 3 }
anatofuz
parents:
diff changeset
13 // CHECK-SANITIZE-ANYRECOVER-DAG: @[[SHORT:.*]] = {{.*}} c"'short'\00" }
anatofuz
parents:
diff changeset
14 // CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_500:.*]] = {{.*}}, i32 500, i32 11 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 3 }
anatofuz
parents:
diff changeset
15 // CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_600:.*]] = {{.*}}, i32 600, i32 11 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 3 }
anatofuz
parents:
diff changeset
16 // CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_700:.*]] = {{.*}}, i32 700, i32 10 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 3 }
anatofuz
parents:
diff changeset
17 // CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_800:.*]] = {{.*}}, i32 800, i32 10 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 3 }
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 unsigned short t0(unsigned short x) {
anatofuz
parents:
diff changeset
20 // CHECK-NOSANITIZE-LABEL: @t0(
anatofuz
parents:
diff changeset
21 // CHECK-NOSANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
22 // CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
23 // CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
24 // CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
25 // CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], 1
anatofuz
parents:
diff changeset
26 // CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
27 // CHECK-NOSANITIZE-NEXT: ret i16 [[X_RELOADED]]
anatofuz
parents:
diff changeset
28 //
anatofuz
parents:
diff changeset
29 // CHECK-SANITIZE-LABEL: @t0(
anatofuz
parents:
diff changeset
30 // CHECK-SANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
31 // CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
32 // CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
33 // CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
34 // CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = zext i16 [[X_RELOADED]] to i32
anatofuz
parents:
diff changeset
35 // CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], 1
anatofuz
parents:
diff changeset
36 // CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
anatofuz
parents:
diff changeset
37 // CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
anatofuz
parents:
diff changeset
38 // CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], false, !nosanitize
anatofuz
parents:
diff changeset
39 // CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
anatofuz
parents:
diff changeset
40 // CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
41 // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.ubsantrap(i8 7){{.*}}, !nosanitize
150
anatofuz
parents:
diff changeset
42 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
anatofuz
parents:
diff changeset
43 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
anatofuz
parents:
diff changeset
44 // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_100]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
45 // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_100]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
46 // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
anatofuz
parents:
diff changeset
47 // CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
anatofuz
parents:
diff changeset
48 // CHECK-SANITIZE: [[CONT]]:
anatofuz
parents:
diff changeset
49 // CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
50 // CHECK-SANITIZE-NEXT: ret i16 [[X_RELOADED]]
anatofuz
parents:
diff changeset
51 #line 100
anatofuz
parents:
diff changeset
52 return x++;
anatofuz
parents:
diff changeset
53 }
anatofuz
parents:
diff changeset
54 unsigned short t1(unsigned short x) {
anatofuz
parents:
diff changeset
55 // CHECK-NOSANITIZE-LABEL: @t1(
anatofuz
parents:
diff changeset
56 // CHECK-NOSANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
57 // CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
58 // CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
59 // CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
60 // CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], -1
anatofuz
parents:
diff changeset
61 // CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
62 // CHECK-NOSANITIZE-NEXT: ret i16 [[X_RELOADED]]
anatofuz
parents:
diff changeset
63 //
anatofuz
parents:
diff changeset
64 // CHECK-SANITIZE-LABEL: @t1(
anatofuz
parents:
diff changeset
65 // CHECK-SANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
66 // CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
67 // CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
68 // CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
69 // CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = zext i16 [[X_RELOADED]] to i32
anatofuz
parents:
diff changeset
70 // CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], -1
anatofuz
parents:
diff changeset
71 // CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
anatofuz
parents:
diff changeset
72 // CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
anatofuz
parents:
diff changeset
73 // CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], false, !nosanitize
anatofuz
parents:
diff changeset
74 // CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
anatofuz
parents:
diff changeset
75 // CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
76 // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.ubsantrap(i8 7){{.*}}, !nosanitize
150
anatofuz
parents:
diff changeset
77 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
anatofuz
parents:
diff changeset
78 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
anatofuz
parents:
diff changeset
79 // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_200]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
80 // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_200]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
81 // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
anatofuz
parents:
diff changeset
82 // CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
anatofuz
parents:
diff changeset
83 // CHECK-SANITIZE: [[CONT]]:
anatofuz
parents:
diff changeset
84 // CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
85 // CHECK-SANITIZE-NEXT: ret i16 [[X_RELOADED]]
anatofuz
parents:
diff changeset
86 #line 200
anatofuz
parents:
diff changeset
87 return x--;
anatofuz
parents:
diff changeset
88 }
anatofuz
parents:
diff changeset
89
anatofuz
parents:
diff changeset
90 unsigned short t2(unsigned short x) {
anatofuz
parents:
diff changeset
91 // CHECK-NOSANITIZE-LABEL: @t2(
anatofuz
parents:
diff changeset
92 // CHECK-NOSANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
93 // CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
94 // CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
95 // CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
96 // CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], 1
anatofuz
parents:
diff changeset
97 // CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
98 // CHECK-NOSANITIZE-NEXT: ret i16 [[INC]]
anatofuz
parents:
diff changeset
99 //
anatofuz
parents:
diff changeset
100 // CHECK-SANITIZE-LABEL: @t2(
anatofuz
parents:
diff changeset
101 // CHECK-SANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
102 // CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
103 // CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
104 // CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
105 // CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = zext i16 [[X_RELOADED]] to i32
anatofuz
parents:
diff changeset
106 // CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], 1
anatofuz
parents:
diff changeset
107 // CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
anatofuz
parents:
diff changeset
108 // CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
anatofuz
parents:
diff changeset
109 // CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], false, !nosanitize
anatofuz
parents:
diff changeset
110 // CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
anatofuz
parents:
diff changeset
111 // CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
112 // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.ubsantrap(i8 7){{.*}}, !nosanitize
150
anatofuz
parents:
diff changeset
113 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
anatofuz
parents:
diff changeset
114 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
anatofuz
parents:
diff changeset
115 // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_300]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
116 // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_300]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
117 // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
anatofuz
parents:
diff changeset
118 // CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
anatofuz
parents:
diff changeset
119 // CHECK-SANITIZE: [[CONT]]:
anatofuz
parents:
diff changeset
120 // CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
121 // CHECK-SANITIZE-NEXT: ret i16 [[X_PROMOTED_DEMOTED]]
anatofuz
parents:
diff changeset
122 #line 300
anatofuz
parents:
diff changeset
123 return ++x;
anatofuz
parents:
diff changeset
124 }
anatofuz
parents:
diff changeset
125
anatofuz
parents:
diff changeset
126 unsigned short t3(unsigned short x) {
anatofuz
parents:
diff changeset
127 // CHECK-NOSANITIZE-LABEL: @t3(
anatofuz
parents:
diff changeset
128 // CHECK-NOSANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
129 // CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
130 // CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
131 // CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
132 // CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], -1
anatofuz
parents:
diff changeset
133 // CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
134 // CHECK-NOSANITIZE-NEXT: ret i16 [[INC]]
anatofuz
parents:
diff changeset
135 //
anatofuz
parents:
diff changeset
136 // CHECK-SANITIZE-LABEL: @t3(
anatofuz
parents:
diff changeset
137 // CHECK-SANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
138 // CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
139 // CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
140 // CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
141 // CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = zext i16 [[X_RELOADED]] to i32
anatofuz
parents:
diff changeset
142 // CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], -1
anatofuz
parents:
diff changeset
143 // CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
anatofuz
parents:
diff changeset
144 // CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
anatofuz
parents:
diff changeset
145 // CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], false, !nosanitize
anatofuz
parents:
diff changeset
146 // CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
anatofuz
parents:
diff changeset
147 // CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
148 // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.ubsantrap(i8 7){{.*}}, !nosanitize
150
anatofuz
parents:
diff changeset
149 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
anatofuz
parents:
diff changeset
150 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
anatofuz
parents:
diff changeset
151 // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_400]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
152 // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_400]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
153 // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
anatofuz
parents:
diff changeset
154 // CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
anatofuz
parents:
diff changeset
155 // CHECK-SANITIZE: [[CONT]]:
anatofuz
parents:
diff changeset
156 // CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
157 // CHECK-SANITIZE-NEXT: ret i16 [[X_PROMOTED_DEMOTED]]
anatofuz
parents:
diff changeset
158 #line 400
anatofuz
parents:
diff changeset
159 return --x;
anatofuz
parents:
diff changeset
160 }
anatofuz
parents:
diff changeset
161
anatofuz
parents:
diff changeset
162 signed short t4(signed short x) {
anatofuz
parents:
diff changeset
163 // CHECK-NOSANITIZE-LABEL: @t4(
anatofuz
parents:
diff changeset
164 // CHECK-NOSANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
165 // CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
166 // CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
167 // CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
168 // CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], 1
anatofuz
parents:
diff changeset
169 // CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
170 // CHECK-NOSANITIZE-NEXT: ret i16 [[X_RELOADED]]
anatofuz
parents:
diff changeset
171 //
anatofuz
parents:
diff changeset
172 // CHECK-SANITIZE-LABEL: @t4(
anatofuz
parents:
diff changeset
173 // CHECK-SANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
174 // CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
175 // CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
176 // CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
177 // CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = sext i16 [[X_RELOADED]] to i32
anatofuz
parents:
diff changeset
178 // CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], 1
anatofuz
parents:
diff changeset
179 // CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
anatofuz
parents:
diff changeset
180 // CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
anatofuz
parents:
diff changeset
181 // CHECK-SANITIZE-NEXT: [[DST_NEGATIVITYCHECK:%.*]] = icmp slt i16 [[X_PROMOTED_DEMOTED]], 0, !nosanitize !2
anatofuz
parents:
diff changeset
182 // CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], [[DST_NEGATIVITYCHECK]], !nosanitize
anatofuz
parents:
diff changeset
183 // CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
anatofuz
parents:
diff changeset
184 // CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
185 // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.ubsantrap(i8 7){{.*}}, !nosanitize
150
anatofuz
parents:
diff changeset
186 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
anatofuz
parents:
diff changeset
187 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
anatofuz
parents:
diff changeset
188 // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_500]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
189 // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_500]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
190 // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
anatofuz
parents:
diff changeset
191 // CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
anatofuz
parents:
diff changeset
192 // CHECK-SANITIZE: [[CONT]]:
anatofuz
parents:
diff changeset
193 // CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
194 // CHECK-SANITIZE-NEXT: ret i16 [[X_RELOADED]]
anatofuz
parents:
diff changeset
195 #line 500
anatofuz
parents:
diff changeset
196 return x++;
anatofuz
parents:
diff changeset
197 }
anatofuz
parents:
diff changeset
198 signed short t5(signed short x) {
anatofuz
parents:
diff changeset
199 // CHECK-NOSANITIZE-LABEL: @t5(
anatofuz
parents:
diff changeset
200 // CHECK-NOSANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
201 // CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
202 // CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
203 // CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
204 // CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], -1
anatofuz
parents:
diff changeset
205 // CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
206 // CHECK-NOSANITIZE-NEXT: ret i16 [[X_RELOADED]]
anatofuz
parents:
diff changeset
207 //
anatofuz
parents:
diff changeset
208 // CHECK-SANITIZE-LABEL: @t5(
anatofuz
parents:
diff changeset
209 // CHECK-SANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
210 // CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
211 // CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
212 // CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
213 // CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = sext i16 [[X_RELOADED]] to i32
anatofuz
parents:
diff changeset
214 // CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], -1
anatofuz
parents:
diff changeset
215 // CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
anatofuz
parents:
diff changeset
216 // CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
anatofuz
parents:
diff changeset
217 // CHECK-SANITIZE-NEXT: [[DST_NEGATIVITYCHECK:%.*]] = icmp slt i16 [[X_PROMOTED_DEMOTED]], 0, !nosanitize !2
anatofuz
parents:
diff changeset
218 // CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], [[DST_NEGATIVITYCHECK]], !nosanitize
anatofuz
parents:
diff changeset
219 // CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
anatofuz
parents:
diff changeset
220 // CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
221 // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.ubsantrap(i8 7){{.*}}, !nosanitize
150
anatofuz
parents:
diff changeset
222 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
anatofuz
parents:
diff changeset
223 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
anatofuz
parents:
diff changeset
224 // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_600]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
225 // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_600]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
226 // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
anatofuz
parents:
diff changeset
227 // CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
anatofuz
parents:
diff changeset
228 // CHECK-SANITIZE: [[CONT]]:
anatofuz
parents:
diff changeset
229 // CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
230 // CHECK-SANITIZE-NEXT: ret i16 [[X_RELOADED]]
anatofuz
parents:
diff changeset
231 #line 600
anatofuz
parents:
diff changeset
232 return x--;
anatofuz
parents:
diff changeset
233 }
anatofuz
parents:
diff changeset
234
anatofuz
parents:
diff changeset
235 signed short t6(signed short x) {
anatofuz
parents:
diff changeset
236 // CHECK-NOSANITIZE-LABEL: @t6(
anatofuz
parents:
diff changeset
237 // CHECK-NOSANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
238 // CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
239 // CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
240 // CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
241 // CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], 1
anatofuz
parents:
diff changeset
242 // CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
243 // CHECK-NOSANITIZE-NEXT: ret i16 [[INC]]
anatofuz
parents:
diff changeset
244 //
anatofuz
parents:
diff changeset
245 // CHECK-SANITIZE-LABEL: @t6(
anatofuz
parents:
diff changeset
246 // CHECK-SANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
247 // CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
248 // CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
249 // CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
250 // CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = sext i16 [[X_RELOADED]] to i32
anatofuz
parents:
diff changeset
251 // CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], 1
anatofuz
parents:
diff changeset
252 // CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
anatofuz
parents:
diff changeset
253 // CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
anatofuz
parents:
diff changeset
254 // CHECK-SANITIZE-NEXT: [[DST_NEGATIVITYCHECK:%.*]] = icmp slt i16 [[X_PROMOTED_DEMOTED]], 0, !nosanitize !2
anatofuz
parents:
diff changeset
255 // CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], [[DST_NEGATIVITYCHECK]], !nosanitize
anatofuz
parents:
diff changeset
256 // CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
anatofuz
parents:
diff changeset
257 // CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
258 // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.ubsantrap(i8 7){{.*}}, !nosanitize
150
anatofuz
parents:
diff changeset
259 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
anatofuz
parents:
diff changeset
260 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
anatofuz
parents:
diff changeset
261 // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_700]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
262 // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_700]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
263 // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
anatofuz
parents:
diff changeset
264 // CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
anatofuz
parents:
diff changeset
265 // CHECK-SANITIZE: [[CONT]]:
anatofuz
parents:
diff changeset
266 // CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
267 // CHECK-SANITIZE-NEXT: ret i16 [[X_PROMOTED_DEMOTED]]
anatofuz
parents:
diff changeset
268 #line 700
anatofuz
parents:
diff changeset
269 return ++x;
anatofuz
parents:
diff changeset
270 }
anatofuz
parents:
diff changeset
271
anatofuz
parents:
diff changeset
272 signed short t7(signed short x) {
anatofuz
parents:
diff changeset
273 // CHECK-NOSANITIZE-LABEL: @t7(
anatofuz
parents:
diff changeset
274 // CHECK-NOSANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
275 // CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
276 // CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
277 // CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
278 // CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], -1
anatofuz
parents:
diff changeset
279 // CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
280 // CHECK-NOSANITIZE-NEXT: ret i16 [[INC]]
anatofuz
parents:
diff changeset
281 //
anatofuz
parents:
diff changeset
282 // CHECK-SANITIZE-LABEL: @t7(
anatofuz
parents:
diff changeset
283 // CHECK-SANITIZE-NEXT: entry:
anatofuz
parents:
diff changeset
284 // CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
anatofuz
parents:
diff changeset
285 // CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
286 // CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
287 // CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = sext i16 [[X_RELOADED]] to i32
anatofuz
parents:
diff changeset
288 // CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], -1
anatofuz
parents:
diff changeset
289 // CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
anatofuz
parents:
diff changeset
290 // CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
anatofuz
parents:
diff changeset
291 // CHECK-SANITIZE-NEXT: [[DST_NEGATIVITYCHECK:%.*]] = icmp slt i16 [[X_PROMOTED_DEMOTED]], 0, !nosanitize !2
anatofuz
parents:
diff changeset
292 // CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], [[DST_NEGATIVITYCHECK]], !nosanitize
anatofuz
parents:
diff changeset
293 // CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
anatofuz
parents:
diff changeset
294 // CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
295 // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.ubsantrap(i8 7){{.*}}, !nosanitize
150
anatofuz
parents:
diff changeset
296 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
anatofuz
parents:
diff changeset
297 // CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
anatofuz
parents:
diff changeset
298 // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_800]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
299 // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_800]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
anatofuz
parents:
diff changeset
300 // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
anatofuz
parents:
diff changeset
301 // CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
anatofuz
parents:
diff changeset
302 // CHECK-SANITIZE: [[CONT]]:
anatofuz
parents:
diff changeset
303 // CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
anatofuz
parents:
diff changeset
304 // CHECK-SANITIZE-NEXT: ret i16 [[X_PROMOTED_DEMOTED]]
anatofuz
parents:
diff changeset
305 #line 800
anatofuz
parents:
diff changeset
306 return --x;
anatofuz
parents:
diff changeset
307 }