aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/stdcall-fastcall.c
blob: 1fbed300d8047de7e04ae8f3a2b97cd35f41ce82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// RUN: %clang_cc1 -emit-llvm < %s | grep 'fastcallcc' | count 6
// RUN: %clang_cc1 -emit-llvm < %s | grep 'stdcallcc' | count 6

void __attribute__((fastcall)) f1(void);
void __attribute__((stdcall)) f2(void);
void __attribute__((fastcall)) f3(void) {
  f1();
}
void __attribute__((stdcall)) f4(void) {
  f2();
}

// PR5280
void (__attribute__((fastcall)) *pf1)(void) = f1;
void (__attribute__((stdcall)) *pf2)(void) = f2;
void (__attribute__((fastcall)) *pf3)(void) = f3;
void (__attribute__((stdcall)) *pf4)(void) = f4;

int main(void) {
    f3(); f4();
    pf1(); pf2(); pf3(); pf4();
    return 0;
}