diff options
author | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
commit | 3176e97f130184ece0e1a21352c8124cc83ff24a (patch) | |
tree | 0a5b74c0b9ca73aded34df95c91fcaf3815230d8 /test/Index/index-attrs.cpp | |
parent | 1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c (diff) | |
download | FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.zip FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.tar.gz |
Vendor import of clang trunk r256633:
https://llvm.org/svn/llvm-project/cfe/trunk@256633
Diffstat (limited to 'test/Index/index-attrs.cpp')
-rw-r--r-- | test/Index/index-attrs.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/test/Index/index-attrs.cpp b/test/Index/index-attrs.cpp new file mode 100644 index 0000000..b6100ac --- /dev/null +++ b/test/Index/index-attrs.cpp @@ -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) +} + |