1 // RUN: %clang_cc1 -fmodules-ts %S/module.cppm -triple %itanium_abi_triple -emit-module-interface -o %t 2 // RUN: %clang_cc1 -fmodules-ts %s -triple %itanium_abi_triple -fmodule-file=%t -emit-llvm -o - | FileCheck %s --implicit-check-not=unused --implicit-check-not=global_module 3 4 // CHECK-DAG: @extern_var_exported = external {{(dso_local )?}}global 5 // CHECK-DAG: @inline_var_exported = linkonce_odr {{(dso_local )?}}global 6 // CHECK-DAG: @const_var_exported = available_externally {{(dso_local )?}}constant i32 3, 7 // 8 // CHECK-DAG: @_ZW6ModuleE25extern_var_module_linkage = external {{(dso_local )?}}global 9 // CHECK-DAG: @_ZW6ModuleE25inline_var_module_linkage = linkonce_odr {{(dso_local )?}}global 10 // CHECK-DAG: @_ZW6ModuleE25static_var_module_linkage = available_externally {{(dso_local )?}}global i32 0, 11 // CHECK-DAG: @_ZW6ModuleE24const_var_module_linkage = available_externally {{(dso_local )?}}constant i32 3, 12 13 module Module; 14 use()15void use() { 16 // CHECK: define linkonce_odr {{.*}}@_Z20used_inline_exportedv 17 used_inline_exported(); 18 // CHECK: declare {{.*}}@_Z18noninline_exportedv 19 noninline_exported(); 20 21 (void)&extern_var_exported; 22 (void)&inline_var_exported; 23 (void)&const_var_exported; 24 25 // FIXME: This symbol should not be visible here. 26 // CHECK: declare {{.*}}@_ZW6ModuleE26used_static_module_linkagev 27 used_static_module_linkage(); 28 29 // CHECK: define linkonce_odr {{.*}}@_ZW6ModuleE26used_inline_module_linkagev 30 used_inline_module_linkage(); 31 32 // CHECK: declare {{.*}}@_ZW6ModuleE24noninline_module_linkagev 33 noninline_module_linkage(); 34 35 (void)&extern_var_module_linkage; 36 (void)&inline_var_module_linkage; 37 (void)&static_var_module_linkage; // FIXME: Should not be visible here. 38 (void)&const_var_module_linkage; 39 } 40