diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-12-22 03:51:45 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-12-22 03:51:45 +0000 |
commit | e6a24e83e71f361c7b7de82cf24ee6f5ddc7f1c2 (patch) | |
tree | 50b91df16d41c3b822680ffcaede1d17e6a86865 /test | |
parent | 6180245e9f63d2927b185ec251fb75aba30f1cac (diff) |
Add support for bitcasts to vector type in Evaluate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/altivec.c | 8 | ||||
-rw-r--r-- | test/CodeGen/const-init.c | 12 |
2 files changed, 16 insertions, 4 deletions
diff --git a/test/CodeGen/altivec.c b/test/CodeGen/altivec.c index bd694a6a56..29823031b5 100644 --- a/test/CodeGen/altivec.c +++ b/test/CodeGen/altivec.c @@ -5,13 +5,13 @@ vector int test0 = (vector int)(1); // CHECK: @test0 = global <4 x i32> <i32 1, i32 1, i32 1, i32 1> vector float test1 = (vector float)(1.0); // CHECK: @test1 = global <4 x float> <float 1.000000e+{{0+}}, float 1.000000e+{{0+}}, float 1.000000e+{{0+}}, float 1.000000e+{{0+}}> -// CHECK: @v1 = global <16 x i8> bitcast (<4 x i32> <i32 1, i32 2, i32 3, i32 4> to <16 x i8>) +// CHECK: @v1 = global <16 x i8> <i8 0, i8 0, i8 0, i8 1, i8 0, i8 0, i8 0, i8 2, i8 0, i8 0, i8 0, i8 3, i8 0, i8 0, i8 0, i8 4> vector char v1 = (vector char)((vector int)(1, 2, 3, 4)); -// CHECK: @v2 = global <16 x i8> bitcast (<4 x float> <float 1.000000e+{{0+}}, float 2.000000e+{{0+}}, float 3.000000e+{{0+}}, float 4.000000e+{{0+}}> to <16 x i8>) +// CHECK: @v2 = global <16 x i8> <i8 63, i8 -128, i8 0, i8 0, i8 64, i8 0, i8 0, i8 0, i8 64, i8 64, i8 0, i8 0, i8 64, i8 -128, i8 0, i8 0> vector char v2 = (vector char)((vector float)(1.0f, 2.0f, 3.0f, 4.0f)); -// CHECK: @v3 = global <16 x i8> bitcast (<4 x i32> <i32 97, i32 98, i32 99, i32 100> to <16 x i8>) +// CHECK: @v3 = global <16 x i8> <i8 0, i8 0, i8 0, i8 97, i8 0, i8 0, i8 0, i8 98, i8 0, i8 0, i8 0, i8 99, i8 0, i8 0, i8 0, i8 100> vector char v3 = (vector char)((vector int)('a', 'b', 'c', 'd')); -// CHECK: @v4 = global <4 x i32> bitcast (<16 x i8> <i8 1, i8 2, i8 3, i8 4, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0> to <4 x i32>) +// CHECK: @v4 = global <4 x i32> <i32 16909060, i32 0, i32 0, i32 0> vector int v4 = (vector char){1, 2, 3, 4}; void test2() diff --git a/test/CodeGen/const-init.c b/test/CodeGen/const-init.c index 9bc3bbafde..4f3f7ab553 100644 --- a/test/CodeGen/const-init.c +++ b/test/CodeGen/const-init.c @@ -132,3 +132,15 @@ int g25() { void g27() { // PR8073 static void *x = &x; } + +void g28() { + typedef long long v1i64 __attribute((vector_size(8))); + typedef short v12i16 __attribute((vector_size(24))); + typedef long double v2f80 __attribute((vector_size(24))); + // CHECK: @g28.a = internal global <1 x i64> <i64 10> + // CHECK: @g28.b = internal global <12 x i16> <i16 0, i16 0, i16 0, i16 -32768, i16 16383, i16 0, i16 0, i16 0, i16 0, i16 -32768, i16 16384, i16 0> + // CHECK: @g28.c = internal global <2 x x86_fp80> <x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK40008000000000000000>, align 32 + static v1i64 a = (v1i64)10LL; + static v12i16 b = (v2f80){1,2}; + static v2f80 c = (v12i16){0,0,0,-32768,16383,0,0,0,0,-32768,16384,0}; +} |