summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-02-09 00:35:38 +0000
committerEric Christopher <echristo@apple.com>2010-02-09 00:35:38 +0000
commit1926b648e132631282aa15d25e4f8278f87c24fb (patch)
tree32cf8d41d89dc064e6650a1ea998a588e9e2ea79 /test
parentb8d6e98e566724f58344d275a4bd675249bb713a (diff)
downloadllvm-1926b648e132631282aa15d25e4f8278f87c24fb.tar.gz
llvm-1926b648e132631282aa15d25e4f8278f87c24fb.tar.bz2
llvm-1926b648e132631282aa15d25e4f8278f87c24fb.tar.xz
Add a new pass to do llvm.objsize lowering using SCEV.
Initial skeleton and SCEVUnknown lowering implemented, the rest should come relatively quickly. Move testcase to new directory. Move pass to right before SimplifyLibCalls - which is moved down a bit so we can take advantage of a few opts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95628 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/ObjSizeLower/objsize.ll (renamed from test/Transforms/InstCombine/objsize.ll)10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/Transforms/InstCombine/objsize.ll b/test/Transforms/ObjSizeLower/objsize.ll
index 41d071517d..bcc1f835df 100644
--- a/test/Transforms/InstCombine/objsize.ll
+++ b/test/Transforms/ObjSizeLower/objsize.ll
@@ -1,6 +1,5 @@
; Test a pile of objectsize bounds checking.
-; RUN: opt < %s -instcombine -S | FileCheck %s
-; XFAIL: *
+; RUN: opt < %s -objsize-lower -S | FileCheck %s
; We need target data to get the sizes of the arrays and structures.
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:128:128"
@@ -19,8 +18,8 @@ define i8* @bar() nounwind {
entry:
%retval = alloca i8*
%0 = call i32 @llvm.objectsize.i32(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i1 false)
+; CHECK: %cmp = icmp ne i32 60, -1
%cmp = icmp ne i32 %0, -1
-; CHECK: br i1 true
br i1 %cmp, label %cond.true, label %cond.false
cond.true:
@@ -32,9 +31,10 @@ cond.false:
ret i8* %2;
}
+; FIXME: This should return 0.
define i32 @f() nounwind {
; CHECK: @f
-; CHECK-NEXT: ret i32 0
+; CHECK-NEXT: ret i32 -1
%1 = call i32 @llvm.objectsize.i32(i8* getelementptr ([60 x i8]* @a, i32 1, i32 0), i1 false)
ret i32 %1
}
@@ -43,7 +43,7 @@ define i32 @f() nounwind {
define i1 @baz() nounwind {
; CHECK: @baz
-; CHECK-NEXT: llvm.objectsize.i32
+; CHECK-NEXT: icmp eq i32 -1, -1
%1 = tail call i32 @llvm.objectsize.i32(i8* getelementptr inbounds ([0 x i8]* @window, i32 0, i32 0), i1 false)
%2 = icmp eq i32 %1, -1
ret i1 %2