brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · fa53c2e Raw
29 lines · c
1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsanitize=unsigned-integer-overflow -fsanitize-recover=unsigned-integer-overflow %s -emit-llvm -o - | FileCheck %s --check-prefix=RECOVER2// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsanitize=unsigned-integer-overflow %s -emit-llvm -o - | FileCheck %s --check-prefix=ABORT3// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsanitize=null,object-size,alignment -fsanitize-recover=object-size %s -emit-llvm -o - | FileCheck %s --check-prefix=PARTIAL4 5// RECOVER: @test6// ABORT: @test7void test(void) {8  extern volatile unsigned x, y, z;9 10  // RECOVER: uadd.with.overflow.i32{{.*}}, !nosanitize11  // RECOVER: ubsan_handle_add_overflow({{.*}}, !nosanitize12  // RECOVER-NOT: unreachable13  // ABORT: uadd.with.overflow.i32{{.*}}, !nosanitize14  // ABORT: ubsan_handle_add_overflow_abort({{.*}}, !nosanitize15  // ABORT: unreachable{{.*}}, !nosanitize16  x = y + z;17}18 19void foo(void) {20  union { int i; } u;21  u.i=1;22  // PARTIAL:      %[[SIZE:.*]] = call i64 @llvm.objectsize.i64.p0(ptr {{.*}}, i1 false, i1 false)23  // PARTIAL-NEXT: %[[CHECK0:.*]] = icmp uge i64 %[[SIZE]], 424 25  // PARTIAL:      br i1 %[[CHECK0]], {{.*}} !nosanitize26 27  // PARTIAL:      call void @__ubsan_handle_type_mismatch_v1(28}29