blob: 3c9c89553813d0a52abefe461b81f44d86160b71 [file] [log] [blame]
Will Dietz2d382d12012-12-30 20:53:28 +00001// 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 Dietzad954812012-12-02 19:50:33 +00003
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}