summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/ast-dump-attr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-11-15 22:45:29 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-11-15 22:45:29 +0000
commita3e01cf822f7415337e5424af3c6f4c94a12c1b9 (patch)
tree33e9d9c041d05e24fa06fda646b16a327e3bb159 /clang/test/Misc/ast-dump-attr.cpp
parent9c13dd027bf2c3ff8d81d60af3e893a01515f1ff (diff)
downloadbcm5719-llvm-a3e01cf822f7415337e5424af3c6f4c94a12c1b9.tar.gz
bcm5719-llvm-a3e01cf822f7415337e5424af3c6f4c94a12c1b9.zip
PR8455: Handle an attribute between a goto label and a variable declaration per
the GNU documentation: the attribute only appertains to the label if it is followed by a semicolon. Based on a patch by Aaron Ballman! llvm-svn: 194869
Diffstat (limited to 'clang/test/Misc/ast-dump-attr.cpp')
-rw-r--r--clang/test/Misc/ast-dump-attr.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Misc/ast-dump-attr.cpp b/clang/test/Misc/ast-dump-attr.cpp
index 3efcd098b37..729be1f2477 100644
--- a/clang/test/Misc/ast-dump-attr.cpp
+++ b/clang/test/Misc/ast-dump-attr.cpp
@@ -95,3 +95,19 @@ void *TestVariadicUnsigned1(int) __attribute__((alloc_size(1)));
void *TestVariadicUnsigned2(int, int) __attribute__((alloc_size(1,2)));
// CHECK: FunctionDecl{{.*}}TestVariadicUnsigned2
// CHECK: AllocSizeAttr{{.*}} 0 1
+
+void TestLabel() {
+L: __attribute__((unused)) int i;
+// CHECK: LabelStmt{{.*}}'L'
+// CHECK: VarDecl{{.*}}i 'int'
+// CHECK-NEXT: UnusedAttr{{.*}}
+
+M: __attribute(()) int j;
+// CHECK: LabelStmt {{.*}} 'M'
+// CHECK-NEXT: DeclStmt
+// CHECK-NEXT: VarDecl {{.*}} j 'int'
+
+N: __attribute(()) ;
+// CHECK: LabelStmt {{.*}} 'N'
+// CHECK-NEXT: NullStmt
+}
OpenPOWER on IntegriCloud