aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-02-13 23:38:01 +0000
committerEric Christopher <echristo@apple.com>2010-02-13 23:38:01 +0000
commit77ffe3b31e32fbbcb06e71c8a68129df6266a492 (patch)
treebf6f2d2f17063adf9d10b578348cba9aafe3edba /test/Transforms
parent18c67b994c1f437aa1b61d60f9eecf62f2762952 (diff)
Fix a problem where we had bitcasted operands that gave us
odd offsets since the bitcasted pointer size and the offset pointer size are going to be different types for the GEP vs base object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96134 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/InstCombine/objsize.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/objsize.ll b/test/Transforms/InstCombine/objsize.ll
index 646baa0de0..dbc7d31c39 100644
--- a/test/Transforms/InstCombine/objsize.ll
+++ b/test/Transforms/InstCombine/objsize.ll
@@ -63,4 +63,13 @@ entry:
unreachable
}
+@.str5 = private constant [9 x i32] [i32 97, i32 98, i32 99, i32 100, i32 0, i32
+ 101, i32 102, i32 103, i32 0], align 4 ;
+define i32 @test2() nounwind {
+; CHECK: @test2
+; CHECK-NEXT: ret i32 34
+ %1 = call i32 @llvm.objectsize.i32(i8* getelementptr (i8* bitcast ([9 x i32]* @.str5 to i8*), i32 2), i1 false)
+ ret i32 %1
+}
+
declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readonly \ No newline at end of file