summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/ast-dump-decl.c
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-06-23 01:04:34 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-06-23 01:04:34 +0000
commit90dc5254725e32c0fab65213c554b689a2a0bbbf (patch)
tree452b7be65de79b92808d06c7bcafa987de4ac112 /clang/test/Misc/ast-dump-decl.c
parent8202e86a99fb6816b7874eb05df2f9bbca15b878 (diff)
downloadbcm5719-llvm-90dc5254725e32c0fab65213c554b689a2a0bbbf.tar.gz
bcm5719-llvm-90dc5254725e32c0fab65213c554b689a2a0bbbf.zip
PR33552: Distinguish between declarations that are owned by no module and
declarations that are owned but unconditionally visible. This allows us to set declarations as visible even if they have a local owning module, without losing information. In turn, that means that our Objective-C support can keep on incorrectly assuming the "hidden" bit on the declaration is the whole story with regard to name visibility. This will also be useful once we support the C++ Modules TS export semantics. Objective-C name visibility is still incorrect in any case where the "hidden" bit is not the complete story: for instance, in Objective-C++ the set of visible categories will be wrong during template instantiation, and with local submodule visibility enabled it will be wrong when building modules. Fixing that will require a major overhaul of how visibility is handled for Objective-C (and particularly for categories). llvm-svn: 306075
Diffstat (limited to 'clang/test/Misc/ast-dump-decl.c')
-rw-r--r--clang/test/Misc/ast-dump-decl.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/clang/test/Misc/ast-dump-decl.c b/clang/test/Misc/ast-dump-decl.c
index 45edea26b4f..313c808c4ac 100644
--- a/clang/test/Misc/ast-dump-decl.c
+++ b/clang/test/Misc/ast-dump-decl.c
@@ -1,8 +1,13 @@
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix CHECK -strict-whitespace %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump %s | FileCheck -check-prefix CHECK-TU -strict-whitespace %s
+// RUN: %clang_cc1 -fmodules -fmodules-local-submodule-visibility -fmodule-name=X -triple x86_64-unknown-unknown -fmodule-map-file=%S/Inputs/module.modulemap -ast-dump -ast-dump-filter Test %s -DMODULES | FileCheck -check-prefix CHECK -check-prefix CHECK-MODULES -strict-whitespace %s
int TestLocation;
-// CHECK: VarDecl 0x{{[^ ]*}} <{{.*}}:4:1, col:5> col:5 TestLocation
+// CHECK: VarDecl 0x{{[^ ]*}} <{{.*}}:[[@LINE-1]]:1, col:5> col:5 TestLocation
+
+#ifdef MODULES
+#pragma clang module begin X
+#endif
struct TestIndent {
int x;
@@ -33,7 +38,7 @@ typedef int TestTypedefDecl;
// CHECK: TypedefDecl{{.*}} TestTypedefDecl 'int'
__module_private__ typedef int TestTypedefDeclPrivate;
-// CHECK: TypedefDecl{{.*}} TestTypedefDeclPrivate 'int' __module_private__
+// CHECK-MODULE: TypedefDecl{{.*}} TestTypedefDeclPrivate 'int' __module_private__
enum TestEnumDecl {
testEnumDecl
@@ -53,7 +58,7 @@ enum TestEnumDeclForward;
// CHECK: EnumDecl{{.*}} TestEnumDeclForward
__module_private__ enum TestEnumDeclPrivate;
-// CHECK: EnumDecl{{.*}} TestEnumDeclPrivate __module_private__
+// CHECK-MODULE: EnumDecl{{.*}} TestEnumDeclPrivate __module_private__
struct TestRecordDecl {
int i;
@@ -83,7 +88,7 @@ struct TestRecordDeclForward;
// CHECK: RecordDecl{{.*}} struct TestRecordDeclForward
__module_private__ struct TestRecordDeclPrivate;
-// CHECK: RecordDecl{{.*}} struct TestRecordDeclPrivate __module_private__
+// CHECK-MODULE: RecordDecl{{.*}} struct TestRecordDeclPrivate __module_private__
enum testEnumConstantDecl {
TestEnumConstantDecl,
@@ -136,7 +141,7 @@ struct testFieldDecl {
// CHECK: FieldDecl{{.*}} TestFieldDecl 'int'
// CHECK: FieldDecl{{.*}} TestFieldDeclWidth 'int'
// CHECK-NEXT: IntegerLiteral
-// CHECK: FieldDecl{{.*}} TestFieldDeclPrivate 'int' __module_private__
+// CHECK-MODULE: FieldDecl{{.*}} TestFieldDeclPrivate 'int' __module_private__
int TestVarDecl;
// CHECK: VarDecl{{.*}} TestVarDecl 'int'
@@ -148,7 +153,7 @@ __thread int TestVarDeclThread;
// CHECK: VarDecl{{.*}} TestVarDeclThread 'int' tls{{$}}
__module_private__ int TestVarDeclPrivate;
-// CHECK: VarDecl{{.*}} TestVarDeclPrivate 'int' __module_private__
+// CHECK-MODULE: VarDecl{{.*}} TestVarDeclPrivate 'int' __module_private__
int TestVarDeclInit = 0;
// CHECK: VarDecl{{.*}} TestVarDeclInit 'int'
@@ -156,3 +161,8 @@ int TestVarDeclInit = 0;
void testParmVarDecl(int TestParmVarDecl);
// CHECK: ParmVarDecl{{.*}} TestParmVarDecl 'int'
+
+#ifdef MODULES
+#pragma clang module end
+#endif
+
OpenPOWER on IntegriCloud