diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-09-04 05:37:53 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-09-04 05:37:53 +0000 |
commit | dd8b5337e9da480640598008de6211dab68c20dc (patch) | |
tree | ec1b623d8e47e3bd3d256a9ac494e3cbd3f2a3c1 /clang/test/CXX/modules-ts/basic/basic.def.odr | |
parent | ebc165901682c0d9feb0c4490e5d9ffaee214983 (diff) | |
download | bcm5719-llvm-dd8b5337e9da480640598008de6211dab68c20dc.tar.gz bcm5719-llvm-dd8b5337e9da480640598008de6211dab68c20dc.zip |
Implement Itanium name mangling support for C++ Modules TS.
This follows the scheme agreed with Nathan Sidwell, which can be found here:
https://gcc.gnu.org/wiki/cxx-modules?action=AttachFile
This will be proposed to the itanium-cxx-abi list once we have some experience
with how well it works; the ABI for this TS should be considered unstable until
it is part of the Itanium C++ ABI.
llvm-svn: 312467
Diffstat (limited to 'clang/test/CXX/modules-ts/basic/basic.def.odr')
3 files changed, 23 insertions, 22 deletions
diff --git a/clang/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp b/clang/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp index dc6a3635a8e..83cad5cc9b2 100644 --- a/clang/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp +++ b/clang/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp @@ -4,15 +4,15 @@ // CHECK-DAG: @extern_var_exported = external global // FIXME: Should this be 'external global'? // CHECK-DAG: @inline_var_exported = linkonce_odr global -// CHECK-DAG: @_ZL19static_var_exported = external global +// CHECK-DAG: @_ZW6ModuleE19static_var_exported = external global // CHECK-DAG: @const_var_exported = external constant // // FIXME: The module name should be mangled into all of these. // CHECK-DAG: @extern_var_module_linkage = external global // FIXME: Should this be 'external global'? // CHECK-DAG: @inline_var_module_linkage = linkonce_odr global -// CHECK-DAG: @_ZL25static_var_module_linkage = external global -// CHECK-DAG: @_ZL24const_var_module_linkage = external constant +// CHECK-DAG: @_ZW6ModuleE25static_var_module_linkage = external global +// CHECK-DAG: @_ZW6ModuleE24const_var_module_linkage = external constant module Module; @@ -28,15 +28,13 @@ void use() { (void)&const_var_exported; // FIXME: This symbol should not be visible here. - // CHECK: declare {{.*}}@_ZL26used_static_module_linkagev + // CHECK: declare {{.*}}@_ZW6ModuleE26used_static_module_linkagev used_static_module_linkage(); - // FIXME: The module name should be mangled into the name of this function. - // CHECK: define linkonce_odr {{.*}}@_Z26used_inline_module_linkagev + // CHECK: define linkonce_odr {{.*}}@_ZW6ModuleE26used_inline_module_linkagev used_inline_module_linkage(); - // FIXME: The module name should be mangled into the name of this function. - // CHECK: declare {{.*}}@_Z24noninline_module_linkagev + // CHECK: declare {{.*}}@_ZW6ModuleE24noninline_module_linkagev noninline_module_linkage(); (void)&extern_var_module_linkage; diff --git a/clang/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm b/clang/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm index d452f741a0f..093ce235a75 100644 --- a/clang/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm +++ b/clang/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm @@ -11,7 +11,7 @@ // 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 global -// CHECK-DAG: @_ZL19static_var_exported = global +// CHECK-DAG: @_ZW6ModuleE19static_var_exported = global // CHECK-DAG: @const_var_exported = constant // // FIXME: The module name should be mangled into all of these. @@ -20,8 +20,8 @@ // 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_module_linkage = linkonce_odr global -// CHECK-DAG: @_ZL25static_var_module_linkage = global -// CHECK-DAG: @_ZL24const_var_module_linkage = constant +// CHECK-DAG: @_ZW6ModuleE25static_var_module_linkage = global +// CHECK-DAG: @_ZW6ModuleE24const_var_module_linkage = constant static void unused_static_global_module() {} static void used_static_global_module() {} @@ -57,9 +57,9 @@ 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 void {{.*}}@_ZL22unused_static_exportedv + // CHECK: define void {{.*}}@_ZW6ModuleE22unused_static_exportedv static void unused_static_exported() {} - // CHECK: define void {{.*}}@_ZL20used_static_exportedv + // CHECK: define void {{.*}}@_ZW6ModuleE20used_static_exportedv static void used_static_exported() {} inline void unused_inline_exported() {} @@ -88,11 +88,9 @@ export { // FIXME: Ideally we wouldn't emit this as its name is not visible outside this // TU, but this module interface might contain a template that can use this // function so we conservatively emit it for now. -// FIXME: The module name should be mangled into the name of this function. -// CHECK: define void {{.*}}@_ZL28unused_static_module_linkagev +// CHECK: define void {{.*}}@_ZW6ModuleE28unused_static_module_linkagev static void unused_static_module_linkage() {} -// FIXME: The module name should be mangled into the name of this function. -// CHECK: define void {{.*}}@_ZL26used_static_module_linkagev +// CHECK: define void {{.*}}@_ZW6ModuleE26used_static_module_linkagev static void used_static_module_linkage() {} inline void unused_inline_module_linkage() {} @@ -103,12 +101,10 @@ inline int inline_var_module_linkage; static int static_var_module_linkage; const int const_var_module_linkage = 3; -// FIXME: The module name should be mangled into the name of this function. -// CHECK: define void {{.*}}@_Z24noninline_module_linkagev +// CHECK: define void {{.*}}@_ZW6ModuleE24noninline_module_linkagev void noninline_module_linkage() { used_static_module_linkage(); - // FIXME: The module name should be mangled into the name of this function. - // CHECK: define linkonce_odr {{.*}}@_Z26used_inline_module_linkagev + // CHECK: define linkonce_odr {{.*}}@_ZW6ModuleE26used_inline_module_linkagev used_inline_module_linkage(); (void)&extern_var_module_linkage; @@ -116,3 +112,10 @@ void noninline_module_linkage() { (void)&static_var_module_linkage; (void)&const_var_module_linkage; } + +struct a { + struct b {}; + struct c {}; +}; +// CHECK: define void @_ZW6ModuleE1fW_0EN1a1bEW_0ENS_1cE( +void f(a::b, a::c) {} diff --git a/clang/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp b/clang/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp index f6e0238c6b4..ccbf222658c 100644 --- a/clang/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp +++ b/clang/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp @@ -5,7 +5,7 @@ // FIXME: Should this be 'external global'? // CHECK-DAG: @inline_var_exported = linkonce_odr global // FIXME: These should be 'extern global' and 'extern constant'. -// CHECK-DAG: @_ZL19static_var_exported = global +// CHECK-DAG: @_ZW6ModuleE19static_var_exported = global // CHECK-DAG: @const_var_exported = constant import Module; |