summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-10-20 00:34:35 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-10-20 00:34:35 +0000
commit0cd0fee91eadcee37d01398e05176e7c63bda2a7 (patch)
tree31a0f95a4e71949ff31bb21cc0d5d29ce73540a5 /test/Transforms
parent6690bca623d1f6405b95db5b1760f7ba8436e3fb (diff)
downloadllvm-0cd0fee91eadcee37d01398e05176e7c63bda2a7.tar.gz
llvm-0cd0fee91eadcee37d01398e05176e7c63bda2a7.tar.bz2
llvm-0cd0fee91eadcee37d01398e05176e7c63bda2a7.tar.xz
"@string = constant i8 0" is a value i8* string of length zero. Analyze that
correctly in GetStringLength, fixing PR11181! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142558 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/SimplifyLibCalls/StrLen.ll6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyLibCalls/StrLen.ll b/test/Transforms/SimplifyLibCalls/StrLen.ll
index 45b349d684..acd8aaf6e5 100644
--- a/test/Transforms/SimplifyLibCalls/StrLen.ll
+++ b/test/Transforms/SimplifyLibCalls/StrLen.ll
@@ -6,6 +6,7 @@ target datalayout = "e-p:32:32"
@hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=3]
@null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=3]
@null_hello = constant [7 x i8] c"\00hello\00" ; <[7 x i8]*> [#uses=1]
+@nullstring = constant i8 0
declare i32 @strlen(i8*)
@@ -54,3 +55,8 @@ define i1 @test7() {
%ne_null = icmp ne i32 %null_l, 0 ; <i1> [#uses=1]
ret i1 %ne_null
}
+
+define i32 @test8() {
+ %len = tail call i32 @strlen(i8* @nullstring) nounwind
+ ret i32 %len
+}