1 // Verify proper type emitted for compound assignments
2 // RUN: %clang_cc1 -ffreestanding -triple x86_64-apple-darwin10 -emit-llvm -o - %s -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-recover=signed-integer-overflow,unsigned-integer-overflow | FileCheck %s
6 // CHECK: @[[INT:.*]] = private unnamed_addr constant { i16, i16, [22 x i8] } { i16 0, i16 11, [22 x i8] c"'int32_t' (aka 'int')\00" }
7 // CHECK: @[[LINE_100:.*]] = private unnamed_addr global {{.*}}, i32 100, i32 5 {{.*}} @[[INT]]
8 // CHECK: @[[UINT:.*]] = private unnamed_addr constant { i16, i16, [32 x i8] } { i16 0, i16 10, [32 x i8] c"'uint32_t' (aka 'unsigned int')\00" }
9 // CHECK: @[[LINE_200:.*]] = private unnamed_addr global {{.*}}, i32 200, i32 5 {{.*}} @[[UINT]]
10 // CHECK: @[[LINE_300:.*]] = private unnamed_addr global {{.*}}, i32 300, i32 5 {{.*}} @[[INT]]
14 // CHECK: @compaddsigned
15 void compaddsigned(void) {
18 // CHECK: @__ubsan_handle_add_overflow(ptr @[[LINE_100]], {{.*}})
21 // CHECK: @compaddunsigned
22 void compaddunsigned(void) {
25 // CHECK: @__ubsan_handle_add_overflow(ptr @[[LINE_200]], {{.*}})
32 // CHECK: @__ubsan_handle_divrem_overflow(ptr @[[LINE_300]], {{.*}})