Added various tests in support of Packed Types.
authorReid Spencer <rspencer@reidspencer.com>
Fri, 20 Aug 2004 06:06:43 +0000 (06:06 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Fri, 20 Aug 2004 06:06:43 +0000 (06:06 +0000)
Tests kindly provided by Brad Jones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15940 91177308-0d34-0410-b5e6-96231b3b80d8

test/Other/2004-08-16-LowerPacked.ll [new file with mode: 0644]
test/Other/2004-08-16-PackedConstantInlineStore.ll [new file with mode: 0644]
test/Other/2004-08-16-PackedGlobalConstant.ll [new file with mode: 0644]
test/Other/2004-08-16-PackedSelect.ll [new file with mode: 0644]
test/Other/2004-08-16-PackedSimple.ll [new file with mode: 0644]

diff --git a/test/Other/2004-08-16-LowerPacked.ll b/test/Other/2004-08-16-LowerPacked.ll
new file mode 100644 (file)
index 0000000..4c11f82
--- /dev/null
@@ -0,0 +1,20 @@
+; RUN: llvm-as < %s | opt -lower-packed | llvm-dis
+
+%foo = uninitialized global <2 x int>;
+%bar = uninitialized global <2 x int>;
+
+implementation   ; Functions:
+
+void %main()
+{
+       %t0 = load <2 x int>* %foo
+       %t2 = add <2 x int> %t0, %t0
+       %t3 = select bool false, <2 x int> %t0, <2 x int> %t2
+       store <2 x int> %t3, <2 x int>* %bar
+          
+        %c0 = add <2 x int> <int 1, int 1>, %t0
+        %c1 = add <2 x int> %t0, <int 0, int 0>
+        %c2 = select bool true, <2 x int> <int 1, int 1>, <2 x int> %t0
+        store <2 x int> <int 4, int 4>, <2 x int>* %foo
+       ret void
+}
\ No newline at end of file
diff --git a/test/Other/2004-08-16-PackedConstantInlineStore.ll b/test/Other/2004-08-16-PackedConstantInlineStore.ll
new file mode 100644 (file)
index 0000000..2d447f9
--- /dev/null
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llvm-dis
+
+%bar = external global <2 x int>               ; <<2 x int>*> [#uses=1]
+
+implementation   ; Functions:
+
+void %main() 
+{
+       store <2 x int> < int 0, int 1 >, <2 x int>* %bar
+       ret void
+}
diff --git a/test/Other/2004-08-16-PackedGlobalConstant.ll b/test/Other/2004-08-16-PackedGlobalConstant.ll
new file mode 100644 (file)
index 0000000..9a8c21c
--- /dev/null
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s | llvm-dis
+
+%foo = global <2 x int> <int 0, int 1>;
+%bar = uninitialized global <2 x int>;
+
+implementation   ; Functions:
+
+void %main()
+{
+       %t0 = load <2 x int>* %foo;
+       store <2 x int> %t0, <2 x int>* %bar   
+       ret void
+}
\ No newline at end of file
diff --git a/test/Other/2004-08-16-PackedSelect.ll b/test/Other/2004-08-16-PackedSelect.ll
new file mode 100644 (file)
index 0000000..94a6c38
--- /dev/null
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llvm-dis
+
+%foo = uninitialized global <4 x float>;
+%bar = uninitialized global <4 x float>;
+
+implementation   ; Functions:
+
+void %main()
+{
+       %t0 = load <4 x float>* %foo
+       %t1 = add <4 x float> %t0, %t0
+        %t2 = select bool true, <4 x float> %t0, <4 x float> %t1
+       store <4 x float> %t2, <4 x float>* %bar  
+       ret void
+}
\ No newline at end of file
diff --git a/test/Other/2004-08-16-PackedSimple.ll b/test/Other/2004-08-16-PackedSimple.ll
new file mode 100644 (file)
index 0000000..10cee38
--- /dev/null
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llvm-dis
+
+%foo = uninitialized global <4 x float>;
+%bar = uninitialized global <4 x float>;
+
+implementation   ; Functions:
+
+void %main()
+{
+       %t0 = load <4 x float>* %foo
+       %t2 = add <4 x float> %t0, %t0
+       %t3 = select bool false, <4 x float> %t0, <4 x float> %t2
+       store <4 x float> %t3, <4 x float>* %bar  
+       ret void
+}
\ No newline at end of file