Index: tests_lit/llvm2ice_tests/vector-pool.ll |
diff --git a/tests_lit/llvm2ice_tests/vector-pool.ll b/tests_lit/llvm2ice_tests/vector-pool.ll |
new file mode 100644 |
index 0000000000000000000000000000000000000000..42839db50b8b16da6c0e87421361bc787fb58bbf |
--- /dev/null |
+++ b/tests_lit/llvm2ice_tests/vector-pool.ll |
@@ -0,0 +1,51 @@ |
+; This file tests support for vector constant pooling. |
+ |
+; The order in which vector constants appear in the output is unspecified. |
+; Hence, we check for the presence of only one constant per run line. |
+; |
+; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s --check-prefix=I16 |
+; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck %s --check-prefix=I16 |
+; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s --check-prefix=FLOAT |
+; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck %s --check-prefix=FLOAT |
+; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s --check-prefix=I1 |
+; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck %s --check-prefix=I1 |
+; |
+; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
+; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s |
+ |
+define <8 x i16> @test_v8i16() { |
+entry: |
+ ret <8 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7> |
+} |
+ |
+; I16: .long 0x10000 |
+; I16-NEXT: .long 0x30002 |
+; I16-NEXT: .long 0x50004 |
+; I16-NEXT: .long 0x70006 |
+ |
+define <4 x float> @test_v4f32() { |
+entry: |
+ ret <4 x float> <float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00> |
+} |
+ |
+; FLOAT: .long 0x40800000 |
+; FLOAT-NEXT: .long 0x40400000 |
+; FLOAT-NEXT: .long 0x40000000 |
+; FLOAT-NEXT: .long 0x3f800000 |
+ |
+define <8 x i1> @test_v4i1() { |
+entry: |
+ ret <8 x i1> <i1 0, i1 1, i1 0, i1 1, i1 1, i1 1, i1 1, i1 1> |
+} |
+ |
+; I1: .short 0x0 |
+; I1-NEXT: .short 0x1 |
+; I1-NEXT: .short 0x0 |
+; I1-NEXT: .short 0x1 |
+; I1-NEXT: .short 0x1 |
+; I1-NEXT: .short 0x1 |
+; I1-NEXT: .short 0x1 |
+; I1-NEXT: .short 0x1 |
+ |
+; ERRORS-NOT: ICE translation error |
+; DUMP-NOT: SZ |