diff options
author | Tanya Lattner <tonic@nondot.org> | 2011-10-17 21:00:38 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2011-10-17 21:00:38 +0000 |
commit | 6ec96438ede86b1a00f80dff25027f5a876613a8 (patch) | |
tree | d96638f754da7491f1e66e8587454dac5717655e /test/SemaOpenCL/vec_compare.cl | |
parent | d12505054130b24f7696440efdbd1aa660feb6f3 (diff) | |
download | clang-6ec96438ede86b1a00f80dff25027f5a876613a8.tar.gz |
The comparison of two vectors should return a signed result. hasIntegerRepresentation() used to always return false for vectors, but since it was changed, it also
changed the return type of a compare of two unsigned vectors to be unsigned. This patch removes the check for hasIntegerRepresentation since its not needed and returns the appropriate signed type.
I added a new test case and updated exisiting test cases that assumed an unsigned result.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142250 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL/vec_compare.cl')
-rw-r--r-- | test/SemaOpenCL/vec_compare.cl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaOpenCL/vec_compare.cl b/test/SemaOpenCL/vec_compare.cl new file mode 100644 index 0000000000..dd91aa592a --- /dev/null +++ b/test/SemaOpenCL/vec_compare.cl @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only + +typedef __attribute__((ext_vector_type(2))) unsigned int uint2; +typedef __attribute__((ext_vector_type(2))) int int2; + +void unsignedCompareOps() +{ + uint2 A, B; + int2 result = A != B; +} + |