summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/complex-int.c
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-01-15 01:41:59 +0000
committerSteve Naroff <snaroff@apple.com>2008-01-15 01:41:59 +0000
commit7f988889ef8a6eb4e7779947da3692885fb36726 (patch)
treed6b58f7c4f9ac92fe5bc4000b0bdc63e7f44309b /clang/test/Sema/complex-int.c
parente5843597164f0d3958b8375aaf25c4ffa5eca1d0 (diff)
downloadbcm5719-llvm-7f988889ef8a6eb4e7779947da3692885fb36726.tar.gz
bcm5719-llvm-7f988889ef8a6eb4e7779947da3692885fb36726.zip
Rework commit r45976, which was incorrect.
- Add Type::isComplexIntegerType(), Type::getAsComplexIntegerType(). - Don't inlude complex types with Type::isIntegerType(), which is too general. - Use the new predicates in Sema::UsualArithmeticConversions() to recognize/convert the types. llvm-svn: 45992
Diffstat (limited to 'clang/test/Sema/complex-int.c')
-rw-r--r--clang/test/Sema/complex-int.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/test/Sema/complex-int.c b/clang/test/Sema/complex-int.c
index b2555f59371..90d1e3dc121 100644
--- a/clang/test/Sema/complex-int.c
+++ b/clang/test/Sema/complex-int.c
@@ -5,10 +5,18 @@ __complex__ int arr;
__complex__ short brr;
__complex__ unsigned xx;
__complex__ signed yy;
-
__complex__ int result;
+int ii;
+
+result = arr*ii;
+result = ii*brr;
result = arr*brr;
result = xx*yy;
+
+switch (arr) { // expected-error{{statement requires expression of integer type ('_Complex int' invalid)}}
+ case brr: ; // expected-error{{case label does not reduce to an integer constant}}
+ case xx: ; // expected-error{{case label does not reduce to an integer constant}}
+}
}
OpenPOWER on IntegriCloud