dmd/compiler/test/compilable/cattributes.i
Walter Bright 1ab73cecf5
ImportC: support dllimport, dllexport, naked attributes (#15048)
* ImportC: add more support for naked, dllimport, dllexport

* ImportC: support dllimport, dllexport, naked attributes
2023-04-12 13:04:15 -07:00

31 lines
750 B
OpenEdge ABL

/* Smoke test dllimport, dllexport, and naked attributes */
__declspec(dllimport) int abc;
__declspec(dllimport) int def();
__declspec(dllexport) int ghi() { return 3; }
__declspec(dllexport) int jkl;
__declspec(naked) __declspec(dllexport)
int test(int a, int b, int c, int d, int e, int f)
{
return a + b + c + d + e + f + abc + def() + ghi() + jkl;
}
/*****************************************/
__attribute__((dllimport)) int abcx;
__attribute__((dllimport)) int defx();
__attribute__((dllexport)) int ghix() { return 3; }
__attribute__((dllexport)) int jklx;
__attribute__((naked)) __attribute__((dllexport))
int testx(int a, int b, int c, int d, int e, int f)
{
return a + b + c + d + e + f + abcx + defx() + ghix() + jklx;
}