llvm.org GIT mirror llvm / 483cdb4
Add -asan-force-dynamic-shadow test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310240 91177308-0d34-0410-b5e6-96231b3b80d8 Vitaly Buka 2 years ago
1 changed file(s) with 22 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; Test -asan-force-dynamic-shadow flag.
1 ;
2 ; RUN: opt -asan -asan-module -S -asan-force-dynamic-shadow=1 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-FDS
3 ; RUN: opt -asan -asan-module -S -asan-force-dynamic-shadow=0 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-NDS
4
5 target triple = "x86_64-unknown-linux-gnu"
6
7 define i32 @test_load(i32* %a) sanitize_address {
8 ; First instrumentation in the function must be to load the dynamic shadow
9 ; address into a local variable.
10 ; CHECK-LABEL: @test_load
11 ; CHECK: entry:
12 ; CHECK-FDS-NEXT: %[[SHADOW:[^ ]*]] = load i64, i64* @__asan_shadow_memory_dynamic_address
13 ; CHECK-NDS-NOT: __asan_shadow_memory_dynamic_address
14
15 ; Shadow address is loaded and added into the whole offset computation.
16 ; CHECK-FDS add i64 %{{.*}}, %[[SHADOW] ]
17
18 entry:
19 %tmp1 = load i32, i32* %a, align 4
20 ret i32 %tmp1
21 }