diff --git a/clang/test/CodeGenObjC/attr-callconv.m b/clang/test/CodeGenObjC/attr-callconv.m new file mode 100644 index 000000000000..bfc8a191cdd6 --- /dev/null +++ b/clang/test/CodeGenObjC/attr-callconv.m @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck %s + +@interface Test +- (void)test; +@end + +@implementation Test +- (void)test __attribute__((stdcall)) { + // CHECK: define{{.*}}x86_stdcallcc{{.*}}Test test +} +@end diff --git a/clang/test/Sema/callingconv.c b/clang/test/Sema/callingconv.c index 500c0fbfb275..f9fa9fef2b36 100644 --- a/clang/test/Sema/callingconv.c +++ b/clang/test/Sema/callingconv.c @@ -66,3 +66,5 @@ void __attribute__((intel_ocl_bicc)) inteloclbifunc(float *a) {} typedef void typedef_fun_t(int); typedef_fun_t typedef_fun; // expected-note {{previous declaration is here}} void __attribute__((stdcall)) typedef_fun(int x) { } // expected-error {{function declared 'stdcall' here was previously declared without calling convention}} + +struct type_test {} __attribute__((stdcall)); // expected-warning {{'stdcall' attribute only applies to functions and methods}} diff --git a/clang/test/SemaObjC/method-attributes.m b/clang/test/SemaObjC/method-attributes.m index b402d52a42a1..2e794b9de96c 100644 --- a/clang/test/SemaObjC/method-attributes.m +++ b/clang/test/SemaObjC/method-attributes.m @@ -7,6 +7,7 @@ - (NSString *)stringByAppendingFormat:(NSString *)format, ... __attribute__((format(__NSString__, 1, 2))); -(void) m0 __attribute__((noreturn)); -(void) m1 __attribute__((unused)); +-(void) m2 __attribute__((stdcall)); @end @@ -84,3 +85,7 @@ return self; } @end + +__attribute__((cdecl)) // expected-warning {{'cdecl' attribute only applies to functions and methods}} +@interface Complain +@end