xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/sanitize-recover.c (revision 0b98e8aad89f2bd4ba80b523d73cf29e9dd82ce1)
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsanitize=unsigned-integer-overflow %s -emit-llvm -o - | FileCheck %s --check-prefix=RECOVER
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsanitize=unsigned-integer-overflow -fno-sanitize-recover %s -emit-llvm -o - | FileCheck %s --check-prefix=ABORT
3 
4 
5 // RECOVER: @test
6 // ABORT: @test
7 void test() {
8   extern volatile unsigned x, y, z;
9 
10   // RECOVER: uadd.with.overflow.i32
11   // RECOVER: ubsan_handle_add_overflow(
12   // RECOVER-NOT: unreachable
13   // ABORT: uadd.with.overflow.i32
14   // ABORT: ubsan_handle_add_overflow_abort(
15   // ABORT: unreachable
16   x = y + z;
17 }
18