Charles Davis | 16c4f3c | 2010-02-05 18:13:10 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm < %s | grep 'fastcallcc' | count 6 |
| 2 | // RUN: %clang_cc1 -emit-llvm < %s | grep 'stdcallcc' | count 6 |
Anton Korobeynikov | f1c9c09 | 2008-11-11 20:21:14 +0000 | [diff] [blame] | 3 | |
| 4 | void __attribute__((fastcall)) f1(void); |
| 5 | void __attribute__((stdcall)) f2(void); |
| 6 | void __attribute__((fastcall)) f3(void) { |
| 7 | f1(); |
| 8 | } |
| 9 | void __attribute__((stdcall)) f4(void) { |
| 10 | f2(); |
| 11 | } |
| 12 | |
Charles Davis | 16c4f3c | 2010-02-05 18:13:10 +0000 | [diff] [blame] | 13 | // PR5280 |
| 14 | void (__attribute__((fastcall)) *pf1)(void) = f1; |
| 15 | void (__attribute__((stdcall)) *pf2)(void) = f2; |
| 16 | void (__attribute__((fastcall)) *pf3)(void) = f3; |
| 17 | void (__attribute__((stdcall)) *pf4)(void) = f4; |
| 18 | |
Anton Korobeynikov | f1c9c09 | 2008-11-11 20:21:14 +0000 | [diff] [blame] | 19 | int main(void) { |
| 20 | f3(); f4(); |
Charles Davis | 16c4f3c | 2010-02-05 18:13:10 +0000 | [diff] [blame] | 21 | pf1(); pf2(); pf3(); pf4(); |
Anton Korobeynikov | f1c9c09 | 2008-11-11 20:21:14 +0000 | [diff] [blame] | 22 | return 0; |
| 23 | } |
| 24 | |