Fix minor oversight for increment/decrement of complex int.  Add tests for
coverage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92433 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 7bf04d8..feb6b2b 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -5776,7 +5776,7 @@
         << PointeeTy << Op->getSourceRange();
       return QualType();
     }
-  } else if (ResType->isComplexType()) {
+  } else if (ResType->isAnyComplexType()) {
     // C99 does not support ++/-- on complex types, we allow as an extension.
     Diag(OpLoc, diag::ext_integer_increment_complex)
       << ResType << Op->getSourceRange();
diff --git a/test/CodeGen/complex.c b/test/CodeGen/complex.c
index 8d9c68d..ca60610 100644
--- a/test/CodeGen/complex.c
+++ b/test/CodeGen/complex.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm < %s
+// RUN: %clang_cc1 -emit-llvm-only %s
 
 int main(void)
 {
@@ -39,6 +39,25 @@
   g1 = D + g1;
 }
 
+__complex__ int ci1, ci2;
+__complex__ short cs;
+int i;
+void test3int() {
+  ci1 = ci1 + ci2;
+  ci1 = ci1 - ci2;
+  ci1 = ci1 * ci2;
+  ci1 = +-~ci1;
+
+  i = __real ci1;
+
+  cs += i;
+  // FIXME: Currently unsupported!
+  //D += cf;
+  cs /= ci1;
+  ci1 = ci1 + i;
+  ci1 = i + ci1;
+}
+
 void t1() {
   (__real__ cf) = 4.0;
 }
@@ -59,3 +78,14 @@
   float _Complex x = t4();
 }
 
+void t6() {
+  g1++;
+  g1--;
+  ++g1;
+  --g1;
+  ci1++;
+  ci1--;
+  ++ci1;
+  --ci1;
+}
+
diff --git a/test/Sema/complex-int.c b/test/Sema/complex-int.c
index 2bd0374..cb76a34 100644
--- a/test/Sema/complex-int.c
+++ b/test/Sema/complex-int.c
@@ -49,3 +49,7 @@
 void test4(_Complex float *x) {
   *x = ~*x;
 }
+
+void test5(_Complex int *x) {
+  (*x)++;
+}