From 3176e97f130184ece0e1a21352c8124cc83ff24a Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 30 Dec 2015 11:49:41 +0000 Subject: Vendor import of clang trunk r256633: https://llvm.org/svn/llvm-project/cfe/trunk@256633 --- test/Index/index-attrs.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 test/Index/index-attrs.cpp (limited to 'test/Index/index-attrs.cpp') 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(dllexport) +// CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++ +// CHECK: : attribute(dllexport) + +struct __declspec(dllimport) import_s { + void m(); +}; +// CHECK: [indexDeclaration]: kind: struct | name: import_s | {{.*}} | lang: C++ +// CHECK: : attribute(dllimport) +// CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++ +// CHECK: : attribute(dllimport) + +class __attribute__((dllexport)) export_gnu_s { + void m(); +}; +// CHECK: [indexDeclaration]: kind: struct | name: export_gnu_s | {{.*}} | lang: C++ +// CHECK: : attribute(dllexport) +// CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++ +// CHECK: : attribute(dllexport) + +class __attribute__((dllimport)) import_gnu_s { + void m(); +}; +// CHECK: [indexDeclaration]: kind: struct | name: import_gnu_s | {{.*}} | lang: C++ +// CHECK: : attribute(dllimport) +// CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++ +// CHECK: : attribute(dllimport) + +extern "C" void __declspec(dllexport) export_function(void) {} +// CHECK: [indexDeclaraton]: kind: function | name: export_function | {{.*}} | lang: C +// CHECK: : attribute(dllexport) +extern "C" void __attribute__((dllexport)) export_gnu_function(void) {} +// CHECK: [indexDeclaraton]: kind: function | name: export_gnu_function | {{.*}} | lang: C +// CHECK: : attribute(dllexport) + +extern "C" { +void __declspec(dllimport) import_function(void); +// CHECK: [indexDeclaration] kind: function | name: import_function | {{.*}} | lang: C +// CHECK: : attribute(dllimport) +void __attribute__((dllimport)) import_gnu_function(void); +// CHECK: [indexDeclaration] kind: function | name: import_gnu_function | {{.*}} | lang: C +// CHECK: : attribute(dllimport) +} + -- cgit v1.1