]> granicus.if.org Git - clang/commitdiff
[clang] Ignore builtin namespaces in test/Import/cxx-anon-namespace
authorRaphael Isemann <teemperor@gmail.com>
Tue, 1 Oct 2019 11:53:20 +0000 (11:53 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Tue, 1 Oct 2019 11:53:20 +0000 (11:53 +0000)
Some platforms (e.g. AArch64) put __va_list in the 'std' namespace which might
end up being the first namespace we match in this test. Instead let
the first namespace match via file name/line so that we skip the
builtin namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373327 91177308-0d34-0410-b5e6-96231b3b80d8

test/Import/cxx-anon-namespace/test.cpp

index 0cbf08c181eea8c8fba3a4caf63f58ab06f962ea..7331a6bc4315e4b0903b65f45021382161904057 100644 (file)
@@ -2,9 +2,13 @@
 
 // The implicit UsingDirectiveDecls for the anonymous namespaces are created by the Sema.
 
-// CHECK: NamespaceDecl
+// There might be another builtin namespace before our first namespace, so we can't
+// just look for NamespaceDecl. Instead look for the first line of F.cpp (which only
+// contains the namespace we are looking for but no other decl).
+// CHECK: F.cpp:1:1
 // The nested anonymous namespace.
 // CHECK-NEXT: NamespaceDecl
+// CHECK-SAME: <invalid sloc>
 // CHECK: FunctionDecl
 // CHECK-SAME: func4
 // CHECK-NEXT: CompoundStmt