| 1 |
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s -fsanitize=signed-integer-overflow -fsanitize-skip-hot-cutoff=signed-integer-overflow=0.000001 -O3 -mllvm -lower-allow-check-random-rate=1 -Rpass=lower-allow-check -Rpass-missed=lower-allow-check -fno-inline 2>&1 | FileCheck %s --check-prefixes=NOINL --implicit-check-not="remark:" |
| 2 |
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s -fsanitize=signed-integer-overflow -fsanitize-skip-hot-cutoff=signed-integer-overflow=0.000001 -O3 -mllvm -lower-allow-check-random-rate=1 -Rpass=lower-allow-check -Rpass-missed=lower-allow-check 2>&1 | FileCheck %s --check-prefixes=INLINE --implicit-check-not="remark:" |
| 3 |
// |
| 4 |
// -ubsan-guard-checks is deprecated and will be removed in the future; |
| 5 |
// use -fsanitize-skip-hot-cutoff, as shown above. |
| 6 |
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s -fsanitize=signed-integer-overflow -mllvm -ubsan-guard-checks -O3 -mllvm -lower-allow-check-random-rate=1 -Rpass=lower-allow-check -Rpass-missed=lower-allow-check -fno-inline 2>&1 | FileCheck %s --check-prefixes=NOINL --implicit-check-not="remark:" |
| 7 |
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s -fsanitize=signed-integer-overflow -mllvm -ubsan-guard-checks -O3 -mllvm -lower-allow-check-random-rate=1 -Rpass=lower-allow-check -Rpass-missed=lower-allow-check 2>&1 | FileCheck %s --check-prefixes=INLINE --implicit-check-not="remark:" |
| 8 |
|
| 9 |
int get(); |
| 10 |
void set(int x); |
| 11 |
|
| 12 |
// We will only make decision in the `overflow` function. |
| 13 |
// NOINL-COUNT-1: remark: Allowed check: |
| 14 |
|
| 15 |
// We will make decision on every inline. |
| 16 |
// INLINE-COUNT-5: remark: Allowed check: |
| 17 |
|
| 18 |
static void overflow() { |
| 19 |
set(get() + get()); |
| 20 |
} |
| 21 |
|
| 22 |
void test() { |
| 23 |
overflow(); |
| 24 |
overflow(); |
| 25 |
overflow(); |
| 26 |
overflow(); |
| 27 |
overflow(); |
| 28 |
} |