Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ImportC: support dllimport, dllexport, naked attributes (#15048)
* ImportC: add more support for naked, dllimport, dllexport * ImportC: support dllimport, dllexport, naked attributes
- Loading branch information
1 parent
5cd6f80
commit 1ab73ce
Showing
7 changed files
with
100 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* 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; | ||
} |