diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-05-21 12:27:47 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-05-21 12:27:47 +0000 |
commit | bf4150656f9d82b26864c1115e8444dd3eae4cee (patch) | |
tree | 511ddbd9f39030751b5ca6a90537c90bb54032c4 /test/Instrumentation | |
parent | f8cd1ee516c845285fd6a7ee27abb5339c5f3fba (diff) | |
download | external_llvm-bf4150656f9d82b26864c1115e8444dd3eae4cee.zip external_llvm-bf4150656f9d82b26864c1115e8444dd3eae4cee.tar.gz external_llvm-bf4150656f9d82b26864c1115e8444dd3eae4cee.tar.bz2 |
[msan] A no-op implementation of VarArg handling.
This stuff is used on platforms where MSan does not have a proper VarArg
implementation (anything other than x86_64 at the moment).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182375 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Instrumentation')
-rw-r--r-- | test/Instrumentation/MemorySanitizer/X86/vararg.ll | 15 | ||||
-rw-r--r-- | test/Instrumentation/MemorySanitizer/msan_basic.ll | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/test/Instrumentation/MemorySanitizer/X86/vararg.ll b/test/Instrumentation/MemorySanitizer/X86/vararg.ll new file mode 100644 index 0000000..518c3db --- /dev/null +++ b/test/Instrumentation/MemorySanitizer/X86/vararg.ll @@ -0,0 +1,15 @@ +; RUN: opt < %s -msan -msan-check-access-address=0 -S +; Test that code using va_start can be compiled on i386. + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" +target triple = "i386-unknown-linux-gnu" + +define void @VaStart(i8* %s, ...) { +entry: + %vl = alloca i8*, align 4 + %vl1 = bitcast i8** %vl to i8* + call void @llvm.va_start(i8* %vl1) + ret void +} + +declare void @llvm.va_start(i8*) diff --git a/test/Instrumentation/MemorySanitizer/msan_basic.ll b/test/Instrumentation/MemorySanitizer/msan_basic.ll index 0d9ac8e..320860c 100644 --- a/test/Instrumentation/MemorySanitizer/msan_basic.ll +++ b/test/Instrumentation/MemorySanitizer/msan_basic.ll @@ -1,6 +1,7 @@ ; RUN: opt < %s -msan -msan-check-access-address=0 -S | FileCheck %s ; RUN: opt < %s -msan -msan-check-access-address=0 -msan-track-origins=1 -S | FileCheck -check-prefix=CHECK-ORIGINS %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" ; Check the presence of __msan_init ; CHECK: @llvm.global_ctors {{.*}} @__msan_init |