Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Steve Naroff | 13b7c5f | 2007-08-08 22:15:55 +0000 | [diff] [blame] | 2 | |
| 3 | struct foo { int a; }; |
| 4 | |
| 5 | int main() { |
| 6 | int a; |
| 7 | float b; |
| 8 | double d; |
| 9 | struct foo s; |
| 10 | |
| 11 | static int ary[__builtin_classify_type(a)]; |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 12 | static int ary2[(__builtin_classify_type)(a)]; // expected-error{{variable length array declaration cannot have 'static' storage duration}} |
Eli Friedman | a6c66ce | 2012-08-31 00:14:07 +0000 | [diff] [blame] | 13 | static int ary3[(*__builtin_classify_type)(a)]; // expected-error{{builtin functions must be directly called}} |
Steve Naroff | 13b7c5f | 2007-08-08 22:15:55 +0000 | [diff] [blame] | 14 | |
| 15 | int result; |
| 16 | |
| 17 | result = __builtin_classify_type(a); |
| 18 | result = __builtin_classify_type(b); |
| 19 | result = __builtin_classify_type(d); |
| 20 | result = __builtin_classify_type(s); |
| 21 | } |