102 lines · c
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=CHECK2 3// CHECK-LABEL: @t0(4unsigned short t0(unsigned short x) {5#line 1006 x++;7 return x;8}9// CHECK-LABEL: @t1(10unsigned short t1(unsigned short x) {11#line 20012 x--;13 return x;14}15// CHECK-LABEL: @t2(16unsigned short t2(unsigned short x) {17#line 30018 ++x;19 return x;20}21// CHECK-LABEL: @t3(22unsigned short t3(unsigned short x) {23#line 40024 --x;25 return x;26}27 28// CHECK-LABEL: @t4(29signed short t4(signed short x) {30#line 50031 x++;32 return x;33}34// CHECK-LABEL: @t5(35signed short t5(signed short x) {36#line 60037 x--;38 return x;39}40// CHECK-LABEL: @t6(41signed short t6(signed short x) {42#line 70043 ++x;44 return x;45}46// CHECK-LABEL: @t7(47signed short t7(signed short x) {48#line 80049 --x;50 return x;51}52 53// CHECK-LABEL: @t8(54unsigned char t8(unsigned char x) {55#line 90056 x++;57 return x;58}59// CHECK-LABEL: @t9(60unsigned char t9(unsigned char x) {61#line 100062 x--;63 return x;64}65// CHECK-LABEL: @t10(66unsigned char t10(unsigned char x) {67#line 110068 ++x;69 return x;70}71// CHECK-LABEL: @t11(72unsigned char t11(unsigned char x) {73#line 120074 --x;75 return x;76}77 78// CHECK-LABEL: @t12(79signed char t12(signed char x) {80#line 130081 x++;82 return x;83}84// CHECK-LABEL: @t13(85signed char t13(signed char x) {86#line 140087 x--;88 return x;89}90// CHECK-LABEL: @t14(91signed char t14(signed char x) {92#line 150093 ++x;94 return x;95}96// CHECK-LABEL: @t15(97signed char t15(signed char x) {98#line 160099 --x;100 return x;101}102