Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / catch-implicit-unsigned-integer-truncations-incdec-basics.c
blob7ad12314f3df03d6a9807ae86541e9e85eb44d0f
1 // RUN: %clang_cc1 -fsanitize=implicit-unsigned-integer-truncation -fsanitize-recover=implicit-unsigned-integer-truncation -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK
3 // CHECK-LABEL: @t0(
4 unsigned short t0(unsigned short x) {
5 #line 100
6 x++;
7 return x;
9 // CHECK-LABEL: @t1(
10 unsigned short t1(unsigned short x) {
11 #line 200
12 x--;
13 return x;
15 // CHECK-LABEL: @t2(
16 unsigned short t2(unsigned short x) {
17 #line 300
18 ++x;
19 return x;
21 // CHECK-LABEL: @t3(
22 unsigned short t3(unsigned short x) {
23 #line 400
24 --x;
25 return x;
28 // CHECK-LABEL: @t4(
29 signed short t4(signed short x) {
30 #line 500
31 x++;
32 return x;
34 // CHECK-LABEL: @t5(
35 signed short t5(signed short x) {
36 #line 600
37 x--;
38 return x;
40 // CHECK-LABEL: @t6(
41 signed short t6(signed short x) {
42 #line 700
43 ++x;
44 return x;
46 // CHECK-LABEL: @t7(
47 signed short t7(signed short x) {
48 #line 800
49 --x;
50 return x;
53 // CHECK-LABEL: @t8(
54 unsigned char t8(unsigned char x) {
55 #line 900
56 x++;
57 return x;
59 // CHECK-LABEL: @t9(
60 unsigned char t9(unsigned char x) {
61 #line 1000
62 x--;
63 return x;
65 // CHECK-LABEL: @t10(
66 unsigned char t10(unsigned char x) {
67 #line 1100
68 ++x;
69 return x;
71 // CHECK-LABEL: @t11(
72 unsigned char t11(unsigned char x) {
73 #line 1200
74 --x;
75 return x;
78 // CHECK-LABEL: @t12(
79 signed char t12(signed char x) {
80 #line 1300
81 x++;
82 return x;
84 // CHECK-LABEL: @t13(
85 signed char t13(signed char x) {
86 #line 1400
87 x--;
88 return x;
90 // CHECK-LABEL: @t14(
91 signed char t14(signed char x) {
92 #line 1500
93 ++x;
94 return x;
96 // CHECK-LABEL: @t15(
97 signed char t15(signed char x) {
98 #line 1600
99 --x;
100 return x;