Author: aaronballman
Date: Mon Nov 18 22:08:34 2013
New Revision: 195098
URL: http://llvm.org/viewvc/llvm-project?rev=195098&view=rev
Log:
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.
Added:
cfe/trunk/test/CodeGenObjC/attr-callconv.m
Modified:
cfe/trunk/test/Sema/callingconv.c
cfe/trunk/test/SemaObjC/method-attributes.m
Added: cfe/trunk/test/CodeGenObjC/attr-callconv.m
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/attr-callconv.m?rev=195098&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/attr-callconv.m (added)
+++ cfe/trunk/test/CodeGenObjC/attr-callconv.m Mon Nov 18 22:08:34 2013
@@ -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
Modified: cfe/trunk/test/Sema/callingconv.c
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/callingconv.c?rev=195098&r1=195097&r2=195098&view=diff
==============================================================================
--- cfe/trunk/test/Sema/callingconv.c (original)
+++ cfe/trunk/test/Sema/callingconv.c Mon Nov 18 22:08:34 2013
@@ -66,3 +66,5 @@ void __attribute__((intel_ocl_bicc)) int
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}}
Modified: cfe/trunk/test/SemaObjC/method-attributes.m
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/method-attributes.m?rev=195098&r1=195097&r2=195098&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/method-attributes.m (original)
+++ cfe/trunk/test/SemaObjC/method-attributes.m Mon Nov 18 22:08:34 2013
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits