From 3963a48221351c61c17fb3f382341ab04809a3d3 Mon Sep 17 00:00:00 2001 From: dim Date: Thu, 20 Oct 2011 21:14:49 +0000 Subject: Vendor import of clang release_30 branch r142614: http://llvm.org/svn/llvm-project/cfe/branches/release_30@142614 --- test/Index/annotate-attribute.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/Index/annotate-attribute.cpp (limited to 'test/Index/annotate-attribute.cpp') diff --git a/test/Index/annotate-attribute.cpp b/test/Index/annotate-attribute.cpp new file mode 100644 index 0000000..6721371 --- /dev/null +++ b/test/Index/annotate-attribute.cpp @@ -0,0 +1,33 @@ +// RUN: c-index-test -test-load-source all %s | FileCheck %s + +class Test { +public: + __attribute__((annotate("spiffy_method"))) void aMethod(); + +public __attribute__((annotate("works"))): + void anotherMethod(); // annotation attribute should be propagated. + +private __attribute__((annotate("investigations"))): + //propagated annotation should have changed from "works" to "investigations" + void inlineMethod() {} + +protected: + // attribute propagation should have stopped here + void methodWithoutAttribute(); +}; + +// CHECK: ClassDecl=Test:3:7 (Definition) Extent=[3:1 - 17:2] +// CHECK: CXXAccessSpecifier=:4:1 (Definition) Extent=[4:1 - 4:8] +// CHECK: CXXMethod=aMethod:5:51 Extent=[5:3 - 5:60] +// CHECK: attribute(annotate)=spiffy_method Extent=[5:18 - 5:43] +// CHECK: CXXAccessSpecifier=:7:1 (Definition) Extent=[7:1 - 7:43] +// CHECK: attribute(annotate)=works Extent=[7:23 - 7:40] +// CHECK: CXXMethod=anotherMethod:8:8 Extent=[8:3 - 8:23] +// CHECK: attribute(annotate)=works Extent=[7:23 - 7:40] +// CHECK: CXXAccessSpecifier=:10:1 (Definition) Extent=[10:1 - 10:53] +// CHECK: attribute(annotate)=investigations Extent=[10:24 - 10:50] +// CHECK: CXXMethod=inlineMethod:12:8 (Definition) Extent=[12:3 - 12:25] +// CHECK: attribute(annotate)=investigations Extent=[10:24 - 10:50] +// CHECK: CompoundStmt= Extent=[12:23 - 12:25] +// CHECK: CXXAccessSpecifier=:14:1 (Definition) Extent=[14:1 - 14:11] +// CHECK: CXXMethod=methodWithoutAttribute:16:8 Extent=[16:3 - 16:32] -- cgit v1.1