summaryrefslogtreecommitdiff
path: root/test/Index/index-attrs.cpp
blob: 0758a422cab8cee841fec77fd691dbdfba269353 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// RUN: c-index-test -index-file %s -target armv7-windows-gnu -fdeclspec | FileCheck %s

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: c++-class | 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: c++-class | 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: [indexDeclaration]: kind: function | name: export_function | {{.*}} | lang: C
// CHECK: <attribute>: attribute(dllexport)
extern "C" void __attribute__((dllexport)) export_gnu_function(void) {}
// CHECK: [indexDeclaration]: 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)
}