llvm-6502/test/Instrumentation/AddressSanitizer/keep-instrumented_functions.ll
Alexander Potapenko 90844c4778 [ASan] Add -asan-module to the ASan .ll tests.
After the -asan pass had been split into -asan (function-level) and -asan-module (module-level) some of the
tests have silently stopped working, because they didn't instrument the globals anymore.
We've decided to have every test using both passes, irrespective of the presence of globals in it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204335 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 11:16:34 +00:00

24 lines
803 B
LLVM

; Test the -asan-keep-uninstrumented-functions flag: FOO should get cloned
; RUN: opt < %s -asan -asan-module -asan-keep-uninstrumented-functions -S | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@a = global i32 0, align 4
define i32 @main() sanitize_address {
entry:
tail call void @FOO(i32* @a)
ret i32 0
}
define void @FOO(i32* nocapture %x) sanitize_address {
entry:
store i32 1, i32* %x, align 4
ret void
}
; main should not be cloned since it is not being instrumented by asan.
; CHECK-NOT: NOASAN_main
; CHECK: define void @FOO{{.*}} section "ASAN"
; CHECK: define void @NOASAN_FOO{{.*}} section "NOASAN"