Improving calling convention test coverage by adding tests for things not currently handled. Specifically: the diagnostics in SemaDeclAttr.cpp, and ensuring that calling convention attributes are applied to ObjC method declarations. No functional changes.

llvm-svn: 195098
This commit is contained in:
Aaron Ballman 2013-11-19 04:08:34 +00:00
parent 9e40b1b61d
commit b8f67f2de8
3 changed files with 18 additions and 0 deletions

View File

@ -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

View File

@ -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}}

View File

@ -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