Debian Codegraph @

clang/test/CodeGen/builtin-allow-sanitize-check-lower.c

raw
1 // RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=address -emit-llvm -O0 -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=address -emit-llvm -O1 -o - %s | FileCheck %s
3 // RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=address -emit-llvm -O2 -o - %s | FileCheck %s
4
5 // CHECK-NOT: call{{.*}} @llvm.allow.sanitize.address
6
7 __attribute__((always_inline))
8 _Bool check() {
9 return __builtin_allow_sanitize_check("address");
10 }
11
12 // CHECK-LABEL: @test_sanitize
13 // CHECK: ret i1 true
14 _Bool test_sanitize() {
15 return check();
16 }
17
18 // CHECK-LABEL: @test_no_sanitize
19 // CHECK: ret i1 false
20 __attribute__((no_sanitize("address")))
21 _Bool test_no_sanitize() {
22 return check();
23 }