summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/vector-ops.c
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2011-10-17 21:00:38 +0000
committerTanya Lattner <tonic@nondot.org>2011-10-17 21:00:38 +0000
commit49b38413985c5e74790d9f6ff9459c82773e932f (patch)
tree5f7a2fbddaf0d4dbe3f7550d0c1e1aca53362558 /clang/test/Sema/vector-ops.c
parent502d2eee0993186a6eb4a9c8647a0e44d9a76e6a (diff)
downloadbcm5719-llvm-49b38413985c5e74790d9f6ff9459c82773e932f.tar.gz
bcm5719-llvm-49b38413985c5e74790d9f6ff9459c82773e932f.zip
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. llvm-svn: 142250
Diffstat (limited to 'clang/test/Sema/vector-ops.c')
-rw-r--r--clang/test/Sema/vector-ops.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/test/Sema/vector-ops.c b/clang/test/Sema/vector-ops.c
index ca397375d73..c3f84aae40a 100644
--- a/clang/test/Sema/vector-ops.c
+++ b/clang/test/Sema/vector-ops.c
@@ -13,8 +13,9 @@ void test1(v2u v2ua, v2s v2sa, v2f v2fa) {
(void)(~v2fa); // expected-error{{invalid argument type 'v2f' to unary}}
// Comparison operators
- v2ua = (v2ua==v2sa);
-
+ v2ua = (v2ua==v2sa); // expected-warning{{incompatible vector types assigning to 'v2u' from 'int __attribute__((ext_vector_type(2)))'}}
+ v2sa = (v2ua==v2sa);
+
// Arrays
int array1[v2ua]; // expected-error{{size of array has non-integer type 'v2u'}}
int array2[17];
OpenPOWER on IntegriCloud