aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-03-19 00:11:30 +0000
committerChris Lattner <sabre@nondot.org>2007-03-19 00:11:30 +0000
commit7863a63bb95b96af8488792fd257049cbd06d6d8 (patch)
tree16fb7b7b75ce76a61fe0e270ef781219c7802284 /test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll
parent7829828c4bf819429ad4ccb9df4a0fb0f88ef049 (diff)
downloadexternal_llvm-7863a63bb95b96af8488792fd257049cbd06d6d8.zip
external_llvm-7863a63bb95b96af8488792fd257049cbd06d6d8.tar.gz
external_llvm-7863a63bb95b96af8488792fd257049cbd06d6d8.tar.bz2
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35148 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll')
-rw-r--r--test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll b/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll
new file mode 100644
index 0000000..9c27710
--- /dev/null
+++ b/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll
@@ -0,0 +1,20 @@
+; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep 'call void @llvm.memcpy.i32' &&
+; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep 'getelementptr'
+target datalayout = "E-p:32:32"
+target triple = "powerpc-apple-darwin8.8.0"
+ %struct.foo = type { i8, i8 }
+
+implementation ; Functions:
+
+define i32 @test1(%struct.foo* %P) {
+entry:
+ %L = alloca %struct.foo, align 2 ; <%struct.foo*> [#uses=1]
+ %L2 = getelementptr %struct.foo* %L, i32 0, i32 0 ; <i8*> [#uses=2]
+ %tmp13 = getelementptr %struct.foo* %P, i32 0, i32 0 ; <i8*> [#uses=1]
+ call void @llvm.memcpy.i32( i8* %L2, i8* %tmp13, i32 2, i32 1 )
+ %tmp5 = load i8* %L2 ; <i8> [#uses=1]
+ %tmp56 = sext i8 %tmp5 to i32 ; <i32> [#uses=1]
+ ret i32 %tmp56
+}
+
+declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)