diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2013-08-31 01:11:41 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2013-08-31 01:11:41 +0000 |
commit | 00e99966c4574b084b5211924f97547930995a15 (patch) | |
tree | f1f7d42931d95af9208e0058d6f0c5e0ed3449d9 /clang/test | |
parent | fb4b433bbb3f66b041585e8e7eee8ecd97a354db (diff) | |
download | bcm5719-llvm-00e99966c4574b084b5211924f97547930995a15.tar.gz bcm5719-llvm-00e99966c4574b084b5211924f97547930995a15.zip |
Consolidating the notion of a GNU attribute parameter with the attribute argument list.
llvm-svn: 189711
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Sema/attr-endian.c | 11 | ||||
-rw-r--r-- | clang/test/Sema/callingconv.c | 2 | ||||
-rw-r--r-- | clang/test/Sema/warn-type-safety.c | 4 | ||||
-rw-r--r-- | clang/test/SemaObjC/arc.m | 2 | ||||
-rw-r--r-- | clang/test/SemaOpenCL/endian-attr.cl | 2 |
5 files changed, 17 insertions, 4 deletions
diff --git a/clang/test/Sema/attr-endian.c b/clang/test/Sema/attr-endian.c new file mode 100644 index 00000000000..09442400a55 --- /dev/null +++ b/clang/test/Sema/attr-endian.c @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 %s -verify -fsyntax-only + +int p1 __attribute__((endian(host))); +int p2 __attribute__((endian(device))); + +int p3 __attribute__((endian)); // expected-error {{'endian' attribute requires parameter 1 to be an identifier}} +int p4 __attribute__((endian("host"))); // expected-error {{'endian' attribute requires parameter 1 to be an identifier}} +int p5 __attribute__((endian(host, 15))); // expected-error {{'endian' attribute takes one argument}} +int p6 __attribute__((endian(strange))); // expected-warning {{unknown endian 'strange'}} + +void func(void) __attribute__((endian(host))); // expected-warning {{'endian' attribute only applies to variables}} diff --git a/clang/test/Sema/callingconv.c b/clang/test/Sema/callingconv.c index b9adf791b59..3234609d686 100644 --- a/clang/test/Sema/callingconv.c +++ b/clang/test/Sema/callingconv.c @@ -38,7 +38,7 @@ Handler H = foo; int __attribute__((pcs("aapcs", "aapcs"))) pcs1(void); // expected-error {{'pcs' attribute takes one argument}} int __attribute__((pcs())) pcs2(void); // expected-error {{'pcs' attribute takes one argument}} -int __attribute__((pcs(pcs1))) pcs3(void); // expected-error {{'pcs' attribute takes one argument}} +int __attribute__((pcs(pcs1))) pcs3(void); // expected-error {{'pcs' attribute requires a string}} int __attribute__((pcs(0))) pcs4(void); // expected-error {{'pcs' attribute requires a string}} /* These are ignored because the target is i386 and not ARM */ int __attribute__((pcs("aapcs"))) pcs5(void); // expected-warning {{calling convention 'pcs' ignored for this target}} diff --git a/clang/test/Sema/warn-type-safety.c b/clang/test/Sema/warn-type-safety.c index 4ac453d380b..dfab8f8c818 100644 --- a/clang/test/Sema/warn-type-safety.c +++ b/clang/test/Sema/warn-type-safety.c @@ -7,7 +7,7 @@ struct A {}; typedef struct A *MPI_Datatype; int wrong1(void *buf, MPI_Datatype datatype) - __attribute__(( pointer_with_type_tag )); // expected-error {{attribute requires parameter 1 to be an identifier}} + __attribute__(( pointer_with_type_tag )); // expected-error {{'pointer_with_type_tag' attribute requires parameter 1 to be an identifier}} int wrong2(void *buf, MPI_Datatype datatype) __attribute__(( pointer_with_type_tag(mpi,0,7) )); // expected-error {{attribute parameter 2 is out of bounds}} @@ -39,7 +39,7 @@ int wrong10(double buf, MPI_Datatype type) extern struct A datatype_wrong1 - __attribute__(( type_tag_for_datatype )); // expected-error {{attribute requires parameter 1 to be an identifier}} + __attribute__(( type_tag_for_datatype )); // expected-error {{'type_tag_for_datatype' attribute requires parameter 1 to be an identifier}} extern struct A datatype_wrong2 __attribute__(( type_tag_for_datatype(mpi,1,2) )); // expected-error {{expected a type}} diff --git a/clang/test/SemaObjC/arc.m b/clang/test/SemaObjC/arc.m index 76a97f3ab3b..063e857c342 100644 --- a/clang/test/SemaObjC/arc.m +++ b/clang/test/SemaObjC/arc.m @@ -87,6 +87,8 @@ void test1(A *a) { + (id)alloc; - (id)initWithInt: (int) i; - (id)myInit __attribute__((objc_method_family(init))); +- (id)myBadInit __attribute__((objc_method_family(12))); // expected-error {{'objc_method_family' attribute requires parameter 1 to be an identifier}} + @end void rdar8861761() { diff --git a/clang/test/SemaOpenCL/endian-attr.cl b/clang/test/SemaOpenCL/endian-attr.cl index e851cdf90b3..ba2f0e5c73e 100644 --- a/clang/test/SemaOpenCL/endian-attr.cl +++ b/clang/test/SemaOpenCL/endian-attr.cl @@ -6,4 +6,4 @@ constant long b __attribute__((endian(device))) = 100; constant long c __attribute__((endian(none))) = 100; // expected-warning {{unknown endian 'none'}} -void func() __attribute__((endian(host))); // expected-warning {{endian attribute only applies to variables}} +void func() __attribute__((endian(host))); // expected-warning {{'endian' attribute only applies to variables}} |