diff options
Diffstat (limited to 'test/Parser/builtin_classify_type.c')
-rw-r--r-- | test/Parser/builtin_classify_type.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Parser/builtin_classify_type.c b/test/Parser/builtin_classify_type.c new file mode 100644 index 0000000..7046310 --- /dev/null +++ b/test/Parser/builtin_classify_type.c @@ -0,0 +1,21 @@ +// RUN: clang-cc -fsyntax-only -verify %s + +struct foo { int a; }; + +int main() { + int a; + float b; + double d; + struct foo s; + + static int ary[__builtin_classify_type(a)]; + static int ary2[(__builtin_classify_type)(a)]; // expected-error{{variable length array declaration can not have 'static' storage duration}} + static int ary3[(*__builtin_classify_type)(a)]; // expected-error{{variable length array declaration can not have 'static' storage duration}} + + int result; + + result = __builtin_classify_type(a); + result = __builtin_classify_type(b); + result = __builtin_classify_type(d); + result = __builtin_classify_type(s); +} |