2008-01-15 05:38:57 +08:00
|
|
|
// RUN: clang %s -verify -fsyntax-only
|
|
|
|
|
|
|
|
void a() {
|
|
|
|
__complex__ int arr;
|
|
|
|
__complex__ short brr;
|
2008-01-15 07:33:18 +08:00
|
|
|
__complex__ unsigned xx;
|
|
|
|
__complex__ signed yy;
|
2008-01-15 05:38:57 +08:00
|
|
|
__complex__ int result;
|
2008-01-15 09:41:59 +08:00
|
|
|
int ii;
|
2008-01-16 03:36:10 +08:00
|
|
|
int aa = 1 + 1.0iF;
|
2008-01-15 09:41:59 +08:00
|
|
|
|
|
|
|
result = arr*ii;
|
|
|
|
result = ii*brr;
|
2008-01-15 05:38:57 +08:00
|
|
|
|
|
|
|
result = arr*brr;
|
2008-01-15 07:33:18 +08:00
|
|
|
result = xx*yy;
|
2008-01-15 09:41:59 +08:00
|
|
|
|
|
|
|
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}}
|
|
|
|
}
|
2008-01-15 05:38:57 +08:00
|
|
|
}
|
|
|
|
|
2008-01-16 06:21:49 +08:00
|
|
|
void Tester() {
|
|
|
|
__complex short a1;
|
|
|
|
__complex int a2;
|
|
|
|
__complex float a3;
|
|
|
|
__complex double a4;
|
|
|
|
short a5;
|
|
|
|
int a6;
|
|
|
|
float a7;
|
|
|
|
double a8;
|
|
|
|
#define TestPair(m,n) int x##m##n = a##m+a##n;
|
|
|
|
#define TestPairs(m) TestPair(m,1) TestPair(m,2) \
|
|
|
|
TestPair(m,3) TestPair(m,4) \
|
|
|
|
TestPair(m,5) TestPair(m,6) \
|
|
|
|
TestPair(m,7) TestPair(m,8)
|
|
|
|
TestPairs(1); TestPairs(2);
|
|
|
|
TestPairs(3); TestPairs(4);
|
|
|
|
TestPairs(5); TestPairs(6);
|
|
|
|
TestPairs(7); TestPairs(8);
|
|
|
|
}
|
|
|
|
|