summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/ast-dump-attr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Misc/ast-dump-attr.cpp')
-rw-r--r--clang/test/Misc/ast-dump-attr.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/Misc/ast-dump-attr.cpp b/clang/test/Misc/ast-dump-attr.cpp
index 1e4eb7c3195..5ed3c73aa23 100644
--- a/clang/test/Misc/ast-dump-attr.cpp
+++ b/clang/test/Misc/ast-dump-attr.cpp
@@ -209,3 +209,24 @@ namespace TestSuppress {
}
}
}
+
+// Verify the order of attributes in the Ast. It must reflect the order
+// in the parsed source.
+int mergeAttrTest() __attribute__((deprecated)) __attribute__((warn_unused_result));
+int mergeAttrTest() __attribute__((annotate("test")));
+int mergeAttrTest() __attribute__((unused,no_thread_safety_analysis));
+// CHECK: FunctionDecl{{.*}} mergeAttrTest
+// CHECK-NEXT: DeprecatedAttr
+// CHECK-NEXT: WarnUnusedResultAttr
+
+// CHECK: FunctionDecl{{.*}} mergeAttrTest
+// CHECK-NEXT: DeprecatedAttr{{.*}} Inherited
+// CHECK-NEXT: WarnUnusedResultAttr{{.*}} Inherited
+// CHECK-NEXT: AnnotateAttr{{.*}}
+
+// CHECK: FunctionDecl{{.*}} mergeAttrTest
+// CHECK-NEXT: DeprecatedAttr{{.*}} Inherited
+// CHECK-NEXT: WarnUnusedResultAttr{{.*}} Inherited
+// CHECK-NEXT: AnnotateAttr{{.*}} Inherited
+// CHECK-NEXT: UnusedAttr
+// CHECK-NEXT: NoThreadSafetyAnalysisAttr
OpenPOWER on IntegriCloud