• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 %s -fsyntax-only -verify
2 
foo(float * a)3 void __attribute__((fastcall)) foo(float *a) {
4 }
5 
bar(float * a)6 void __attribute__((stdcall)) bar(float *a) {
7 }
8 
baz(float * a)9 void __attribute__((fastcall(1))) baz(float *a) { // expected-error {{attribute takes no arguments}}
10 }
11 
test0()12 void __attribute__((fastcall)) test0() { // expected-error {{function with no prototype cannot use fastcall calling convention}}
13 }
14 
test1(void)15 void __attribute__((fastcall)) test1(void) {
16 }
17 
test2(int a,...)18 void __attribute__((fastcall)) test2(int a, ...) { // expected-error {{variadic function cannot use fastcall calling convention}}
19 }
20 
ctest0()21 void __attribute__((cdecl)) ctest0() {}
22 
ctest1(float x)23 void __attribute__((cdecl(1))) ctest1(float x) {} // expected-error {{attribute takes no arguments}}
24 
25 void (__attribute__((fastcall)) *pfoo)(float*) = foo;
26 
27 void (__attribute__((stdcall)) *pbar)(float*) = bar;
28 
29 void (__attribute__((cdecl)) *ptest1)(void) = test1; // expected-warning {{incompatible pointer types}}
30 
31 void (*pctest0)() = ctest0;
32 
ctest2()33 void ctest2() {}
34 void (__attribute__((cdecl)) *pctest2)() = ctest2;
35 
36 typedef void (__attribute__((fastcall)) *Handler) (float *);
37 Handler H = foo;
38 
39 // PR6361
40 void ctest3();
ctest3()41 void __attribute__((cdecl)) ctest3() {}
42 
43 // PR6408
44 typedef __attribute__((stdcall)) void (*PROC)();
ctest4(const char * x)45 PROC __attribute__((cdecl)) ctest4(const char *x) {}
46 
47