diff options
Diffstat (limited to 'test/CXX/modules-ts')
5 files changed, 17 insertions, 42 deletions
diff --git a/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp b/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp index ad03191363..6eb5639d30 100644 --- a/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp +++ b/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp @@ -3,7 +3,6 @@ // CHECK-DAG: @extern_var_exported = external {{(dso_local )?}}global // CHECK-DAG: @inline_var_exported = linkonce_odr {{(dso_local )?}}global -// CHECK-DAG: @_ZW6ModuleE19static_var_exported = available_externally {{(dso_local )?}}global i32 0, // CHECK-DAG: @const_var_exported = available_externally {{(dso_local )?}}constant i32 3, // // CHECK-DAG: @_ZW6ModuleE25extern_var_module_linkage = external {{(dso_local )?}}global @@ -21,7 +20,6 @@ void use() { (void)&extern_var_exported; (void)&inline_var_exported; - (void)&static_var_exported; // FIXME: Should not be exported. (void)&const_var_exported; // FIXME: This symbol should not be visible here. diff --git a/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm b/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm index 0f2c0db66e..65861f84ba 100644 --- a/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm +++ b/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm @@ -11,7 +11,6 @@ // can discard this global and its initializer (if any), and other TUs are not // permitted to run the initializer for this variable. // CHECK-DAG: @inline_var_exported = linkonce_odr {{(dso_local )?}}global -// CHECK-DAG: @_ZW6ModuleE19static_var_exported = {{(dso_local )?}}global // CHECK-DAG: @const_var_exported = {{(dso_local )?}}constant // // CHECK-DAG: @_ZW6ModuleE25extern_var_module_linkage = external {{(dso_local )?}}global @@ -58,32 +57,17 @@ void noninline_global_module() { export module Module; export { - // FIXME: These should be ill-formed: you can't export an internal linkage - // symbol, per [dcl.module.interface]p2. - // CHECK: define {{(dso_local )?}}void {{.*}}@_ZW6ModuleE22unused_static_exportedv - static void unused_static_exported() {} - // CHECK: define {{(dso_local )?}}void {{.*}}@_ZW6ModuleE20used_static_exportedv - static void used_static_exported() {} - inline void unused_inline_exported() {} inline void used_inline_exported() {} extern int extern_var_exported; inline int inline_var_exported; - // FIXME: This should be ill-formed: you can't export an internal linkage - // symbol. - static int static_var_exported; const int const_var_exported = 3; // CHECK: define {{(dso_local )?}}void {{.*}}@_Z18noninline_exportedv void noninline_exported() { - used_static_exported(); - // CHECK: define linkonce_odr {{.*}}@_Z20used_inline_exportedv - used_inline_exported(); - (void)&extern_var_exported; (void)&inline_var_exported; - (void)&static_var_exported; (void)&const_var_exported; } } diff --git a/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp b/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp index 97c69fa0bb..d55e063797 100644 --- a/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp +++ b/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp @@ -3,7 +3,6 @@ // CHECK-DAG: @extern_var_exported = external {{(dso_local )?}}global // CHECK-DAG: @inline_var_exported = linkonce_odr {{(dso_local )?}}global -// CHECK-DAG: @_ZW6ModuleE19static_var_exported = available_externally {{(dso_local )?}}global i32 0 // CHECK-DAG: @const_var_exported = available_externally {{(dso_local )?}}constant i32 3 import Module; @@ -16,7 +15,6 @@ void use() { (void)&extern_var_exported; (void)&inline_var_exported; - (void)&static_var_exported; (void)&const_var_exported; // Module-linkage declarations are not visible here. diff --git a/test/CXX/modules-ts/basic/basic.link/module-declaration.cpp b/test/CXX/modules-ts/basic/basic.link/module-declaration.cpp index feb0afdda0..7615536b81 100644 --- a/test/CXX/modules-ts/basic/basic.link/module-declaration.cpp +++ b/test/CXX/modules-ts/basic/basic.link/module-declaration.cpp @@ -10,47 +10,39 @@ // // Module implementation for unknown and known module. (The former is ill-formed.) // RUN: %clang_cc1 -std=c++1z -fmodules-ts -I%t -fmodule-file=%t/x.y.pcm -verify %s \ -// RUN: -DTEST=1 -DEXPORT= -DPARTITION= -DMODULE_NAME=z +// RUN: -DTEST=1 -DEXPORT= -DMODULE_NAME=z // RUN: %clang_cc1 -std=c++1z -fmodules-ts -I%t -fmodule-file=%t/x.y.pcm -verify %s \ -// RUN: -DTEST=2 -DEXPORT= -DPARTITION= -DMODULE_NAME=x +// RUN: -DTEST=2 -DEXPORT= -DMODULE_NAME=x // // Module interface for unknown and known module. (The latter is ill-formed due to // redefinition.) // RUN: %clang_cc1 -std=c++1z -fmodules-ts -I%t -fmodule-file=%t/x.y.pcm -verify %s \ -// RUN: -DTEST=3 -DEXPORT=export -DPARTITION= -DMODULE_NAME=z +// RUN: -DTEST=3 -DEXPORT=export -DMODULE_NAME=z // RUN: %clang_cc1 -std=c++1z -fmodules-ts -I%t -fmodule-file=%t/x.y.pcm -verify %s \ -// RUN: -DTEST=4 -DEXPORT=export -DPARTITION= -DMODULE_NAME=x -// -// Defining a module partition. -// RUN: %clang_cc1 -std=c++1z -fmodules-ts -I%t -fmodule-file=%t/x.y.pcm -verify %s \ -// RUN: -DTEST=5 -DEXPORT=export -DPARTITION=partition -DMODULE_NAME=z -// RUN: %clang_cc1 -std=c++1z -fmodules-ts -I%t -fmodule-file=%t/x.y.pcm -verify %s \ -// RUN: -DTEST=6 -DEXPORT= -DPARTITION=partition -DMODULE_NAME=z +// RUN: -DTEST=4 -DEXPORT=export -DMODULE_NAME=x // // Miscellaneous syntax. // RUN: %clang_cc1 -std=c++1z -fmodules-ts -I%t -fmodule-file=%t/x.y.pcm -verify %s \ -// RUN: -DTEST=7 -DEXPORT= -DPARTITION=elderberry -DMODULE_NAME=z +// RUN: -DTEST=7 -DEXPORT=export -DMODULE_NAME='z elderberry' // RUN: %clang_cc1 -std=c++1z -fmodules-ts -I%t -fmodule-file=%t/x.y.pcm -verify %s \ -// RUN: -DTEST=8 -DEXPORT=export -DPARTITION= -DMODULE_NAME='z [[]]' +// RUN: -DTEST=8 -DEXPORT=export -DMODULE_NAME='z [[]]' // RUN: %clang_cc1 -std=c++1z -fmodules-ts -I%t -fmodule-file=%t/x.y.pcm -verify %s \ -// RUN: -DTEST=9 -DEXPORT=export -DPARTITION= -DMODULE_NAME='z [[fancy]]' +// RUN: -DTEST=9 -DEXPORT=export -DMODULE_NAME='z [[fancy]]' // RUN: %clang_cc1 -std=c++1z -fmodules-ts -I%t -fmodule-file=%t/x.y.pcm -verify %s \ -// RUN: -DTEST=10 -DEXPORT=export -DPARTITION= -DMODULE_NAME='z [[maybe_unused]]' +// RUN: -DTEST=10 -DEXPORT=export -DMODULE_NAME='z [[maybe_unused]]' -EXPORT module PARTITION MODULE_NAME; +EXPORT module MODULE_NAME; #if TEST == 4 // expected-error@-2 {{redefinition of module 'x'}} // expected-note-re@module-declaration.cpp:* {{loaded from '{{.*[/\\]}}x.pcm'}} -#elif TEST == 6 -// expected-error@-5 {{module partition must be declared 'export'}} #elif TEST == 7 -// expected-error@-7 {{expected ';'}} expected-error@-7 {{requires a type specifier}} expected-error@-7 {{definition of module 'elderberry' is not available}} +// expected-error@-5 {{expected ';'}} expected-error@-5 {{requires a type specifier}} #elif TEST == 9 -// expected-warning@-9 {{unknown attribute 'fancy' ignored}} +// expected-warning@-7 {{unknown attribute 'fancy' ignored}} #elif TEST == 10 -// expected-error-re@-11 {{'maybe_unused' attribute cannot be applied to a module{{$}}}} +// expected-error-re@-9 {{'maybe_unused' attribute cannot be applied to a module{{$}}}} #elif TEST == 1 -// expected-error@-13 {{definition of module 'z' is not available}} +// expected-error@-11 {{definition of module 'z' is not available}} #else // expected-no-diagnostics #endif diff --git a/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1.cpp b/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1.cpp index 68f2570dd3..52f45f578d 100644 --- a/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1.cpp +++ b/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1.cpp @@ -10,7 +10,7 @@ // expected-no-diagnostics export module A; #elif IMPLEMENTATION -module A; +module A; // #module-decl #ifdef BUILT_AS_INTERFACE // expected-error@-2 {{missing 'export' specifier in module declaration while building module interface}} #define INTERFACE @@ -23,6 +23,9 @@ module A; #ifndef INTERFACE export int b; // expected-error {{export declaration can only be used within a module interface unit}} +#ifdef IMPLEMENTATION +// expected-note@#module-decl {{add 'export' here}} +#endif #else export int a; #endif |