sanitize-recover.c revision ad95481b2769ad61f23afc5e2c31f11c66090657
1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsanitize=unsigned-integer-overflow -fsanitize-recover %s -emit-llvm -o - | FileCheck %s --check-prefix=RECOVER
2// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsanitize=unsigned-integer-overflow %s -emit-llvm -o - | FileCheck %s --check-prefix=ABORT
3
4
5// RECOVER: @test
6// ABORT: @test
7void 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