diff options
author | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
commit | 50b73317314e889cf39c7b1d6cbf419fa7502f22 (patch) | |
tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /test/Parser/attributes.c | |
parent | dc04cb328508e61aad809d9b53b12f9799a00e7d (diff) | |
download | FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.zip FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.tar.gz |
Vendor import of clang trunk r154661:
http://llvm.org/svn/llvm-project/cfe/trunk@r154661
Diffstat (limited to 'test/Parser/attributes.c')
-rw-r--r-- | test/Parser/attributes.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/Parser/attributes.c b/test/Parser/attributes.c index b287363..347cb9c 100644 --- a/test/Parser/attributes.c +++ b/test/Parser/attributes.c @@ -56,3 +56,43 @@ void d2(void) __attribute__((noreturn)), d3(void) __attribute__((noreturn)); // PR6287 void __attribute__((returns_twice)) returns_twice_test(); + +int aligned(int); +int __attribute__((vec_type_hint(char, aligned(16) )) missing_rparen_1; // expected-error {{expected ')'}} +int __attribute__((mode(x aligned(16) )) missing_rparen_2; // expected-error {{expected ')'}} +int __attribute__((format(printf, 0 aligned(16) )) missing_rparen_3; // expected-error {{expected ')'}} + + + +int testFundef1(int *a) __attribute__((nonnull(1))) { // \ + // expected-warning {{GCC does not allow nonnull attribute in this position on a function definition}} + return *a; +} + +// noreturn is lifted to type qualifier +void testFundef2() __attribute__((noreturn)) { // \ + // expected-warning {{GCC does not allow noreturn attribute in this position on a function definition}} + testFundef2(); +} + +int testFundef3(int *a) __attribute__((nonnull(1), // \ + // expected-warning {{GCC does not allow nonnull attribute in this position on a function definition}} + pure)) { // \ + // expected-warning {{GCC does not allow pure attribute in this position on a function definition}} + return *a; +} + +int testFundef4(int *a) __attribute__((nonnull(1))) // \ + // expected-warning {{GCC does not allow nonnull attribute in this position on a function definition}} + __attribute((pure)) { // \ + // expected-warning {{GCC does not allow pure attribute in this position on a function definition}} + return *a; +} + +// GCC allows these +void testFundef5() __attribute__(()) { } + +__attribute__((pure)) int testFundef6(int a) { return a; } + + + |