Will Dietz | 2d382d1 | 2012-12-30 20:53:28 +0000 | [diff] [blame] | 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 |
Will Dietz | ad95481 | 2012-12-02 19:50:33 +0000 | [diff] [blame] | 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 | } |