Steve Naroff | a7f7b80 | 2008-01-14 21:38:57 +0000 | [diff] [blame] | 1 | // RUN: clang %s -verify -fsyntax-only |
| 2 | |
| 3 | void a() { |
| 4 | __complex__ int arr; |
| 5 | __complex__ short brr; |
Steve Naroff | 73458bf | 2008-01-14 23:33:18 +0000 | [diff] [blame] | 6 | __complex__ unsigned xx; |
| 7 | __complex__ signed yy; |
Steve Naroff | a7f7b80 | 2008-01-14 21:38:57 +0000 | [diff] [blame] | 8 | __complex__ int result; |
Steve Naroff | 36e35e6 | 2008-01-15 01:41:59 +0000 | [diff] [blame] | 9 | int ii; |
| 10 | |
| 11 | result = arr*ii; |
| 12 | result = ii*brr; |
Steve Naroff | a7f7b80 | 2008-01-14 21:38:57 +0000 | [diff] [blame] | 13 | |
| 14 | result = arr*brr; |
Steve Naroff | 73458bf | 2008-01-14 23:33:18 +0000 | [diff] [blame] | 15 | result = xx*yy; |
Steve Naroff | 36e35e6 | 2008-01-15 01:41:59 +0000 | [diff] [blame] | 16 | |
| 17 | switch (arr) { // expected-error{{statement requires expression of integer type ('_Complex int' invalid)}} |
| 18 | case brr: ; // expected-error{{case label does not reduce to an integer constant}} |
| 19 | case xx: ; // expected-error{{case label does not reduce to an integer constant}} |
| 20 | } |
Steve Naroff | a7f7b80 | 2008-01-14 21:38:57 +0000 | [diff] [blame] | 21 | } |
| 22 | |