]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Index/index-attrs.cpp
Vendor import of clang release_40 branch r292951:
[FreeBSD/FreeBSD.git] / test / Index / index-attrs.cpp
1 // RUN: c-index-test -index-file -check-prefix CHECK %s -target armv7-windows-gnu -fdeclspec
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 };
22 // CHECK: [indexDeclaration]: kind: struct | name: export_gnu_s | {{.*}} | lang: C++
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 };
30 // CHECK: [indexDeclaration]: kind: struct | name: import_gnu_s | {{.*}} | lang: C++
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) {}
36 // CHECK: [indexDeclaraton]: kind: function | name: export_function | {{.*}} | lang: C
37 // CHECK: <attribute>: attribute(dllexport)
38 extern "C" void __attribute__((dllexport)) export_gnu_function(void) {}
39 // CHECK: [indexDeclaraton]: kind: function | name: export_gnu_function | {{.*}} | lang: C
40 // CHECK: <attribute>: attribute(dllexport)
41
42 extern "C" {
43 void __declspec(dllimport) import_function(void);
44 // CHECK: [indexDeclaration] kind: function | name: import_function | {{.*}} | lang: C
45 // CHECK: <attribute>: attribute(dllimport)
46 void __attribute__((dllimport)) import_gnu_function(void);
47 // CHECK: [indexDeclaration] kind: function | name: import_gnu_function | {{.*}} | lang: C
48 // CHECK: <attribute>: attribute(dllimport)
49 }
50