diff options
Diffstat (limited to 'test/CodeGen/vector.c')
-rw-r--r-- | test/CodeGen/vector.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/test/CodeGen/vector.c b/test/CodeGen/vector.c index 8e820f23fb77c..14f5079726398 100644 --- a/test/CodeGen/vector.c +++ b/test/CodeGen/vector.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -O1 -target-cpu pentium4 -target-feature +sse4.1 -debug-info-kind=limited -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -O1 -target-cpu core2 -debug-info-kind=limited -emit-llvm %s -o - | FileCheck %s typedef short __v4hi __attribute__ ((__vector_size__ (8))); void test1() { @@ -62,3 +62,23 @@ void extractinttypes() { extern __typeof(_mm_extract_epi16(_mm_setzero_si128(), 3)) check_result_int; extern __typeof(_mm_extract_epi32(_mm_setzero_si128(), 3)) check_result_int; } + +// Test some logic around our lax vector comparison rules with integers. + +typedef int vec_int1 __attribute__((vector_size(4))); +vec_int1 lax_vector_compare1(int x, vec_int1 y) { + y = x == y; + return y; +} + +// CHECK: define i32 @lax_vector_compare1(i32 {{.*}}, i32 {{.*}}) +// CHECK: icmp eq <1 x i32> + +typedef int vec_int2 __attribute__((vector_size(8))); +vec_int2 lax_vector_compare2(long long x, vec_int2 y) { + y = x == y; + return y; +} + +// CHECK: define void @lax_vector_compare2(<2 x i32>* {{.*sret.*}}, i64 {{.*}}, i64 {{.*}}) +// CHECK: icmp eq <2 x i32> |