From a3e01cf822f7415337e5424af3c6f4c94a12c1b9 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 15 Nov 2013 22:45:29 +0000 Subject: 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 --- clang/test/Misc/ast-dump-attr.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'clang/test/Misc/ast-dump-attr.cpp') 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 +} -- cgit v1.2.3