]> granicus.if.org Git - clang/commitdiff
Improving calling convention test coverage by adding tests for things not currently...
authorAaron Ballman <aaron@aaronballman.com>
Tue, 19 Nov 2013 04:08:34 +0000 (04:08 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Tue, 19 Nov 2013 04:08:34 +0000 (04:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195098 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenObjC/attr-callconv.m [new file with mode: 0644]
test/Sema/callingconv.c
test/SemaObjC/method-attributes.m

diff --git a/test/CodeGenObjC/attr-callconv.m b/test/CodeGenObjC/attr-callconv.m
new file mode 100644 (file)
index 0000000..bfc8a19
--- /dev/null
@@ -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
index 500c0fbfb275f3f834e303a51825d22614c7a8ea..f9fa9fef2b3683f4e6c55212e1768ccb42fcc7ee 100644 (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}}
index b402d52a42a10bb9e7877da34c619877c08e9a55..2e794b9de96ca30b1bd5399c024a2cb08a1bf49b 100644 (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