Serge Pavlov | b43573b | 2017-05-24 14:57:17 +0000 | [diff] [blame] | 1 | // RUN: c-index-test -index-file %s -target armv7-windows-gnu -fdeclspec | FileCheck %s |
Saleem Abdulrasool | 8aa0b80 | 2015-12-10 18:45:18 +0000 | [diff] [blame] | 2 | |
| 3 | struct __declspec(dllexport) export_s { |
| 4 | void m(); |
| 5 | }; |
| 6 | // CHECK: [indexDeclaration]: kind: struct | name: export_s | {{.*}} | lang: C++ |
| 7 | // CHECK: <attribute>: attribute(dllexport) |
| 8 | // CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++ |
| 9 | // CHECK: <attribute>: attribute(dllexport) |
| 10 | |
| 11 | struct __declspec(dllimport) import_s { |
| 12 | void m(); |
| 13 | }; |
| 14 | // CHECK: [indexDeclaration]: kind: struct | name: import_s | {{.*}} | lang: C++ |
| 15 | // CHECK: <attribute>: attribute(dllimport) |
| 16 | // CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++ |
| 17 | // CHECK: <attribute>: attribute(dllimport) |
| 18 | |
| 19 | class __attribute__((dllexport)) export_gnu_s { |
| 20 | void m(); |
| 21 | }; |
Serge Pavlov | b43573b | 2017-05-24 14:57:17 +0000 | [diff] [blame] | 22 | // CHECK: [indexDeclaration]: kind: c++-class | name: export_gnu_s | {{.*}} | lang: C++ |
Saleem Abdulrasool | 8aa0b80 | 2015-12-10 18:45:18 +0000 | [diff] [blame] | 23 | // CHECK: <attribute>: attribute(dllexport) |
| 24 | // CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++ |
| 25 | // CHECK: <attribute>: attribute(dllexport) |
| 26 | |
| 27 | class __attribute__((dllimport)) import_gnu_s { |
| 28 | void m(); |
| 29 | }; |
Serge Pavlov | b43573b | 2017-05-24 14:57:17 +0000 | [diff] [blame] | 30 | // CHECK: [indexDeclaration]: kind: c++-class | name: import_gnu_s | {{.*}} | lang: C++ |
Saleem Abdulrasool | 8aa0b80 | 2015-12-10 18:45:18 +0000 | [diff] [blame] | 31 | // CHECK: <attribute>: attribute(dllimport) |
| 32 | // CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++ |
| 33 | // CHECK: <attribute>: attribute(dllimport) |
| 34 | |
| 35 | extern "C" void __declspec(dllexport) export_function(void) {} |
Serge Pavlov | b43573b | 2017-05-24 14:57:17 +0000 | [diff] [blame] | 36 | // CHECK: [indexDeclaration]: kind: function | name: export_function | {{.*}} | lang: C |
Saleem Abdulrasool | 8aa0b80 | 2015-12-10 18:45:18 +0000 | [diff] [blame] | 37 | // CHECK: <attribute>: attribute(dllexport) |
| 38 | extern "C" void __attribute__((dllexport)) export_gnu_function(void) {} |
Serge Pavlov | b43573b | 2017-05-24 14:57:17 +0000 | [diff] [blame] | 39 | // CHECK: [indexDeclaration]: kind: function | name: export_gnu_function | {{.*}} | lang: C |
Saleem Abdulrasool | 8aa0b80 | 2015-12-10 18:45:18 +0000 | [diff] [blame] | 40 | // CHECK: <attribute>: attribute(dllexport) |
| 41 | |
| 42 | extern "C" { |
| 43 | void __declspec(dllimport) import_function(void); |
Serge Pavlov | b43573b | 2017-05-24 14:57:17 +0000 | [diff] [blame] | 44 | // CHECK: [indexDeclaration]: kind: function | name: import_function | {{.*}} | lang: C |
Saleem Abdulrasool | 8aa0b80 | 2015-12-10 18:45:18 +0000 | [diff] [blame] | 45 | // CHECK: <attribute>: attribute(dllimport) |
| 46 | void __attribute__((dllimport)) import_gnu_function(void); |
Serge Pavlov | b43573b | 2017-05-24 14:57:17 +0000 | [diff] [blame] | 47 | // CHECK: [indexDeclaration]: kind: function | name: import_gnu_function | {{.*}} | lang: C |
Saleem Abdulrasool | 8aa0b80 | 2015-12-10 18:45:18 +0000 | [diff] [blame] | 48 | // CHECK: <attribute>: attribute(dllimport) |
| 49 | } |
| 50 | |