summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/objsize-64.ll
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-06-21 16:47:58 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-06-21 16:47:58 +0000
commit034dd6c6a118cf78ebfa6bf3496cd5b0df578a9e (patch)
tree6d9f8dd60938d01252246410d302c4afad75a9fe /test/Transforms/InstCombine/objsize-64.ll
parent7f5847270a650614b45f756e1a86502613be4921 (diff)
downloadllvm-034dd6c6a118cf78ebfa6bf3496cd5b0df578a9e.tar.gz
llvm-034dd6c6a118cf78ebfa6bf3496cd5b0df578a9e.tar.bz2
llvm-034dd6c6a118cf78ebfa6bf3496cd5b0df578a9e.tar.xz
hopefully fix the buildbots: some tests have wrong definitions of malloc and were crashing this code on 64 bits machines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158923 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/objsize-64.ll')
-rw-r--r--test/Transforms/InstCombine/objsize-64.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/objsize-64.ll b/test/Transforms/InstCombine/objsize-64.ll
new file mode 100644
index 0000000000..d903f1e88f
--- /dev/null
+++ b/test/Transforms/InstCombine/objsize-64.ll
@@ -0,0 +1,13 @@
+; RUN: opt < %s -instcombine -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"
+
+declare noalias i8* @malloc(i32) nounwind
+declare i64 @llvm.objectsize.i64(i8*, i1) nounwind readonly
+
+; CHECK: @f1
+define i64 @f1() {
+ %call = call i8* @malloc(i32 4)
+ %size = call i64 @llvm.objectsize.i64(i8* %call, i1 false)
+; CHECK-NEXT: ret i64 4
+ ret i64 %size
+}