Charles Davis | d82bf2d | 2010-02-05 20:45:48 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s |
Anton Korobeynikov | f1c9c09 | 2008-11-11 20:21:14 +0000 | [diff] [blame] | 2 | |
| 3 | void __attribute__((fastcall)) f1(void); |
| 4 | void __attribute__((stdcall)) f2(void); |
| 5 | void __attribute__((fastcall)) f3(void) { |
Charles Davis | d82bf2d | 2010-02-05 20:45:48 +0000 | [diff] [blame] | 6 | // CHECK: define x86_fastcallcc void @f3() |
Anton Korobeynikov | f1c9c09 | 2008-11-11 20:21:14 +0000 | [diff] [blame] | 7 | f1(); |
Charles Davis | d82bf2d | 2010-02-05 20:45:48 +0000 | [diff] [blame] | 8 | // CHECK: call x86_fastcallcc void @f1() |
Anton Korobeynikov | f1c9c09 | 2008-11-11 20:21:14 +0000 | [diff] [blame] | 9 | } |
| 10 | void __attribute__((stdcall)) f4(void) { |
Charles Davis | d82bf2d | 2010-02-05 20:45:48 +0000 | [diff] [blame] | 11 | // CHECK: define x86_stdcallcc void @f4() |
Anton Korobeynikov | f1c9c09 | 2008-11-11 20:21:14 +0000 | [diff] [blame] | 12 | f2(); |
Charles Davis | d82bf2d | 2010-02-05 20:45:48 +0000 | [diff] [blame] | 13 | // CHECK: call x86_stdcallcc void @f2() |
Anton Korobeynikov | f1c9c09 | 2008-11-11 20:21:14 +0000 | [diff] [blame] | 14 | } |
| 15 | |
Charles Davis | 16c4f3c | 2010-02-05 18:13:10 +0000 | [diff] [blame] | 16 | // PR5280 |
| 17 | void (__attribute__((fastcall)) *pf1)(void) = f1; |
| 18 | void (__attribute__((stdcall)) *pf2)(void) = f2; |
| 19 | void (__attribute__((fastcall)) *pf3)(void) = f3; |
| 20 | void (__attribute__((stdcall)) *pf4)(void) = f4; |
| 21 | |
Anton Korobeynikov | f1c9c09 | 2008-11-11 20:21:14 +0000 | [diff] [blame] | 22 | int main(void) { |
| 23 | f3(); f4(); |
Charles Davis | d82bf2d | 2010-02-05 20:45:48 +0000 | [diff] [blame] | 24 | // CHECK: call x86_fastcallcc void @f3() |
| 25 | // CHECK: call x86_stdcallcc void @f4() |
Charles Davis | 16c4f3c | 2010-02-05 18:13:10 +0000 | [diff] [blame] | 26 | pf1(); pf2(); pf3(); pf4(); |
John McCall | 04a67a6 | 2010-02-05 21:31:56 +0000 | [diff] [blame] | 27 | // CHECK: call x86_fastcallcc void %{{.*}}() |
| 28 | // CHECK: call x86_stdcallcc void %{{.*}}() |
| 29 | // CHECK: call x86_fastcallcc void %{{.*}}() |
| 30 | // CHECK: call x86_stdcallcc void %{{.*}}() |
Anton Korobeynikov | f1c9c09 | 2008-11-11 20:21:14 +0000 | [diff] [blame] | 31 | return 0; |
| 32 | } |
| 33 | |
Eli Friedman | 9a0fcfe | 2010-05-17 02:50:18 +0000 | [diff] [blame^] | 34 | // PR7117 |
| 35 | void __attribute((stdcall)) f5(foo) int foo; {} |
| 36 | void f6(void) { |
| 37 | f5(0); |
| 38 | // CHECK: call x86_stdcallcc void (...)* bitcast |
| 39 | } |