diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
commit | be1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch) | |
tree | 1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/test/Index/annotate-attribute.cpp | |
parent | c4626a62754862d20b41e8a46a3574264ea80e6d (diff) | |
parent | f1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff) |
Merge branch 'master' of ssh://bitbucket.org/czan/honours
Diffstat (limited to 'clang/test/Index/annotate-attribute.cpp')
-rw-r--r-- | clang/test/Index/annotate-attribute.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/clang/test/Index/annotate-attribute.cpp b/clang/test/Index/annotate-attribute.cpp new file mode 100644 index 0000000..d822210 --- /dev/null +++ b/clang/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-NEXT: CXXAccessSpecifier=:4:1 (Definition) Extent=[4:1 - 4:8] +// CHECK-NEXT: CXXMethod=aMethod:5:51 Extent=[5:3 - 5:60] +// CHECK-NEXT: attribute(annotate)=spiffy_method Extent=[5:18 - 5:43] +// CHECK-NEXT: CXXAccessSpecifier=:7:1 (Definition) Extent=[7:1 - 7:43] +// CHECK-NEXT: attribute(annotate)=works Extent=[7:23 - 7:40] +// CHECK-NEXT: CXXMethod=anotherMethod:8:8 Extent=[8:3 - 8:23] +// CHECK-NEXT: attribute(annotate)=works Extent=[7:23 - 7:40] +// CHECK-NEXT: CXXAccessSpecifier=:10:1 (Definition) Extent=[10:1 - 10:53] +// CHECK-NEXT: attribute(annotate)=investigations Extent=[10:24 - 10:50] +// CHECK-NEXT: CXXMethod=inlineMethod:12:8 (Definition) Extent=[12:3 - 12:25] +// CHECK-NEXT: attribute(annotate)=investigations Extent=[10:24 - 10:50] +// CHECK-NEXT: CompoundStmt= Extent=[12:23 - 12:25] +// CHECK-NEXT: CXXAccessSpecifier=:14:1 (Definition) Extent=[14:1 - 14:11] +// CHECK-NEXT: CXXMethod=methodWithoutAttribute:16:8 Extent=[16:3 - 16:32] |