-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libclang: expose dllexport, dllimport attributes
These attributes were previously unexposed. Expose them through the libclang interfaces. Add tests that cover both the MSVC spelling and the GNU spelling. llvm-svn: 255273
- Loading branch information
Showing
6 changed files
with
79 additions
and
2 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // RUN: c-index-test -index-file -check-prefix CHECK %s -target armv7-windows-gnu -fdeclspec | ||
|
|
||
| void __declspec(dllexport) export_function(void) {} | ||
| // CHECK: [indexDeclaraton]: kind: function | name: export_function | {{.*}} | lang: C | ||
| // CHECK: <attribute>: attribute(dllexport) | ||
| void __attribute__((dllexport)) export_gnu_attribute(void) {} | ||
| // CHECK: [indexDeclaration] kind: function | name: export_gnu_attribute | {{.*}} | lang: C | ||
| // CHECK: <attribute>: attribute(dllexport) | ||
|
|
||
| void __declspec(dllimport) import_function(void); | ||
| // CHECK: [indexDeclaration] kind: function | name: import_function | {{.*}} | lang: C | ||
| // CHECK: <attribute>: attribute(dllimport) | ||
| void __attribute__((dllimport)) import_gnu_attribute(void); | ||
| // CHECK: [indexDeclaration] kind: function | name: import_gnu_function | {{.*}} | lang: C | ||
| // CHECK: <attribute>: attribute(dllimport) | ||
|
|
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,50 @@ | ||
| // RUN: c-index-test -index-file -check-prefix CHECK %s -target armv7-windows-gnu -fdeclspec | ||
|
|
||
| struct __declspec(dllexport) export_s { | ||
| void m(); | ||
| }; | ||
| // CHECK: [indexDeclaration]: kind: struct | name: export_s | {{.*}} | lang: C++ | ||
| // CHECK: <attribute>: attribute(dllexport) | ||
| // CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++ | ||
| // CHECK: <attribute>: attribute(dllexport) | ||
|
|
||
| struct __declspec(dllimport) import_s { | ||
| void m(); | ||
| }; | ||
| // CHECK: [indexDeclaration]: kind: struct | name: import_s | {{.*}} | lang: C++ | ||
| // CHECK: <attribute>: attribute(dllimport) | ||
| // CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++ | ||
| // CHECK: <attribute>: attribute(dllimport) | ||
|
|
||
| class __attribute__((dllexport)) export_gnu_s { | ||
| void m(); | ||
| }; | ||
| // CHECK: [indexDeclaration]: kind: struct | name: export_gnu_s | {{.*}} | lang: C++ | ||
| // CHECK: <attribute>: attribute(dllexport) | ||
| // CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++ | ||
| // CHECK: <attribute>: attribute(dllexport) | ||
|
|
||
| class __attribute__((dllimport)) import_gnu_s { | ||
| void m(); | ||
| }; | ||
| // CHECK: [indexDeclaration]: kind: struct | name: import_gnu_s | {{.*}} | lang: C++ | ||
| // CHECK: <attribute>: attribute(dllimport) | ||
| // CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++ | ||
| // CHECK: <attribute>: attribute(dllimport) | ||
|
|
||
| extern "C" void __declspec(dllexport) export_function(void) {} | ||
| // CHECK: [indexDeclaraton]: kind: function | name: export_function | {{.*}} | lang: C | ||
| // CHECK: <attribute>: attribute(dllexport) | ||
| extern "C" void __attribute__((dllexport)) export_gnu_function(void) {} | ||
| // CHECK: [indexDeclaraton]: kind: function | name: export_gnu_function | {{.*}} | lang: C | ||
| // CHECK: <attribute>: attribute(dllexport) | ||
|
|
||
| extern "C" { | ||
| void __declspec(dllimport) import_function(void); | ||
| // CHECK: [indexDeclaration] kind: function | name: import_function | {{.*}} | lang: C | ||
| // CHECK: <attribute>: attribute(dllimport) | ||
| void __attribute__((dllimport)) import_gnu_function(void); | ||
| // CHECK: [indexDeclaration] kind: function | name: import_gnu_function | {{.*}} | lang: C | ||
| // CHECK: <attribute>: attribute(dllimport) | ||
| } | ||
|
|
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