r325940 - Bring r325915 back.

Rafael Espindola via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 23 11:30:49 PST 2018


Author: rafael
Date: Fri Feb 23 11:30:48 2018
New Revision: 325940

URL: http://llvm.org/viewvc/llvm-project?rev=325940&view=rev
Log:
Bring r325915 back.

The tests that failed on a windows host have been fixed.

Original message:

Start setting dso_local for COFF.

With this there are still some GVs where we don't set dso_local
because setGVProperties is never called. I intend to fix that in
followup commits. This is just the bare minimum to teach
shouldAssumeDSOLocal what it should do for COFF.

Modified:
    cfe/trunk/lib/CodeGen/CGDecl.cpp
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp
    cfe/trunk/lib/CodeGen/CodeGenModule.h
    cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
    cfe/trunk/test/CXX/dcl.dcl/dcl.link/p7.cpp
    cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp
    cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm
    cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp
    cfe/trunk/test/CodeGen/2004-03-07-ExternalConstant.c
    cfe/trunk/test/CodeGen/2008-07-21-mixed-var-fn-decl.c
    cfe/trunk/test/CodeGen/aarch64-varargs-ms.c
    cfe/trunk/test/CodeGen/attr-x86-interrupt.c
    cfe/trunk/test/CodeGen/blocks-windows.c
    cfe/trunk/test/CodeGen/builtins-ms.c
    cfe/trunk/test/CodeGen/builtins-overflow.c
    cfe/trunk/test/CodeGen/c-strings.c
    cfe/trunk/test/CodeGen/cfi-icall-cross-dso.c
    cfe/trunk/test/CodeGen/cfi-icall.c
    cfe/trunk/test/CodeGen/cfstring-windows.c
    cfe/trunk/test/CodeGen/decl.c
    cfe/trunk/test/CodeGen/dllexport.c
    cfe/trunk/test/CodeGen/dllimport.c
    cfe/trunk/test/CodeGen/dso-local-executable.c
    cfe/trunk/test/CodeGen/exceptions-seh-finally.c
    cfe/trunk/test/CodeGen/exceptions-seh-leave.c
    cfe/trunk/test/CodeGen/exceptions-seh.c
    cfe/trunk/test/CodeGen/ext-vector.c
    cfe/trunk/test/CodeGen/fixup-depth-overflow.c
    cfe/trunk/test/CodeGen/inline.c
    cfe/trunk/test/CodeGen/mangle-ms.c
    cfe/trunk/test/CodeGen/mangle-windows-rtd.c
    cfe/trunk/test/CodeGen/mangle-windows.c
    cfe/trunk/test/CodeGen/microsoft-call-conv-x64.c
    cfe/trunk/test/CodeGen/mingw-long-double.c
    cfe/trunk/test/CodeGen/ms-align-tentative.c
    cfe/trunk/test/CodeGen/ms-annotation.c
    cfe/trunk/test/CodeGen/ms-barriers-intrinsics.c
    cfe/trunk/test/CodeGen/ms-declspecs.c
    cfe/trunk/test/CodeGen/ms-declspecs.cpp
    cfe/trunk/test/CodeGen/ms-inline-asm-align.c
    cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c
    cfe/trunk/test/CodeGen/ms-intrinsics.c
    cfe/trunk/test/CodeGen/ms-setjmp.c
    cfe/trunk/test/CodeGen/ms-x86-intrinsics.c
    cfe/trunk/test/CodeGen/ms_abi.c
    cfe/trunk/test/CodeGen/ms_abi_aarch64.c
    cfe/trunk/test/CodeGen/ms_this.cpp
    cfe/trunk/test/CodeGen/no-common.c
    cfe/trunk/test/CodeGen/overloadable.c
    cfe/trunk/test/CodeGen/pgo-sample-thinlto-summary.c
    cfe/trunk/test/CodeGen/pr19841.cpp
    cfe/trunk/test/CodeGen/pr4349.c
    cfe/trunk/test/CodeGen/preserve-call-conv.c
    cfe/trunk/test/CodeGen/regcall.c
    cfe/trunk/test/CodeGen/tentative-decls.c
    cfe/trunk/test/CodeGen/variadic-null-win64.c
    cfe/trunk/test/CodeGen/vectorcall.c
    cfe/trunk/test/CodeGen/volatile-1.c
    cfe/trunk/test/CodeGen/windows-itanium.c
    cfe/trunk/test/CodeGen/windows-on-arm-dllimport-dllexport.c
    cfe/trunk/test/CodeGen/windows-struct-abi.c
    cfe/trunk/test/CodeGen/windows-swiftcall.c
    cfe/trunk/test/CodeGen/x86_32-arguments-win32.c
    cfe/trunk/test/CodeGen/x86_32-fpcc-struct-return.c
    cfe/trunk/test/CodeGen/x86_64-arguments-win32.c
    cfe/trunk/test/CodeGenCXX/PR19955.cpp
    cfe/trunk/test/CodeGenCXX/array-default-argument.cpp
    cfe/trunk/test/CodeGenCXX/atomic-dllexport.cpp
    cfe/trunk/test/CodeGenCXX/attr-x86-interrupt.cpp
    cfe/trunk/test/CodeGenCXX/captured-statements.cpp
    cfe/trunk/test/CodeGenCXX/const-base-cast.cpp
    cfe/trunk/test/CodeGenCXX/const-global-linkage.cpp
    cfe/trunk/test/CodeGenCXX/constructor-destructor-return-this.cpp
    cfe/trunk/test/CodeGenCXX/dllexport-alias.cpp
    cfe/trunk/test/CodeGenCXX/dllexport-ctor-closure.cpp
    cfe/trunk/test/CodeGenCXX/dllexport-dtor-thunks.cpp
    cfe/trunk/test/CodeGenCXX/dllexport-members.cpp
    cfe/trunk/test/CodeGenCXX/dllexport-ms-friend.cpp
    cfe/trunk/test/CodeGenCXX/dllexport-pr26549.cpp
    cfe/trunk/test/CodeGenCXX/dllexport-vtable-thunks.cpp
    cfe/trunk/test/CodeGenCXX/dllexport.cpp
    cfe/trunk/test/CodeGenCXX/dllimport-dtor-thunks.cpp
    cfe/trunk/test/CodeGenCXX/dllimport-members.cpp
    cfe/trunk/test/CodeGenCXX/dllimport-memptr-global.cpp
    cfe/trunk/test/CodeGenCXX/dllimport-rtti.cpp
    cfe/trunk/test/CodeGenCXX/dllimport.cpp
    cfe/trunk/test/CodeGenCXX/duplicate-mangled-name.cpp
    cfe/trunk/test/CodeGenCXX/exceptions-cxx-ehsc.cpp
    cfe/trunk/test/CodeGenCXX/exceptions-cxx-new.cpp
    cfe/trunk/test/CodeGenCXX/exceptions-seh-filter-captures.cpp
    cfe/trunk/test/CodeGenCXX/exceptions-seh.cpp
    cfe/trunk/test/CodeGenCXX/explicit-instantiation.cpp
    cfe/trunk/test/CodeGenCXX/extern-c.cpp
    cfe/trunk/test/CodeGenCXX/global-llvm-constant.cpp
    cfe/trunk/test/CodeGenCXX/homogeneous-aggregates.cpp
    cfe/trunk/test/CodeGenCXX/initializer-list-ctor-order.cpp
    cfe/trunk/test/CodeGenCXX/inline-dllexport-member.cpp
    cfe/trunk/test/CodeGenCXX/inline-functions.cpp
    cfe/trunk/test/CodeGenCXX/internal-linkage.cpp
    cfe/trunk/test/CodeGenCXX/mangle-abi-tag.cpp
    cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp
    cfe/trunk/test/CodeGenCXX/mangle-ms-md5.cpp
    cfe/trunk/test/CodeGenCXX/mangle-ms-templates-memptrs-2.cpp
    cfe/trunk/test/CodeGenCXX/mangle-ms-vector-types.cpp
    cfe/trunk/test/CodeGenCXX/mangle-ms.cpp
    cfe/trunk/test/CodeGenCXX/mangle-windows.cpp
    cfe/trunk/test/CodeGenCXX/member-function-pointer-calls.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-arg-order.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-array-cookies.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-sret.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-default-cc.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-catch.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-inlineasm.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-terminate.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-extern-template.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-methods.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-static-initializers.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-structors-alias.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-structors.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-thunks.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-try-throw.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-typeid.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-vmemptr-vbase.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-compatibility.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-inaccessible-base.cpp
    cfe/trunk/test/CodeGenCXX/microsoft-interface.cpp
    cfe/trunk/test/CodeGenCXX/mingw-new-abi.cpp
    cfe/trunk/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp
    cfe/trunk/test/CodeGenCXX/ms-eh-personality.cpp
    cfe/trunk/test/CodeGenCXX/ms-inline-asm-return.cpp
    cfe/trunk/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp
    cfe/trunk/test/CodeGenCXX/ms-integer-static-data-members.cpp
    cfe/trunk/test/CodeGenCXX/ms-property.cpp
    cfe/trunk/test/CodeGenCXX/ms-thread_local.cpp
    cfe/trunk/test/CodeGenCXX/naked.cpp
    cfe/trunk/test/CodeGenCXX/pr20897.cpp
    cfe/trunk/test/CodeGenCXX/pr27030.cpp
    cfe/trunk/test/CodeGenCXX/pr28360.cpp
    cfe/trunk/test/CodeGenCXX/pr30731.cpp
    cfe/trunk/test/CodeGenCXX/pr33080.cpp
    cfe/trunk/test/CodeGenCXX/pragma-init_seg.cpp
    cfe/trunk/test/CodeGenCXX/pragma-weak.cpp
    cfe/trunk/test/CodeGenCXX/reference-init.cpp
    cfe/trunk/test/CodeGenCXX/regcall.cpp
    cfe/trunk/test/CodeGenCXX/rtti-mingw64.cpp
    cfe/trunk/test/CodeGenCXX/runtime-dllstorage.cpp
    cfe/trunk/test/CodeGenCXX/sections.cpp
    cfe/trunk/test/CodeGenCXX/specialized-static-data-mem-init.cpp
    cfe/trunk/test/CodeGenCXX/trap-fnattr.cpp
    cfe/trunk/test/CodeGenCXX/type-metadata.cpp
    cfe/trunk/test/CodeGenCXX/ubsan-devirtualized-calls.cpp
    cfe/trunk/test/CodeGenCXX/ubsan-vtable-checks.cpp
    cfe/trunk/test/CodeGenCXX/unaligned-member-qualifier.cpp
    cfe/trunk/test/CodeGenCXX/uncopyable-args.cpp
    cfe/trunk/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp
    cfe/trunk/test/CodeGenCXX/virt-template-vtable.cpp
    cfe/trunk/test/CodeGenCXX/virtual-base-ctor.cpp
    cfe/trunk/test/CodeGenCXX/virtual-function-attrs.cpp
    cfe/trunk/test/CodeGenCXX/virtual-function-calls.cpp
    cfe/trunk/test/CodeGenCXX/volatile-1.cpp
    cfe/trunk/test/CodeGenCXX/vtable-assume-load.cpp
    cfe/trunk/test/CodeGenCXX/vtable-key-function-ios.cpp
    cfe/trunk/test/CodeGenCXX/vtable-key-function-win-comdat.cpp
    cfe/trunk/test/CodeGenCXX/weak-extern-typeinfo.cpp
    cfe/trunk/test/CodeGenCXX/windows-itanium-type-info.cpp
    cfe/trunk/test/CodeGenCoroutines/coro-promise-dtor.cpp
    cfe/trunk/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm
    cfe/trunk/test/CodeGenObjCXX/msabi-objc-types.mm
    cfe/trunk/test/CodeGenOpenCL/address-spaces.cl
    cfe/trunk/test/CodeGenOpenCL/kernel-attributes.cl
    cfe/trunk/test/CodeGenOpenCL/kernel-metadata.cl
    cfe/trunk/test/CodeGenOpenCL/str_literals.cl
    cfe/trunk/test/Modules/cxx-irgen.cpp
    cfe/trunk/test/OpenMP/for_private_codegen.cpp
    cfe/trunk/test/OpenMP/parallel_copyin_codegen.cpp
    cfe/trunk/test/OpenMP/parallel_private_codegen.cpp
    cfe/trunk/test/OpenMP/sections_private_codegen.cpp
    cfe/trunk/test/OpenMP/single_private_codegen.cpp
    cfe/trunk/test/PCH/cxx-required-decls.cpp
    cfe/trunk/test/PCH/pragma-weak.c
    cfe/trunk/test/PCH/uses-seh.cpp
    cfe/trunk/test/SemaCXX/typeid-ref.cpp

Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Fri Feb 23 11:30:48 2018
@@ -240,7 +240,6 @@ llvm::Constant *CodeGenModule::getOrCrea
       getModule(), LTy, Ty.isConstant(getContext()), Linkage, Init, Name,
       nullptr, llvm::GlobalVariable::NotThreadLocal, TargetAS);
   GV->setAlignment(getContext().getDeclAlign(&D).getQuantity());
-  setGVProperties(GV, &D);
 
   if (supportsCOMDAT() && GV->isWeakForLinker())
     GV->setComdat(TheModule.getOrInsertComdat(GV->getName()));
@@ -255,6 +254,8 @@ llvm::Constant *CodeGenModule::getOrCrea
       GV->setDLLStorageClass(llvm::GlobalVariable::DLLExportStorageClass);
   }
 
+  setGVProperties(GV, &D);
+
   // Make sure the result is of the correct type.
   LangAS ExpectedAS = Ty.getAddressSpace();
   llvm::Constant *Addr = GV;

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Fri Feb 23 11:30:48 2018
@@ -713,8 +713,20 @@ void CodeGenModule::setGlobalVisibility(
 
 static bool shouldAssumeDSOLocal(const CodeGenModule &CGM,
                                  llvm::GlobalValue *GV) {
+  // DLLImport explicitly marks the GV as external.
+  if (GV->hasDLLImportStorageClass())
+    return false;
+
   const llvm::Triple &TT = CGM.getTriple();
-  // Only handle ELF for now.
+  // Every other GV is local on COFF.
+  // Make an exception for windows OS in the triple: Some firmware builds use
+  // *-win32-macho triples. This (accidentally?) produced windows relocations
+  // without GOT tables in older clang versions; Keep this behaviour.
+  // FIXME: even thread local variables?
+  if (TT.isOSBinFormatCOFF() || (TT.isOSWindows() && TT.isOSBinFormatMachO()))
+    return true;
+
+  // Only handle COFF and ELF for now.
   if (!TT.isOSBinFormatELF())
     return false;
 

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.h?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.h Fri Feb 23 11:30:48 2018
@@ -723,6 +723,9 @@ public:
 
   void setDSOLocal(llvm::GlobalValue *GV) const;
 
+  /// Set visibility and dso_local.
+  /// This must be called after dllimport/dllexport is set.
+  /// FIXME: should this set dllimport/dllexport instead?
   void setGVProperties(llvm::GlobalValue *GV, const NamedDecl *D) const;
 
   /// Set the TLS mode for the given LLVM GlobalValue for the thread-local

Modified: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp Fri Feb 23 11:30:48 2018
@@ -1641,13 +1641,14 @@ llvm::GlobalVariable *ItaniumCXXABI::get
   VTable = CGM.CreateOrReplaceCXXRuntimeVariable(
       Name, VTableType, llvm::GlobalValue::ExternalLinkage);
   VTable->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
-  CGM.setGVProperties(VTable, RD);
 
   if (RD->hasAttr<DLLImportAttr>())
     VTable->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass);
   else if (RD->hasAttr<DLLExportAttr>())
     VTable->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass);
 
+  CGM.setGVProperties(VTable, RD);
+
   return VTable;
 }
 

Modified: cfe/trunk/test/CXX/dcl.dcl/dcl.link/p7.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/dcl.link/p7.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CXX/dcl.dcl/dcl.link/p7.cpp (original)
+++ cfe/trunk/test/CXX/dcl.dcl/dcl.link/p7.cpp Fri Feb 23 11:30:48 2018
@@ -2,10 +2,10 @@
 
 struct X { };
 
-// CHECK: @x1 = global %struct.X zeroinitializer
-// CHECK: @x4 = global %struct.X zeroinitializer
-// CHECK: @x2 = external global %struct.X
-// CHECK: @x3 = external global %struct.X
+// CHECK: @x1 = {{(dso_local )?}}global %struct.X zeroinitializer
+// CHECK: @x4 = {{(dso_local )?}}global %struct.X zeroinitializer
+// CHECK: @x2 = external {{(dso_local )?}}global %struct.X
+// CHECK: @x3 = external {{(dso_local )?}}global %struct.X
 extern "C" {
   X x1;
 }

Modified: cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp (original)
+++ cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp Fri Feb 23 11:30:48 2018
@@ -1,15 +1,15 @@
 // RUN: %clang_cc1 -fmodules-ts %S/module.cppm -triple %itanium_abi_triple -emit-module-interface -o %t
 // 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
 
-// CHECK-DAG: @extern_var_exported = external global
-// CHECK-DAG: @inline_var_exported = linkonce_odr global
-// CHECK-DAG: @_ZW6ModuleE19static_var_exported = available_externally global i32 0,
-// CHECK-DAG: @const_var_exported = available_externally constant i32 3,
+// 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 global
-// CHECK-DAG: @_ZW6ModuleE25inline_var_module_linkage = linkonce_odr global
-// CHECK-DAG: @_ZW6ModuleE25static_var_module_linkage = available_externally global i32 0,
-// CHECK-DAG: @_ZW6ModuleE24const_var_module_linkage = available_externally constant i32 3,
+// CHECK-DAG: @_ZW6ModuleE25extern_var_module_linkage = external {{(dso_local )?}}global
+// CHECK-DAG: @_ZW6ModuleE25inline_var_module_linkage = linkonce_odr {{(dso_local )?}}global
+// CHECK-DAG: @_ZW6ModuleE25static_var_module_linkage = available_externally {{(dso_local )?}}global i32 0,
+// CHECK-DAG: @_ZW6ModuleE24const_var_module_linkage = available_externally {{(dso_local )?}}constant i32 3,
 
 module Module;
 

Modified: cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm (original)
+++ cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm Fri Feb 23 11:30:48 2018
@@ -1,30 +1,30 @@
 // RUN: %clang_cc1 -fmodules-ts %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s --implicit-check-not unused_inline --implicit-check-not unused_stastic_global_module
 
-// CHECK-DAG: @extern_var_global_module = external global
-// CHECK-DAG: @inline_var_global_module = linkonce_odr global
+// CHECK-DAG: @extern_var_global_module = external {{(dso_local )?}}global
+// CHECK-DAG: @inline_var_global_module = linkonce_odr {{(dso_local )?}}global
 // CHECK-DAG: @_ZL24static_var_global_module = internal global
 // CHECK-DAG: @_ZL23const_var_global_module = internal constant
 //
 // For ABI compatibility, these symbols do not include the module name.
-// CHECK-DAG: @extern_var_exported = external global
+// CHECK-DAG: @extern_var_exported = external {{(dso_local )?}}global
 // FIXME: Should this be 'weak_odr global'? Presumably it must be, since we
 // 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: @_ZW6ModuleE19static_var_exported = global
-// CHECK-DAG: @const_var_exported = constant
+// 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 global
+// CHECK-DAG: @_ZW6ModuleE25extern_var_module_linkage = external {{(dso_local )?}}global
 // FIXME: Should this be 'weak_odr global'? Presumably it must be, since we
 // can discard this global and its initializer (if any), and other TUs are not
 // permitted to run the initializer for this variable.
-// CHECK-DAG: @_ZW6ModuleE25inline_var_module_linkage = linkonce_odr global
-// CHECK-DAG: @_ZW6ModuleE25static_var_module_linkage = global
-// CHECK-DAG: @_ZW6ModuleE24const_var_module_linkage = constant
+// CHECK-DAG: @_ZW6ModuleE25inline_var_module_linkage = linkonce_odr {{(dso_local )?}}global
+// CHECK-DAG: @_ZW6ModuleE25static_var_module_linkage = {{(dso_local )?}}global
+// CHECK-DAG: @_ZW6ModuleE24const_var_module_linkage = {{(dso_local )?}}constant
 //
-// CHECK-DAG: @_ZW6ModuleE25unused_var_module_linkage = global i32 4
-// CHECK-DAG: @_ZW6ModuleE32unused_static_var_module_linkage = global i32 5
-// CHECK-DAG: @_ZW6ModuleE31unused_const_var_module_linkage = constant i32 7
+// CHECK-DAG: @_ZW6ModuleE25unused_var_module_linkage = {{(dso_local )?}}global i32 4
+// CHECK-DAG: @_ZW6ModuleE32unused_static_var_module_linkage = {{(dso_local )?}}global i32 5
+// CHECK-DAG: @_ZW6ModuleE31unused_const_var_module_linkage = {{(dso_local )?}}constant i32 7
 
 static void unused_static_global_module() {}
 static void used_static_global_module() {}
@@ -37,7 +37,7 @@ inline int inline_var_global_module;
 static int static_var_global_module;
 const int const_var_global_module = 3;
 
-// CHECK: define void {{.*}}@_Z23noninline_global_modulev
+// CHECK: define {{(dso_local )?}}void {{.*}}@_Z23noninline_global_modulev
 void noninline_global_module() {
   // FIXME: This should be promoted to module linkage and given a
   // module-mangled name, if it's called from an inline function within
@@ -60,9 +60,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 {{.*}}@_ZW6ModuleE22unused_static_exportedv
+  // CHECK: define {{(dso_local )?}}void {{.*}}@_ZW6ModuleE22unused_static_exportedv
   static void unused_static_exported() {}
-  // CHECK: define void {{.*}}@_ZW6ModuleE20used_static_exportedv
+  // CHECK: define {{(dso_local )?}}void {{.*}}@_ZW6ModuleE20used_static_exportedv
   static void used_static_exported() {}
 
   inline void unused_inline_exported() {}
@@ -75,7 +75,7 @@ export {
   static int static_var_exported;
   const int const_var_exported = 3;
 
-  // CHECK: define void {{.*}}@_Z18noninline_exportedv
+  // CHECK: define {{(dso_local )?}}void {{.*}}@_Z18noninline_exportedv
   void noninline_exported() {
     used_static_exported();
     // CHECK: define linkonce_odr {{.*}}@_Z20used_inline_exportedv
@@ -91,9 +91,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.
-// CHECK: define void {{.*}}@_ZW6ModuleE28unused_static_module_linkagev
+// CHECK: define {{(dso_local )?}}void {{.*}}@_ZW6ModuleE28unused_static_module_linkagev
 static void unused_static_module_linkage() {}
-// CHECK: define void {{.*}}@_ZW6ModuleE26used_static_module_linkagev
+// CHECK: define {{(dso_local )?}}void {{.*}}@_ZW6ModuleE26used_static_module_linkagev
 static void used_static_module_linkage() {}
 
 inline void unused_inline_module_linkage() {}
@@ -104,7 +104,7 @@ inline int inline_var_module_linkage;
 static int static_var_module_linkage;
 const int const_var_module_linkage = 3;
 
-// CHECK: define void {{.*}}@_ZW6ModuleE24noninline_module_linkagev
+// CHECK: define {{(dso_local )?}}void {{.*}}@_ZW6ModuleE24noninline_module_linkagev
 void noninline_module_linkage() {
   used_static_module_linkage();
   // CHECK: define linkonce_odr {{.*}}@_ZW6ModuleE26used_inline_module_linkagev
@@ -125,5 +125,5 @@ struct a {
   struct b {};
   struct c {};
 };
-// CHECK: define void @_ZW6ModuleE1fW_0EN1a1bEW_0ENS_1cE(
+// CHECK: define {{(dso_local )?}}void @_ZW6ModuleE1fW_0EN1a1bEW_0ENS_1cE(
 void f(a::b, a::c) {}

Modified: cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp (original)
+++ cfe/trunk/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp Fri Feb 23 11:30:48 2018
@@ -1,10 +1,10 @@
 // RUN: %clang_cc1 -fmodules-ts %S/module.cppm -triple %itanium_abi_triple -emit-module-interface -o %t
 // 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
 
-// CHECK-DAG: @extern_var_exported = external global
-// CHECK-DAG: @inline_var_exported = linkonce_odr global
-// CHECK-DAG: @_ZW6ModuleE19static_var_exported = available_externally global i32 0
-// CHECK-DAG: @const_var_exported = available_externally constant i32 3
+// 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;
 

Modified: cfe/trunk/test/CodeGen/2004-03-07-ExternalConstant.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2004-03-07-ExternalConstant.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/2004-03-07-ExternalConstant.c (original)
+++ cfe/trunk/test/CodeGen/2004-03-07-ExternalConstant.c Fri Feb 23 11:30:48 2018
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1  %s -emit-llvm -o - | FileCheck %s
 
-// CHECK: @a = external constan
+// CHECK: @a = external {{(dso_local )?}}constan
 extern const int a[];   // 'a' should be marked constant even though it's external!
 int foo () {
   return a[0];

Modified: cfe/trunk/test/CodeGen/2008-07-21-mixed-var-fn-decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-07-21-mixed-var-fn-decl.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/2008-07-21-mixed-var-fn-decl.c (original)
+++ cfe/trunk/test/CodeGen/2008-07-21-mixed-var-fn-decl.c Fri Feb 23 11:30:48 2018
@@ -3,6 +3,6 @@
 int g0, f0();
 int f1(), g1;
 
-// CHECK: @g0 = common global i32 0, align 4
-// CHECK: @g1 = common global i32 0, align 4
+// CHECK: @g0 = common {{(dso_local )?}}global i32 0, align 4
+// CHECK: @g1 = common {{(dso_local )?}}global i32 0, align 4
 

Modified: cfe/trunk/test/CodeGen/aarch64-varargs-ms.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/aarch64-varargs-ms.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/aarch64-varargs-ms.c (original)
+++ cfe/trunk/test/CodeGen/aarch64-varargs-ms.c Fri Feb 23 11:30:48 2018
@@ -3,7 +3,7 @@
 #include <stdarg.h>
 
 int simple_int(va_list ap) {
-// CHECK-LABEL: define i32 @simple_int
+// CHECK-LABEL: define dso_local i32 @simple_int
   return va_arg(ap, int);
 // CHECK: [[ADDR:%[a-z_0-9]+]] = bitcast i8* %argp.cur to i32*
 // CHECK: [[RESULT:%[a-z_0-9]+]] = load i32, i32* [[ADDR]]

Modified: cfe/trunk/test/CodeGen/attr-x86-interrupt.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-x86-interrupt.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/attr-x86-interrupt.c (original)
+++ cfe/trunk/test/CodeGen/attr-x86-interrupt.c Fri Feb 23 11:30:48 2018
@@ -23,12 +23,12 @@ __attribute__((interrupt)) void foo8(int
 // X86_LINUX: "disable-tail-calls"="true"
 // X86_LINUX-NOT: "disable-tail-calls"="false"
 // X86_64_WIN: @llvm.used = appending global [2 x i8*] [i8* bitcast (void (i32*, i64)* @foo7 to i8*), i8* bitcast (void (i32*)* @foo8 to i8*)], section "llvm.metadata"
-// X86_64_WIN: define x86_intrcc void @foo7(i32* %{{.+}}, i64 %{{.+}})
-// X86_64_WIN: define x86_intrcc void @foo8(i32* %{{.+}})
+// X86_64_WIN: define dso_local x86_intrcc void @foo7(i32* %{{.+}}, i64 %{{.+}})
+// X86_64_WIN: define dso_local x86_intrcc void @foo8(i32* %{{.+}})
 // X86_64_Win: "disable-tail-calls"="true"
 // X86_64_Win-NOT: "disable-tail-calls"="false"
 // X86_WIN: @llvm.used = appending global [2 x i8*] [i8* bitcast (void (i32*, i32)* @foo7 to i8*), i8* bitcast (void (i32*)* @foo8 to i8*)], section "llvm.metadata"
-// X86_WIN: define x86_intrcc void @foo7(i32* %{{.+}}, i32 %{{.+}})
-// X86_WIN: define x86_intrcc void @foo8(i32* %{{.+}})
+// X86_WIN: define dso_local x86_intrcc void @foo7(i32* %{{.+}}, i32 %{{.+}})
+// X86_WIN: define dso_local x86_intrcc void @foo8(i32* %{{.+}})
 // X86_Win: "disable-tail-calls"="true"
 // X86_Win-NOT: "disable-tail-calls"="false"

Modified: cfe/trunk/test/CodeGen/blocks-windows.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/blocks-windows.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/blocks-windows.c (original)
+++ cfe/trunk/test/CodeGen/blocks-windows.c Fri Feb 23 11:30:48 2018
@@ -68,7 +68,7 @@ int (*g(void))(void) {
 }
 
 // CHECK-BLOCKS-IN-BLOCKS-DECL: @_NSConcreteStackBlock = external dllexport global i8*
-// CHECK-BLOCKS-IN-BLOCKS-DEFN: @_NSConcreteStackBlock = common dllexport global [5 x i32]
+// CHECK-BLOCKS-IN-BLOCKS-DEFN: @_NSConcreteStackBlock = common dso_local dllexport global [5 x i32]
 // CHECK-BLOCKS-NOT-IN-BLOCKS: @_NSConcreteStackBlock = external dllimport global i8*
 // CHECK-BLOCKS-NOT-IN-BLOCKS-EXTERN: @_NSConcreteStackBlock = external dllimport global i8*
 // CHECK-BLOCKS-NOT-IN-BLOCKS-EXTERN-DLLIMPORT: @_NSConcreteStackBlock = external dllimport global i8*

Modified: cfe/trunk/test/CodeGen/builtins-ms.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-ms.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins-ms.c (original)
+++ cfe/trunk/test/CodeGen/builtins-ms.c Fri Feb 23 11:30:48 2018
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 %s -emit-llvm -o - -fms-extensions -triple i686-pc-win32 | FileCheck %s
 
-// CHECK-LABEL: define void @test_alloca(
+// CHECK-LABEL: define dso_local void @test_alloca(
 void capture(void *);
 void test_alloca(int n) {
   capture(_alloca(n));
@@ -8,7 +8,7 @@ void test_alloca(int n) {
   // CHECK: call void @capture(i8* %[[arg]])
 }
 
-// CHECK-LABEL: define void @test_alloca_with_align(
+// CHECK-LABEL: define dso_local void @test_alloca_with_align(
 void test_alloca_with_align(int n) {
   capture(__builtin_alloca_with_align(n, 64));
   // CHECK: %[[arg:.*]] = alloca i8, i32 %{{.*}}, align 8

Modified: cfe/trunk/test/CodeGen/builtins-overflow.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-overflow.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins-overflow.c (original)
+++ cfe/trunk/test/CodeGen/builtins-overflow.c Fri Feb 23 11:30:48 2018
@@ -14,7 +14,7 @@ extern long long LongLongErrorCode;
 void overflowed(void);
 
 unsigned test_add_overflow_uint_uint_uint(unsigned x, unsigned y) {
-  // CHECK-LABEL: define i32 @test_add_overflow_uint_uint_uint
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_add_overflow_uint_uint_uint
   // CHECK-NOT: ext
   // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
   // CHECK-DAG: [[Q:%.+]] = extractvalue { i32, i1 } [[S]], 0
@@ -28,7 +28,7 @@ unsigned test_add_overflow_uint_uint_uin
 }
 
 int test_add_overflow_int_int_int(int x, int y) {
-  // CHECK-LABEL: define i32 @test_add_overflow_int_int_int
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_add_overflow_int_int_int
   // CHECK-NOT: ext
   // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
   // CHECK-DAG: [[C:%.+]] = extractvalue { i32, i1 } [[S]], 1
@@ -42,7 +42,7 @@ int test_add_overflow_int_int_int(int x,
 }
 
 unsigned test_sub_overflow_uint_uint_uint(unsigned x, unsigned y) {
-  // CHECK-LABEL: define i32 @test_sub_overflow_uint_uint_uint
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_sub_overflow_uint_uint_uint
   // CHECK-NOT: ext
   // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.usub.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
   // CHECK-DAG: [[Q:%.+]] = extractvalue { i32, i1 } [[S]], 0
@@ -56,7 +56,7 @@ unsigned test_sub_overflow_uint_uint_uin
 }
 
 int test_sub_overflow_int_int_int(int x, int y) {
-  // CHECK-LABEL: define i32 @test_sub_overflow_int_int_int
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_sub_overflow_int_int_int
   // CHECK-NOT: ext
   // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
   // CHECK-DAG: [[C:%.+]] = extractvalue { i32, i1 } [[S]], 1
@@ -70,7 +70,7 @@ int test_sub_overflow_int_int_int(int x,
 }
 
 unsigned test_mul_overflow_uint_uint_uint(unsigned x, unsigned y) {
-  // CHECK-LABEL: define i32 @test_mul_overflow_uint_uint_uint
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_uint_uint_uint
   // CHECK-NOT: ext
   // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
   // CHECK-DAG: [[Q:%.+]] = extractvalue { i32, i1 } [[S]], 0
@@ -84,7 +84,7 @@ unsigned test_mul_overflow_uint_uint_uin
 }
 
 int test_mul_overflow_int_int_int(int x, int y) {
-  // CHECK-LABEL: define i32 @test_mul_overflow_int_int_int
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_int_int_int
   // CHECK-NOT: ext
   // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
   // CHECK-DAG: [[C:%.+]] = extractvalue { i32, i1 } [[S]], 1
@@ -98,7 +98,7 @@ int test_mul_overflow_int_int_int(int x,
 }
 
 int test_add_overflow_uint_int_int(unsigned x, int y) {
-  // CHECK-LABEL: define i32 @test_add_overflow_uint_int_int
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_add_overflow_uint_int_int
   // CHECK: [[XE:%.+]] = zext i32 %{{.+}} to i33
   // CHECK: [[YE:%.+]] = sext i32 %{{.+}} to i33
   // CHECK: [[S:%.+]] = call { i33, i1 } @llvm.sadd.with.overflow.i33(i33 [[XE]], i33 [[YE]])
@@ -136,7 +136,7 @@ _Bool test_add_overflow_uint_uint_bool(u
 }
 
 unsigned test_add_overflow_bool_bool_uint(_Bool x, _Bool y) {
-  // CHECK-LABEL: define i32 @test_add_overflow_bool_bool_uint
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_add_overflow_bool_bool_uint
   // CHECK: [[XE:%.+]] = zext i1 %{{.+}} to i32
   // CHECK: [[YE:%.+]] = zext i1 %{{.+}} to i32
   // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 [[XE]], i32 [[YE]])
@@ -165,7 +165,7 @@ _Bool test_add_overflow_bool_bool_bool(_
 }
 
 int test_add_overflow_volatile(int x, int y) {
-  // CHECK-LABEL: define i32 @test_add_overflow_volatile
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_add_overflow_volatile
   // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
   // CHECK-DAG: [[Q:%.+]] = extractvalue { i32, i1 } [[S]], 0
   // CHECK-DAG: [[C:%.+]] = extractvalue { i32, i1 } [[S]], 1

Modified: cfe/trunk/test/CodeGen/c-strings.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/c-strings.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/c-strings.c (original)
+++ cfe/trunk/test/CodeGen/c-strings.c Fri Feb 23 11:30:48 2018
@@ -4,7 +4,7 @@
 // Should be 3 hello strings, two global (of different sizes), the rest are
 // shared.
 
-// CHECK: @align = global i8 [[ALIGN:[0-9]+]]
+// CHECK: @align = {{(dso_local )?}}global i8 [[ALIGN:[0-9]+]]
 // ITANIUM: @.str = private unnamed_addr constant [6 x i8] c"hello\00"
 // MSABI: @"\01??_C at _05CJBACGMB@hello?$AA@" = linkonce_odr unnamed_addr constant [6 x i8] c"hello\00", comdat, align 1
 // ITANIUM: @f1.x = internal global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0)
@@ -13,7 +13,7 @@
 // CHECK: @f3.x = internal global [8 x i8] c"hello\00\00\00", align [[ALIGN]]
 // ITANIUM: @f4.x = internal global %struct.s { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0) }
 // MSABI: @f4.x = internal global %struct.s { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @"\01??_C at _05CJBACGMB@hello?$AA@", i32 0, i32 0) }
-// CHECK: @x = global [3 x i8] c"ola", align [[ALIGN]]
+// CHECK: @x = {{(dso_local )?}}global [3 x i8] c"ola", align [[ALIGN]]
 
 // XFAIL: hexagon
 // Hexagon aligns arrays of size 8+ bytes to a 64-bit boundary, which

Modified: cfe/trunk/test/CodeGen/cfi-icall-cross-dso.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/cfi-icall-cross-dso.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/cfi-icall-cross-dso.c (original)
+++ cfe/trunk/test/CodeGen/cfi-icall-cross-dso.c Fri Feb 23 11:30:48 2018
@@ -49,7 +49,7 @@ void caller(void (*f)()) {
 // CHECK: define internal void @g({{.*}} !type [[TVOID:![0-9]+]] !type [[TVOID_GENERALIZED:![0-9]+]] !type [[TVOID_ID:![0-9]+]]
 static void g(void) {}
 
-// CHECK: declare void @h({{[^!]*$}}
+// CHECK: declare {{(dso_local )?}}void @h({{[^!]*$}}
 void h(void);
 
 typedef void (*Fn)(void);
@@ -60,9 +60,9 @@ Fn h1() {
   return &h;
 }
 
-// CHECK: define void @bar({{.*}} !type [[TNOPROTO:![0-9]+]] !type [[TNOPROTO_GENERALIZED:![0-9]+]] !type [[TNOPROTO_ID:![0-9]+]]
+// CHECK: define {{(dso_local )?}}void @bar({{.*}} !type [[TNOPROTO:![0-9]+]] !type [[TNOPROTO_GENERALIZED:![0-9]+]] !type [[TNOPROTO_ID:![0-9]+]]
 // ITANIUM: define available_externally void @foo({{[^!]*$}}
-// MS: define linkonce_odr void @foo({{.*}} !type [[TNOPROTO]] !type [[TNOPROTO_GENERALIZED:![0-9]+]] !type [[TNOPROTO_ID]]
+// MS: define linkonce_odr dso_local void @foo({{.*}} !type [[TNOPROTO]] !type [[TNOPROTO_GENERALIZED:![0-9]+]] !type [[TNOPROTO_ID]]
 inline void foo() {}
 void bar() { foo(); }
 

Modified: cfe/trunk/test/CodeGen/cfi-icall.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/cfi-icall.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/cfi-icall.c (original)
+++ cfe/trunk/test/CodeGen/cfi-icall.c Fri Feb 23 11:30:48 2018
@@ -3,20 +3,20 @@
 
 // Tests that we assign appropriate identifiers to unprototyped functions.
 
-// CHECK: define void @f({{.*}} !type [[TVOID:![0-9]+]] !type [[TVOID_GENERALIZED:![0-9]+]]
+// CHECK: define {{(dso_local )?}}void @f({{.*}} !type [[TVOID:![0-9]+]] !type [[TVOID_GENERALIZED:![0-9]+]]
 void f() {
 }
 
 void xf();
 
-// CHECK: define void @g({{.*}} !type [[TINT:![0-9]+]] !type [[TINT_GENERALIZED:![0-9]+]]
+// CHECK: define {{(dso_local )?}}void @g({{.*}} !type [[TINT:![0-9]+]] !type [[TINT_GENERALIZED:![0-9]+]]
 void g(int b) {
   void (*fp)() = b ? f : xf;
   // ITANIUM: call i1 @llvm.type.test(i8* {{.*}}, metadata !"_ZTSFvE")
   fp();
 }
 
-// CHECK: declare !type [[TVOID]] !type [[TVOID_GENERALIZED]] void @xf({{.*}}
+// CHECK: declare !type [[TVOID]] !type [[TVOID_GENERALIZED]] {{(dso_local )?}}void @xf({{.*}}
 
 // ITANIUM-DAG: [[TVOID]] = !{i64 0, !"_ZTSFvE"}
 // ITANIUM-DAG: [[TVOID_GENERALIZED]] = !{i64 0, !"_ZTSFvE.generalized"}

Modified: cfe/trunk/test/CodeGen/cfstring-windows.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/cfstring-windows.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/cfstring-windows.c (original)
+++ cfe/trunk/test/CodeGen/cfstring-windows.c Fri Feb 23 11:30:48 2018
@@ -32,7 +32,7 @@ typedef struct __CFString *CFStringRef;
 const CFStringRef string = (CFStringRef)__builtin___CFStringMakeConstantString("string");
 
 // CHECK-CF-IN-CF-DECL: @__CFConstantStringClassReference = external dllexport global [0 x i32]
-// CHECK-CF-IN-CF-DEFN: @__CFConstantStringClassReference = common dllexport global [32 x i32]
+// CHECK-CF-IN-CF-DEFN: @__CFConstantStringClassReference = common dso_local dllexport global [32 x i32]
 // CHECK-CF: @__CFConstantStringClassReference = external dllimport global [0 x i32]
 // CHECK-CF-EXTERN: @__CFConstantStringClassReference = external dllimport global [0 x i32]
 // CHECK-CF-EXTERN-DLLIMPORT: @__CFConstantStringClassReference = external dllimport global [0 x i32]

Modified: cfe/trunk/test/CodeGen/decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/decl.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/decl.c (original)
+++ cfe/trunk/test/CodeGen/decl.c Fri Feb 23 11:30:48 2018
@@ -2,12 +2,12 @@
 
 // CHECK: @test1.x = internal constant [12 x i32] [i32 1
 // CHECK: @test2.x = private unnamed_addr constant [13 x i32] [i32 1,
-// CHECK: @test5w = global { i32, [4 x i8] } { i32 2, [4 x i8] undef }
-// CHECK: @test5y = global { double } { double 7.300000e+0{{[0]*}}1 }
+// CHECK: @test5w = {{(dso_local )?}}global { i32, [4 x i8] } { i32 2, [4 x i8] undef }
+// CHECK: @test5y = {{(dso_local )?}}global { double } { double 7.300000e+0{{[0]*}}1 }
 
 // CHECK: @test6.x = private unnamed_addr constant %struct.SelectDest { i8 1, i8 2, i32 3, i32 0 }
 
-// CHECK: @test7 = global [2 x %struct.test7s] [%struct.test7s { i32 1, i32 2 }, %struct.test7s { i32 4, i32 0 }]
+// CHECK: @test7 = {{(dso_local )?}}global [2 x %struct.test7s] [%struct.test7s { i32 1, i32 2 }, %struct.test7s { i32 4, i32 0 }]
 
 void test1() {
   // This should codegen as a "@test1.x" global.

Modified: cfe/trunk/test/CodeGen/dllexport.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/dllexport.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/dllexport.c (original)
+++ cfe/trunk/test/CodeGen/dllexport.c Fri Feb 23 11:30:48 2018
@@ -14,24 +14,24 @@
 __declspec(dllexport) extern int ExternGlobalDecl;
 
 // dllexport implies a definition.
-// CHECK-DAG: @GlobalDef = common dllexport global i32 0, align 4
+// CHECK-DAG: @GlobalDef = common dso_local dllexport global i32 0, align 4
 __declspec(dllexport) int GlobalDef;
 
 // Export definition.
-// CHECK-DAG: @GlobalInit = dllexport global i32 1, align 4
+// CHECK-DAG: @GlobalInit = dso_local dllexport global i32 1, align 4
 __declspec(dllexport) int GlobalInit = 1;
 
 // Declare, then export definition.
-// CHECK-DAG: @GlobalDeclInit = dllexport global i32 1, align 4
+// CHECK-DAG: @GlobalDeclInit = dso_local dllexport global i32 1, align 4
 __declspec(dllexport) extern int GlobalDeclInit;
 int GlobalDeclInit = 1;
 
 // Redeclarations
-// CHECK-DAG: @GlobalRedecl1 = common dllexport global i32 0, align 4
+// CHECK-DAG: @GlobalRedecl1 = common dso_local dllexport global i32 0, align 4
 __declspec(dllexport) extern int GlobalRedecl1;
 __declspec(dllexport)        int GlobalRedecl1;
 
-// CHECK-DAG: @GlobalRedecl2 = common dllexport global i32 0, align 4
+// CHECK-DAG: @GlobalRedecl2 = common dso_local dllexport global i32 0, align 4
 __declspec(dllexport) extern int GlobalRedecl2;
                              int GlobalRedecl2;
 
@@ -44,22 +44,22 @@ __declspec(dllexport) extern int GlobalR
 // Declarations are not exported.
 
 // Export function definition.
-// CHECK-DAG: define dllexport void @def()
+// CHECK-DAG: define dso_local dllexport void @def()
 __declspec(dllexport) void def(void) {}
 
 // Export inline function.
-// CHECK-DAG: define weak_odr dllexport void @inlineFunc()
-// CHECK-DAG: define weak_odr dllexport void @externInlineFunc()
+// CHECK-DAG: define weak_odr dso_local dllexport void @inlineFunc()
+// CHECK-DAG: define weak_odr dso_local dllexport void @externInlineFunc()
 __declspec(dllexport) inline void inlineFunc(void) {}
 __declspec(dllexport) inline void externInlineFunc(void) {}
 extern void externInlineFunc(void);
 
 // Redeclarations
-// CHECK-DAG: define dllexport void @redecl1()
+// CHECK-DAG: define dso_local dllexport void @redecl1()
 __declspec(dllexport) void redecl1(void);
 __declspec(dllexport) void redecl1(void) {}
 
-// CHECK-DAG: define dllexport void @redecl2()
+// CHECK-DAG: define dso_local dllexport void @redecl2()
 __declspec(dllexport) void redecl2(void);
                       void redecl2(void) {}
 
@@ -70,46 +70,46 @@ __declspec(dllexport) void redecl2(void)
 //===----------------------------------------------------------------------===//
 
 // dllexport takes precedence over the dllimport if both are specified.
-// CHECK-DAG: @PrecedenceGlobal1A = common dllexport global i32 0, align 4
-// CHECK-DAG: @PrecedenceGlobal1B = common dllexport global i32 0, align 4
+// CHECK-DAG: @PrecedenceGlobal1A = common dso_local dllexport global i32 0, align 4
+// CHECK-DAG: @PrecedenceGlobal1B = common dso_local dllexport global i32 0, align 4
 __attribute__((dllimport, dllexport))       int PrecedenceGlobal1A;
 __declspec(dllimport) __declspec(dllexport) int PrecedenceGlobal1B;
 
-// CHECK-DAG: @PrecedenceGlobal2A = common dllexport global i32 0, align 4
-// CHECK-DAG: @PrecedenceGlobal2B = common dllexport global i32 0, align 4
+// CHECK-DAG: @PrecedenceGlobal2A = common dso_local dllexport global i32 0, align 4
+// CHECK-DAG: @PrecedenceGlobal2B = common dso_local dllexport global i32 0, align 4
 __attribute__((dllexport, dllimport))       int PrecedenceGlobal2A;
 __declspec(dllexport) __declspec(dllimport) int PrecedenceGlobal2B;
 
-// CHECK-DAG: @PrecedenceGlobalRedecl1 = dllexport global i32 0, align 4
+// CHECK-DAG: @PrecedenceGlobalRedecl1 = dso_local dllexport global i32 0, align 4
 __declspec(dllexport) extern int PrecedenceGlobalRedecl1;
 __declspec(dllimport)        int PrecedenceGlobalRedecl1 = 0;
 
-// CHECK-DAG: @PrecedenceGlobalRedecl2 = common dllexport global i32 0, align 4
+// CHECK-DAG: @PrecedenceGlobalRedecl2 = common dso_local dllexport global i32 0, align 4
 __declspec(dllimport) extern int PrecedenceGlobalRedecl2;
 __declspec(dllexport)        int PrecedenceGlobalRedecl2;
 
-// CHECK-DAG: @PrecedenceGlobalMixed1 = dllexport global i32 1, align 4
+// CHECK-DAG: @PrecedenceGlobalMixed1 = dso_local dllexport global i32 1, align 4
 __attribute__((dllexport)) extern int PrecedenceGlobalMixed1;
 __declspec(dllimport)             int PrecedenceGlobalMixed1 = 1;
 
-// CHECK-DAG: @PrecedenceGlobalMixed2 = common dllexport global i32 0, align 4
+// CHECK-DAG: @PrecedenceGlobalMixed2 = common dso_local dllexport global i32 0, align 4
 __attribute__((dllimport)) extern int PrecedenceGlobalMixed2;
 __declspec(dllexport)             int PrecedenceGlobalMixed2;
 
-// CHECK-DAG: define dllexport void @precedence1A()
-// CHECK-DAG: define dllexport void @precedence1B()
+// CHECK-DAG: define dso_local dllexport void @precedence1A()
+// CHECK-DAG: define dso_local dllexport void @precedence1B()
 void __attribute__((dllimport, dllexport))       precedence1A(void) {}
 void __declspec(dllimport) __declspec(dllexport) precedence1B(void) {}
 
-// CHECK-DAG: define dllexport void @precedence2A()
-// CHECK-DAG: define dllexport void @precedence2B()
+// CHECK-DAG: define dso_local dllexport void @precedence2A()
+// CHECK-DAG: define dso_local dllexport void @precedence2B()
 void __attribute__((dllexport, dllimport))       precedence2A(void) {}
 void __declspec(dllexport) __declspec(dllimport) precedence2B(void) {}
 
-// CHECK-DAG: define dllexport void @precedenceRedecl1()
+// CHECK-DAG: define dso_local dllexport void @precedenceRedecl1()
 void __declspec(dllimport) precedenceRedecl1(void);
 void __declspec(dllexport) precedenceRedecl1(void) {}
 
-// CHECK-DAG: define dllexport void @precedenceRedecl2()
+// CHECK-DAG: define dso_local dllexport void @precedenceRedecl2()
 void __declspec(dllexport) precedenceRedecl2(void);
 void __declspec(dllimport) precedenceRedecl2(void) {}

Modified: cfe/trunk/test/CodeGen/dllimport.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/dllimport.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/dllimport.c (original)
+++ cfe/trunk/test/CodeGen/dllimport.c Fri Feb 23 11:30:48 2018
@@ -39,14 +39,14 @@ USEVAR(GlobalRedecl2)
 
 // NB: MSVC issues a warning and makes GlobalRedecl3 dllexport. We follow GCC
 // and drop the dllimport with a warning.
-// CHECK: @GlobalRedecl3 = external global i32
+// CHECK: @GlobalRedecl3 = external dso_local global i32
 __declspec(dllimport) extern int GlobalRedecl3;
                       extern int GlobalRedecl3; // dllimport ignored
 USEVAR(GlobalRedecl3)
 
 // Make sure this works even if the decl has been used before it's defined (PR20792).
-// MS: @GlobalRedecl4 = common dllexport global i32
-// GNU: @GlobalRedecl4 = common global i32
+// MS: @GlobalRedecl4 = common dso_local dllexport global i32
+// GNU: @GlobalRedecl4 = common dso_local global i32
 __declspec(dllimport) extern int GlobalRedecl4;
 USEVAR(GlobalRedecl4)
                       int GlobalRedecl4; // dllimport ignored
@@ -76,22 +76,22 @@ int functionScope() {
 __declspec(dllimport) void decl(void);
 
 // Initialize use_decl with the address of the thunk.
-// CHECK-DAG: @use_decl = global void ()* @decl
+// CHECK-DAG: @use_decl = dso_local global void ()* @decl
 void (*use_decl)(void) = &decl;
 
 // Import inline function.
 // MS-DAG: declare dllimport void @inlineFunc()
 // MO1-DAG: define available_externally dllimport void @inlineFunc()
-// GNU-DAG: declare void @inlineFunc()
-// GO1-DAG: define available_externally void @inlineFunc()
+// GNU-DAG: declare dso_local void @inlineFunc()
+// GO1-DAG: define available_externally dso_local void @inlineFunc()
 __declspec(dllimport) inline void inlineFunc(void) {}
 USE(inlineFunc)
 
 // inline attributes
 // MS-DAG: declare dllimport void @noinline()
 // MO1-DAG: define available_externally dllimport void @noinline()
-// GNU-DAG: declare void @noinline()
-// GO1-DAG: define available_externally void @noinline()
+// GNU-DAG: declare dso_local void @noinline()
+// GO1-DAG: define available_externally dso_local void @noinline()
 // CHECK-NOT: @alwaysInline()
 // O1-NOT: @alwaysInline()
 __declspec(dllimport) __attribute__((noinline)) inline void noinline(void) {}
@@ -107,20 +107,20 @@ USE(redecl1)
 
 // NB: MSVC issues a warning and makes redecl2/redecl3 dllexport. We follow GCC
 // and drop the dllimport with a warning.
-// CHECK-DAG: declare void @redecl2()
+// CHECK-DAG: declare dso_local void @redecl2()
 __declspec(dllimport) void redecl2(void);
                       void redecl2(void);
 USE(redecl2)
 
-// MS: define dllexport void @redecl3()
-// GNU: define void @redecl3()
+// MS: define dso_local dllexport void @redecl3()
+// GNU: define dso_local void @redecl3()
 __declspec(dllimport) void redecl3(void);
                       void redecl3(void) {} // dllimport ignored
 USE(redecl3)
 
 // Make sure this works even if the decl is used before it's defined (PR20792).
-// MS: define dllexport void @redecl4()
-// GNU: define void @redecl4()
+// MS: define dso_local dllexport void @redecl4()
+// GNU: define dso_local void @redecl4()
 __declspec(dllimport) void redecl4(void);
 USE(redecl4)
                       void redecl4(void) {} // dllimport ignored

Modified: cfe/trunk/test/CodeGen/dso-local-executable.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/dso-local-executable.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/dso-local-executable.c (original)
+++ cfe/trunk/test/CodeGen/dso-local-executable.c Fri Feb 23 11:30:48 2018
@@ -1,3 +1,14 @@
+// RUN: %clang_cc1 -triple x86_64-pc-win32 -emit-llvm %s -o - | FileCheck --check-prefix=COFF %s
+// COFF-DAG: @bar = external dso_local global i32
+// COFF-DAG: @weak_bar = extern_weak dso_local global i32
+// COFF-DAG: declare dso_local void @foo()
+// COFF-DAG: @baz = dso_local global i32 42
+// COFF-DAG: define dso_local i32* @zed()
+// COFF-DAG: @thread_var = external dso_local thread_local global i32
+// COFF-DAG: @local_thread_var = dso_local thread_local global i32 42
+// COFF-DAG: @import_var = external dllimport global i32
+// COFF-DAG: declare dllimport void @import_func()
+
 // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -mrelocation-model static %s -o - | FileCheck --check-prefix=STATIC %s
 // STATIC-DAG: @bar = external dso_local global i32
 // STATIC-DAG: @weak_bar = extern_weak dso_local global i32
@@ -6,6 +17,8 @@
 // STATIC-DAG: define dso_local i32* @zed()
 // STATIC-DAG: @thread_var = external thread_local global i32
 // STATIC-DAG: @local_thread_var = dso_local thread_local global i32 42
+// STATIC-DAG: @import_var = external dso_local global i32
+// STATIC-DAG: declare dso_local void @import_func()
 
 // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -pic-is-pie -mpie-copy-relocations %s -o - | FileCheck --check-prefix=PIE-COPY %s
 // PIE-COPY-DAG: @bar = external dso_local global i32
@@ -15,6 +28,8 @@
 // PIE-COPY-DAG: define dso_local i32* @zed()
 // PIE-COPY-DAG: @thread_var = external thread_local global i32
 // PIE-COPY-DAG: @local_thread_var = dso_local thread_local global i32 42
+// PIE-COPY-DAG: @import_var = external dso_local global i32
+// PIE-COPY-DAG: declare void @import_func()
 
 // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -pic-is-pie %s -o - | FileCheck --check-prefix=PIE %s
 // PIE-DAG: @bar = external global i32
@@ -24,6 +39,8 @@
 // PIE-DAG: define dso_local i32* @zed()
 // PIE-DAG: @thread_var = external thread_local global i32
 // PIE-DAG: @local_thread_var = dso_local thread_local global i32 42
+// PIE-DAG: @import_var = external global i32
+// PIE-DAG: declare void @import_func()
 
 // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -mrelocation-model static -fno-plt %s -o - | FileCheck --check-prefix=NOPLT %s
 // NOPLT-DAG: @bar = external dso_local global i32
@@ -33,6 +50,8 @@
 // NOPLT-DAG: define dso_local i32* @zed()
 // NOPLT-DAG: @thread_var = external thread_local global i32
 // NOPLT-DAG: @local_thread_var = dso_local thread_local global i32 42
+// NOPLT-DAG: @import_var = external dso_local global i32
+// NOPLT-DAG: declare void @import_func()
 
 // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -fno-plt -pic-is-pie -mpie-copy-relocations %s -o - | FileCheck --check-prefix=PIE-COPY-NOPLT %s
 // PIE-COPY-NOPLT-DAG: @bar = external dso_local global i32
@@ -42,6 +61,8 @@
 // PIE-COPY-NOPLT-DAG: define dso_local i32* @zed()
 // PIE-COPY-NOPLT-DAG: @thread_var = external thread_local global i32
 // PIE-COPY-NOPLT-DAG: @local_thread_var = dso_local thread_local global i32 42
+// PIE-COPY-NOPLT-DAG: @import_var = external dso_local global i32
+// PIE-COPY-NOPLT-DAG: declare void @import_func()
 
 // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -pic-is-pie -fno-plt %s -o - | FileCheck --check-prefix=PIE-NO-PLT %s
 // RUN: %clang_cc1 -triple powerpc64le-pc-linux -emit-llvm -mrelocation-model static %s -o - | FileCheck --check-prefix=PIE-NO-PLT %s
@@ -52,6 +73,8 @@
 // PIE-NO-PLT-DAG: define dso_local i32* @zed()
 // PIE-NO-PLT-DAG: @thread_var = external thread_local global i32
 // PIE-NO-PLT-DAG: @local_thread_var = dso_local thread_local global i32 42
+// PIE-NO-PLT-DAG: @import_var = external global i32
+// PIE-NO-PLT-DAG: declare void @import_func()
 
 // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm %s -o - | FileCheck --check-prefix=SHARED %s
 // SHARED-DAG: @bar = external global i32
@@ -61,6 +84,16 @@
 // SHARED-DAG: define i32* @zed()
 // SHARED-DAG: @thread_var = external thread_local global i32
 // SHARED-DAG: @local_thread_var = thread_local global i32 42
+// PIE-NO-PLT-DAG: @import_var = external global i32
+// PIE-NO-PLT-DAG: declare void @import_func()
+
+__attribute__((dllimport)) extern int import_var;
+__attribute__((dllimport)) void import_func(void);
+
+int *use_import() {
+  import_func();
+  return &import_var;
+}
 
 extern int bar;
 __attribute__((weak)) extern int weak_bar;

Modified: cfe/trunk/test/CodeGen/exceptions-seh-finally.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/exceptions-seh-finally.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/exceptions-seh-finally.c (original)
+++ cfe/trunk/test/CodeGen/exceptions-seh-finally.c Fri Feb 23 11:30:48 2018
@@ -13,7 +13,7 @@ void basic_finally(void) {
   }
 }
 
-// CHECK-LABEL: define void @basic_finally()
+// CHECK-LABEL: define dso_local void @basic_finally()
 // CHECK: invoke void @might_crash()
 // CHECK:     to label %[[invoke_cont:[^ ]*]] unwind label %[[lpad:[^ ]*]]
 //
@@ -53,7 +53,7 @@ l:
   }
 }
 
-// CHECK-LABEL: define void @label_in_finally()
+// CHECK-LABEL: define dso_local void @label_in_finally()
 // CHECK: invoke void @might_crash()
 // CHECK:     to label %[[invoke_cont:[^ ]*]] unwind label %[[lpad:[^ ]*]]
 //
@@ -81,7 +81,7 @@ void use_abnormal_termination(void) {
   }
 }
 
-// CHECK-LABEL: define void @use_abnormal_termination()
+// CHECK-LABEL: define dso_local void @use_abnormal_termination()
 // CHECK: invoke void @might_crash()
 // CHECK:     to label %[[invoke_cont:[^ ]*]] unwind label %[[lpad:[^ ]*]]
 //
@@ -110,7 +110,7 @@ void noreturn_noop_finally() {
   }
 }
 
-// CHECK-LABEL: define void @noreturn_noop_finally()
+// CHECK-LABEL: define dso_local void @noreturn_noop_finally()
 // CHECK: call void @"\01?fin$0 at 0@noreturn_noop_finally@@"({{.*}})
 // CHECK: ret void
 
@@ -127,7 +127,7 @@ void noreturn_finally() {
   }
 }
 
-// CHECK-LABEL: define void @noreturn_finally()
+// CHECK-LABEL: define dso_local void @noreturn_finally()
 // CHECK: invoke void @might_crash()
 // CHECK:     to label %[[cont:[^ ]*]] unwind label %[[lpad:[^ ]*]]
 //
@@ -151,7 +151,7 @@ int finally_with_return() {
   } __finally {
   }
 }
-// CHECK-LABEL: define i32 @finally_with_return()
+// CHECK-LABEL: define dso_local i32 @finally_with_return()
 // CHECK: call void @"\01?fin$0 at 0@finally_with_return@@"({{.*}})
 // CHECK-NEXT: ret i32 42
 
@@ -173,7 +173,7 @@ int nested___finally___finally() {
   return 0;
 }
 
-// CHECK-LABEL: define i32 @nested___finally___finally
+// CHECK-LABEL: define dso_local i32 @nested___finally___finally
 // CHECK: invoke void @"\01?fin$1 at 0@nested___finally___finally@@"({{.*}})
 // CHECK:          to label %[[outercont:[^ ]*]] unwind label %[[lpad:[^ ]*]]
 //
@@ -208,7 +208,7 @@ int nested___finally___finally_with_eh_e
   }
   return 912;
 }
-// CHECK-LABEL: define i32 @nested___finally___finally_with_eh_edge
+// CHECK-LABEL: define dso_local i32 @nested___finally___finally_with_eh_edge
 // CHECK: invoke void @might_crash()
 // CHECK-NEXT: to label %[[invokecont:[^ ]*]] unwind label %[[lpad1:[^ ]*]]
 //
@@ -252,7 +252,7 @@ void finally_within_finally() {
   }
 }
 
-// CHECK-LABEL: define void @finally_within_finally(
+// CHECK-LABEL: define dso_local void @finally_within_finally(
 // CHECK: invoke void @might_crash(
 
 // CHECK: call void @"\01?fin$0 at 0@finally_within_finally@@"(

Modified: cfe/trunk/test/CodeGen/exceptions-seh-leave.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/exceptions-seh-leave.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/exceptions-seh-leave.c (original)
+++ cfe/trunk/test/CodeGen/exceptions-seh-leave.c Fri Feb 23 11:30:48 2018
@@ -17,7 +17,7 @@ int __leave_with___except_simple() {
   }
   return 1;
 }
-// CHECK-LABEL: define i32 @__leave_with___except_simple()
+// CHECK-LABEL: define dso_local i32 @__leave_with___except_simple()
 // CHECK: store i32 15, i32* %myres
 // CHECK-NEXT: br label %[[tryleave:[^ ]*]]
 // CHECK-NOT: store i32 23
@@ -37,7 +37,7 @@ int __leave_with___except() {
   }
   return 1;
 }
-// CHECK-LABEL: define i32 @__leave_with___except()
+// CHECK-LABEL: define dso_local i32 @__leave_with___except()
 // CHECK: invoke void @g()
 // CHECK-NEXT:       to label %[[cont:.*]] unwind label %{{.*}}
 // For __excepts, instead of an explicit __try.__leave label, we could use
@@ -69,7 +69,7 @@ int __leave_with___finally_simple() {
   }
   return 1;
 }
-// CHECK-LABEL: define i32 @__leave_with___finally_simple()
+// CHECK-LABEL: define dso_local i32 @__leave_with___finally_simple()
 // CHECK: store i32 15, i32* %myres
 // CHECK-NEXT: br label %[[tryleave:[^ ]*]]
 // CHECK-NOT: store i32 23
@@ -89,7 +89,7 @@ int __leave_with___finally_noreturn() {
   }
   return 1;
 }
-// CHECK-LABEL: define i32 @__leave_with___finally_noreturn()
+// CHECK-LABEL: define dso_local i32 @__leave_with___finally_noreturn()
 // CHECK: store i32 15, i32* %myres
 // CHECK-NEXT: br label %[[tryleave:[^ ]*]]
 // CHECK-NOT: store i32 23
@@ -109,7 +109,7 @@ int __leave_with___finally() {
   }
   return 1;
 }
-// CHECK-LABEL: define i32 @__leave_with___finally()
+// CHECK-LABEL: define dso_local i32 @__leave_with___finally()
 // CHECK: invoke void @g()
 // CHECK-NEXT:       to label %[[cont:.*]] unwind label %{{.*}}
 // For __finally, there needs to be an explicit __try.__leave, because
@@ -142,7 +142,7 @@ int nested___except___finally() {
   }
   return 1;
 }
-// CHECK-LABEL: define i32 @nested___except___finally()
+// CHECK-LABEL: define dso_local i32 @nested___except___finally()
 
 // CHECK-LABEL: invoke void @g()
 // CHECK-NEXT:       to label %[[g1_cont1:.*]] unwind label %[[g1_lpad:.*]]
@@ -194,7 +194,7 @@ int nested___except___except() {
   return 1;
 }
 // The order of basic blocks in the below doesn't matter.
-// CHECK-LABEL: define i32 @nested___except___except()
+// CHECK-LABEL: define dso_local i32 @nested___except___except()
 
 // CHECK-LABEL: invoke void @g()
 // CHECK-NEXT:       to label %[[g1_cont:.*]] unwind label %[[g1_lpad:.*]]
@@ -247,7 +247,7 @@ int nested___finally___except() {
   return 1;
 }
 // The order of basic blocks in the below doesn't matter.
-// CHECK-LABEL: define i32 @nested___finally___except()
+// CHECK-LABEL: define dso_local i32 @nested___finally___except()
 
 // CHECK-LABEL: invoke void @g()
 // CHECK-NEXT:       to label %[[g1_cont:.*]] unwind label %[[g1_lpad:.*]]
@@ -302,7 +302,7 @@ int nested___finally___finally() {
   return 1;
 }
 // The order of basic blocks in the below doesn't matter.
-// CHECK-LABEL: define i32 @nested___finally___finally()
+// CHECK-LABEL: define dso_local i32 @nested___finally___finally()
 
 // CHECK: invoke void @g()
 // CHECK-NEXT:       to label %[[g1_cont:.*]] unwind label %[[g1_lpad:.*]]

Modified: cfe/trunk/test/CodeGen/exceptions-seh.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/exceptions-seh.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/exceptions-seh.c (original)
+++ cfe/trunk/test/CodeGen/exceptions-seh.c Fri Feb 23 11:30:48 2018
@@ -10,7 +10,7 @@
 void try_body(int numerator, int denominator, int *myres) {
   *myres = numerator / denominator;
 }
-// CHECK-LABEL: define void @try_body(i32 %numerator, i32 %denominator, i32* %myres)
+// CHECK-LABEL: define dso_local void @try_body(i32 %numerator, i32 %denominator, i32* %myres)
 // CHECK: sdiv i32
 // CHECK: store i32 %{{.*}}, i32*
 // CHECK: ret void
@@ -27,7 +27,7 @@ int safe_div(int numerator, int denomina
   return success;
 }
 
-// CHECK-LABEL: define i32 @safe_div(i32 %numerator, i32 %denominator, i32* %res)
+// CHECK-LABEL: define dso_local i32 @safe_div(i32 %numerator, i32 %denominator, i32* %res)
 // X64-SAME:      personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
 // X86-SAME:      personality i8* bitcast (i32 (...)* @_except_handler3 to i8*)
 // CHECK: invoke void @try_body(i32 %{{.*}}, i32 %{{.*}}, i32* %{{.*}}) #[[NOINLINE:[0-9]+]]
@@ -57,9 +57,9 @@ int safe_div(int numerator, int denomina
 // X86: ret i32 1
 
 // Mingw uses msvcrt, so it can also use _except_handler3.
-// X86-GNU-LABEL: define i32 @safe_div(i32 %numerator, i32 %denominator, i32* %res)
+// X86-GNU-LABEL: define dso_local i32 @safe_div(i32 %numerator, i32 %denominator, i32* %res)
 // X86-GNU-SAME:      personality i8* bitcast (i32 (...)* @_except_handler3 to i8*)
-// X64-GNU-LABEL: define i32 @safe_div(i32 %numerator, i32 %denominator, i32* %res)
+// X64-GNU-LABEL: define dso_local i32 @safe_div(i32 %numerator, i32 %denominator, i32* %res)
 // X64-GNU-SAME:      personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
 
 void j(void);
@@ -74,7 +74,7 @@ int filter_expr_capture(void) {
   return r;
 }
 
-// CHECK-LABEL: define i32 @filter_expr_capture()
+// CHECK-LABEL: define dso_local i32 @filter_expr_capture()
 // X64-SAME: personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
 // X86-SAME: personality i8* bitcast (i32 (...)* @_except_handler3 to i8*)
 // X64: call void (...) @llvm.localescape(i32* %[[r:[^ ,]*]])
@@ -114,7 +114,7 @@ int nested_try(void) {
   }
   return r;
 }
-// CHECK-LABEL: define i32 @nested_try()
+// CHECK-LABEL: define dso_local i32 @nested_try()
 // X64-SAME: personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
 // X86-SAME: personality i8* bitcast (i32 (...)* @_except_handler3 to i8*)
 // CHECK: store i32 42, i32* %[[r:[^ ,]*]]
@@ -174,7 +174,7 @@ int basic_finally(int g) {
   }
   return g;
 }
-// CHECK-LABEL: define i32 @basic_finally(i32 %g)
+// CHECK-LABEL: define dso_local i32 @basic_finally(i32 %g)
 // X64-SAME: personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
 // X86-SAME: personality i8* bitcast (i32 (...)* @_except_handler3 to i8*)
 // CHECK: %[[g_addr:[^ ]*]] = alloca i32, align 4
@@ -211,7 +211,7 @@ int except_return(void) {
     return 42;
   }
 }
-// CHECK-LABEL: define i32 @except_return()
+// CHECK-LABEL: define dso_local i32 @except_return()
 // CHECK: %[[tmp:[^ ]*]] = invoke i32 @returns_int()
 // CHECK:       to label %[[cont:[^ ]*]] unwind label %[[catchpad:[^ ]*]]
 //
@@ -240,7 +240,7 @@ void finally_capture_twice(int x) {
   }
 }
 //
-// CHECK-LABEL: define void @finally_capture_twice(
+// CHECK-LABEL: define dso_local void @finally_capture_twice(
 // CHECK:         [[X:%.*]] = alloca i32, align 4
 // CHECK:         call void (...) @llvm.localescape(i32* [[X]])
 // CHECK-NEXT:    store i32 {{.*}}, i32* [[X]], align 4
@@ -267,7 +267,7 @@ int exception_code_in_except(void) {
   }
 }
 
-// CHECK-LABEL: define i32 @exception_code_in_except()
+// CHECK-LABEL: define dso_local i32 @exception_code_in_except()
 // CHECK: %[[ret_slot:[^ ]*]] = alloca i32
 // CHECK: %[[code_slot:[^ ]*]] = alloca i32
 // CHECK: invoke void @try_body(i32 0, i32 0, i32* null)

Modified: cfe/trunk/test/CodeGen/ext-vector.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ext-vector.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ext-vector.c (original)
+++ cfe/trunk/test/CodeGen/ext-vector.c Fri Feb 23 11:30:48 2018
@@ -5,10 +5,10 @@ typedef __attribute__(( ext_vector_type(
 typedef __attribute__(( ext_vector_type(4) )) int int4;
 typedef __attribute__(( ext_vector_type(4) )) unsigned int uint4;
 
-// CHECK: @foo = global <4 x float> <float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00>
+// CHECK: @foo = {{(dso_local )?}}global <4 x float> <float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00>
 float4 foo = (float4){ 1.0, 2.0, 3.0, 4.0 };
 
-// CHECK: @bar = constant <4 x float> <float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 0x7FF0000000000000>
+// CHECK: @bar = {{(dso_local )?}}constant <4 x float> <float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 0x7FF0000000000000>
 const float4 bar = (float4){ 1.0, 2.0, 3.0, __builtin_inff() };
 
 // CHECK: @test1

Modified: cfe/trunk/test/CodeGen/fixup-depth-overflow.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/fixup-depth-overflow.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/fixup-depth-overflow.c (original)
+++ cfe/trunk/test/CodeGen/fixup-depth-overflow.c Fri Feb 23 11:30:48 2018
@@ -22,5 +22,5 @@ L1:
   return;
 }
 
-// CHECK-LABEL: define void @f
+// CHECK-LABEL: define {{(dso_local )?}}void @f
 // CHECK-NOT: cleanup

Modified: cfe/trunk/test/CodeGen/inline.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/inline.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/inline.c (original)
+++ cfe/trunk/test/CodeGen/inline.c Fri Feb 23 11:30:48 2018
@@ -61,13 +61,13 @@
 // RUN: %clang_cc1 %s -triple i386-pc-win32 -O1 -disable-llvm-passes -emit-llvm -o - -std=c99 | FileCheck %s --check-prefix=CHECK4
 // RUN: %clang_cc1 %s -triple i386-pc-win32 -fexperimental-new-pass-manager -O1 -disable-llvm-passes -emit-llvm -o - -std=c99 | FileCheck %s --check-prefix=CHECK4
 // CHECK4-NOT: define weak_odr void @_Exit(
-// CHECK4-LABEL: define weak_odr i32 @ei()
-// CHECK4-LABEL: define i32 @bar()
+// CHECK4-LABEL: define weak_odr dso_local i32 @ei()
+// CHECK4-LABEL: define dso_local i32 @bar()
 // CHECK4-NOT: unreferenced1
-// CHECK4-LABEL: define weak_odr void @unreferenced2()
-// CHECK4-LABEL: define void @gnu_inline()
-// CHECK4-LABEL: define linkonce_odr i32 @foo()
-// CHECK4-LABEL: define available_externally void @gnu_ei_inline()
+// CHECK4-LABEL: define weak_odr dso_local void @unreferenced2()
+// CHECK4-LABEL: define dso_local void @gnu_inline()
+// CHECK4-LABEL: define linkonce_odr dso_local i32 @foo()
+// CHECK4-LABEL: define available_externally dso_local void @gnu_ei_inline()
 
 __attribute__((noreturn)) void __cdecl _exit(int _Code);
 __inline void __cdecl _Exit(int status) { _exit(status); }

Modified: cfe/trunk/test/CodeGen/mangle-ms.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mangle-ms.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/mangle-ms.c (original)
+++ cfe/trunk/test/CodeGen/mangle-ms.c Fri Feb 23 11:30:48 2018
@@ -1,13 +1,13 @@
 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-win32 | FileCheck %s
 
-// CHECK: define void @"\01?f@@$$J0YAXP6AX at Z@Z"
+// CHECK: define dso_local void @"\01?f@@$$J0YAXP6AX at Z@Z"
 __attribute__((overloadable)) void f(void (*x)()) {}
 
-// CHECK: define void @f
+// CHECK: define dso_local void @f
 void f(void (*x)(int)) {}
 
-// CHECK: define void @g
+// CHECK: define dso_local void @g
 void g(void (*x)(int)) {}
 
-// CHECK: define void @"\01?g@@$$J0YAXP6AX at Z@Z"
+// CHECK: define dso_local void @"\01?g@@$$J0YAXP6AX at Z@Z"
 __attribute__((overloadable)) void g(void (*x)()) {}

Modified: cfe/trunk/test/CodeGen/mangle-windows-rtd.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mangle-windows-rtd.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/mangle-windows-rtd.c (original)
+++ cfe/trunk/test/CodeGen/mangle-windows-rtd.c Fri Feb 23 11:30:48 2018
@@ -1,10 +1,10 @@
 // RUN: %clang_cc1 -emit-llvm -mrtd %s -o - -triple=i386-mingw32 | FileCheck %s
 
 void f1(void) {}
-// CHECK: define x86_stdcallcc void @"\01_f1 at 0"
+// CHECK: define dso_local x86_stdcallcc void @"\01_f1 at 0"
 
 void __stdcall f2(void) {}
-// CHECK: define x86_stdcallcc void @"\01_f2 at 0"
+// CHECK: define dso_local x86_stdcallcc void @"\01_f2 at 0"
 
 void __fastcall f3(void) {}
-// CHECK: define x86_fastcallcc void @"\01 at f3@0"
+// CHECK: define dso_local x86_fastcallcc void @"\01 at f3@0"

Modified: cfe/trunk/test/CodeGen/mangle-windows.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mangle-windows.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/mangle-windows.c (original)
+++ cfe/trunk/test/CodeGen/mangle-windows.c Fri Feb 23 11:30:48 2018
@@ -11,73 +11,73 @@
 // ELF64: target datalayout = "e-m:e-{{.*}}"
 
 void __stdcall f1(void) {}
-// CHECK: define x86_stdcallcc void @"\01_f1 at 0"
-// X64: define void @f1(
+// CHECK: define dso_local x86_stdcallcc void @"\01_f1 at 0"
+// X64: define dso_local void @f1(
 // ELF32: define x86_stdcallcc void @"\01_f1 at 0"
 // ELF64: define void @f1(
 
 void __fastcall f2(void) {}
-// CHECK: define x86_fastcallcc void @"\01 at f2@0"
-// X64: define void @f2(
+// CHECK: define dso_local x86_fastcallcc void @"\01 at f2@0"
+// X64: define dso_local void @f2(
 // ELF32: define x86_fastcallcc void @"\01 at f2@0"
 // ELF64: define void @f2(
 
 void __stdcall f3() {}
-// CHECK: define x86_stdcallcc void @"\01_f3 at 0"
-// X64: define void @f3(
+// CHECK: define dso_local x86_stdcallcc void @"\01_f3 at 0"
+// X64: define dso_local void @f3(
 
 void __fastcall f4(char a) {}
-// CHECK: define x86_fastcallcc void @"\01 at f4@4"
-// X64: define void @f4(
+// CHECK: define dso_local x86_fastcallcc void @"\01 at f4@4"
+// X64: define dso_local void @f4(
 
 void __fastcall f5(short a) {}
-// CHECK: define x86_fastcallcc void @"\01 at f5@4"
-// X64: define void @f5(
+// CHECK: define dso_local x86_fastcallcc void @"\01 at f5@4"
+// X64: define dso_local void @f5(
 
 void __fastcall f6(int a) {}
-// CHECK: define x86_fastcallcc void @"\01 at f6@4"
-// X64: define void @f6(
+// CHECK: define dso_local x86_fastcallcc void @"\01 at f6@4"
+// X64: define dso_local void @f6(
 
 void __fastcall f7(long a) {}
-// CHECK: define x86_fastcallcc void @"\01 at f7@4"
-// X64: define void @f7(
+// CHECK: define dso_local x86_fastcallcc void @"\01 at f7@4"
+// X64: define dso_local void @f7(
 
 void __fastcall f8(long long a) {}
-// CHECK: define x86_fastcallcc void @"\01 at f8@8"
-// X64: define void @f8(
+// CHECK: define dso_local x86_fastcallcc void @"\01 at f8@8"
+// X64: define dso_local void @f8(
 
 void __fastcall f9(long long a, char b, char c, short d) {}
-// CHECK: define x86_fastcallcc void @"\01 at f9@20"(i64 %a, i8 signext %b, i8 signext %c, i16 signext %d)
-// X64: define void @f9(
+// CHECK: define dso_local x86_fastcallcc void @"\01 at f9@20"(i64 %a, i8 signext %b, i8 signext %c, i16 signext %d)
+// X64: define dso_local void @f9(
 
 void f12(void) {}
-// CHECK: define void @f12(
-// X64: define void @f12(
+// CHECK: define dso_local void @f12(
+// X64: define dso_local void @f12(
 
 void __vectorcall v1(void) {}
-// CHECK: define x86_vectorcallcc void @"\01v1@@0"(
-// X64: define x86_vectorcallcc void @"\01v1@@0"(
+// CHECK: define dso_local x86_vectorcallcc void @"\01v1@@0"(
+// X64: define dso_local x86_vectorcallcc void @"\01v1@@0"(
 // ELF32: define x86_vectorcallcc void @"\01v1@@0"(
 // ELF64: define x86_vectorcallcc void @"\01v1@@0"(
 
 void __vectorcall v2(char a) {}
-// CHECK: define x86_vectorcallcc void @"\01v2@@4"(
-// X64: define x86_vectorcallcc void @"\01v2@@8"(
+// CHECK: define dso_local x86_vectorcallcc void @"\01v2@@4"(
+// X64: define dso_local x86_vectorcallcc void @"\01v2@@8"(
 // ELF32: define x86_vectorcallcc void @"\01v2@@4"(
 // ELF64: define x86_vectorcallcc void @"\01v2@@8"(
 
 void __vectorcall v3(short a) {}
-// CHECK: define x86_vectorcallcc void @"\01v3@@4"(
-// X64: define x86_vectorcallcc void @"\01v3@@8"(
+// CHECK: define dso_local x86_vectorcallcc void @"\01v3@@4"(
+// X64: define dso_local x86_vectorcallcc void @"\01v3@@8"(
 
 void __vectorcall v4(int a) {}
-// CHECK: define x86_vectorcallcc void @"\01v4@@4"(
-// X64: define x86_vectorcallcc void @"\01v4@@8"(
+// CHECK: define dso_local x86_vectorcallcc void @"\01v4@@4"(
+// X64: define dso_local x86_vectorcallcc void @"\01v4@@8"(
 
 void __vectorcall v5(long long a) {}
-// CHECK: define x86_vectorcallcc void @"\01v5@@8"(
-// X64: define x86_vectorcallcc void @"\01v5@@8"(
+// CHECK: define dso_local x86_vectorcallcc void @"\01v5@@8"(
+// X64: define dso_local x86_vectorcallcc void @"\01v5@@8"(
 
 void __vectorcall v6(char a, char b) {}
-// CHECK: define x86_vectorcallcc void @"\01v6@@8"(
-// X64: define x86_vectorcallcc void @"\01v6@@16"(
+// CHECK: define dso_local x86_vectorcallcc void @"\01v6@@8"(
+// X64: define dso_local x86_vectorcallcc void @"\01v6@@16"(

Modified: cfe/trunk/test/CodeGen/microsoft-call-conv-x64.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/microsoft-call-conv-x64.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/microsoft-call-conv-x64.c (original)
+++ cfe/trunk/test/CodeGen/microsoft-call-conv-x64.c Fri Feb 23 11:30:48 2018
@@ -3,12 +3,12 @@
 void __fastcall f1(void);
 void __stdcall f2(void);
 void __fastcall f4(void) {
-// CHECK-LABEL: define void @f4()
+// CHECK-LABEL: define dso_local void @f4()
   f1();
 // CHECK: call void @f1()
 }
 void __stdcall f5(void) {
-// CHECK-LABEL: define void @f5()
+// CHECK-LABEL: define dso_local void @f5()
   f2();
 // CHECK: call void @f2()
 }

Modified: cfe/trunk/test/CodeGen/mingw-long-double.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mingw-long-double.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/mingw-long-double.c (original)
+++ cfe/trunk/test/CodeGen/mingw-long-double.c Fri Feb 23 11:30:48 2018
@@ -10,32 +10,32 @@ struct {
   long double ldb;
 } agggregate_LD = {};
 // GNU32: %struct.anon = type { i8, x86_fp80 }
-// GNU32: @agggregate_LD = global %struct.anon zeroinitializer, align 4
+// GNU32: @agggregate_LD = dso_local global %struct.anon zeroinitializer, align 4
 // GNU64: %struct.anon = type { i8, x86_fp80 }
-// GNU64: @agggregate_LD = global %struct.anon zeroinitializer, align 16
+// GNU64: @agggregate_LD = dso_local global %struct.anon zeroinitializer, align 16
 // MSC64: %struct.anon = type { i8, double }
-// MSC64: @agggregate_LD = global %struct.anon zeroinitializer, align 8
+// MSC64: @agggregate_LD = dso_local global %struct.anon zeroinitializer, align 8
 
 long double dataLD = 1.0L;
-// GNU32: @dataLD = global x86_fp80 0xK3FFF8000000000000000, align 4
-// GNU64: @dataLD = global x86_fp80 0xK3FFF8000000000000000, align 16
-// MSC64: @dataLD = global double 1.000000e+00, align 8
+// GNU32: @dataLD = dso_local global x86_fp80 0xK3FFF8000000000000000, align 4
+// GNU64: @dataLD = dso_local global x86_fp80 0xK3FFF8000000000000000, align 16
+// MSC64: @dataLD = dso_local global double 1.000000e+00, align 8
 
 long double _Complex dataLDC = {1.0L, 1.0L};
-// GNU32: @dataLDC = global { x86_fp80, x86_fp80 } { x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK3FFF8000000000000000 }, align 4
-// GNU64: @dataLDC = global { x86_fp80, x86_fp80 } { x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK3FFF8000000000000000 }, align 16
-// MSC64: @dataLDC = global { double, double } { double 1.000000e+00, double 1.000000e+00 }, align 8
+// GNU32: @dataLDC = dso_local global { x86_fp80, x86_fp80 } { x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK3FFF8000000000000000 }, align 4
+// GNU64: @dataLDC = dso_local global { x86_fp80, x86_fp80 } { x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK3FFF8000000000000000 }, align 16
+// MSC64: @dataLDC = dso_local global { double, double } { double 1.000000e+00, double 1.000000e+00 }, align 8
 
 long double TestLD(long double x) {
   return x * x;
 }
-// GNU32: define x86_fp80 @TestLD(x86_fp80 %x)
-// GNU64: define void @TestLD(x86_fp80* noalias sret %agg.result, x86_fp80*)
-// MSC64: define double @TestLD(double %x)
+// GNU32: define dso_local x86_fp80 @TestLD(x86_fp80 %x)
+// GNU64: define dso_local void @TestLD(x86_fp80* noalias sret %agg.result, x86_fp80*)
+// MSC64: define dso_local double @TestLD(double %x)
 
 long double _Complex TestLDC(long double _Complex x) {
   return x * x;
 }
-// GNU32: define void @TestLDC({ x86_fp80, x86_fp80 }* noalias sret %agg.result, { x86_fp80, x86_fp80 }* byval align 4 %x)
-// GNU64: define void @TestLDC({ x86_fp80, x86_fp80 }* noalias sret %agg.result, { x86_fp80, x86_fp80 }* %x)
-// MSC64: define void @TestLDC({ double, double }* noalias sret %agg.result, { double, double }* %x)
+// GNU32: define dso_local void @TestLDC({ x86_fp80, x86_fp80 }* noalias sret %agg.result, { x86_fp80, x86_fp80 }* byval align 4 %x)
+// GNU64: define dso_local void @TestLDC({ x86_fp80, x86_fp80 }* noalias sret %agg.result, { x86_fp80, x86_fp80 }* %x)
+// MSC64: define dso_local void @TestLDC({ double, double }* noalias sret %agg.result, { double, double }* %x)

Modified: cfe/trunk/test/CodeGen/ms-align-tentative.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-align-tentative.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms-align-tentative.c (original)
+++ cfe/trunk/test/CodeGen/ms-align-tentative.c Fri Feb 23 11:30:48 2018
@@ -1,25 +1,25 @@
 // RUN: %clang_cc1 -triple i386-pc-win32 -emit-llvm -fms-compatibility -o - < %s | FileCheck %s
 
 char __declspec(align(8192)) x;
-// CHECK-DAG: @x = global i8 0, align 8192
+// CHECK-DAG: @x = dso_local global i8 0, align 8192
 
 typedef char __declspec(align(8192)) T;
 T y;
-// CHECK-DAG: @y = global i8 0, align 8192
+// CHECK-DAG: @y = dso_local global i8 0, align 8192
 
 T __declspec(align(8192)) z;
-// CHECK-DAG: @z = global i8 0, align 8192
+// CHECK-DAG: @z = dso_local global i8 0, align 8192
 
 int __declspec(align(16)) redef;
 int __declspec(align(32)) redef = 8;
-// CHECK-DAG: @redef = global i32 8, align 32
+// CHECK-DAG: @redef = dso_local global i32 8, align 32
 
 struct __declspec(align(64)) S {
   char fd;
 } s;
-// CHECK-DAG: @s = global %struct.S zeroinitializer, align 64
+// CHECK-DAG: @s = dso_local global %struct.S zeroinitializer, align 64
 
 struct Wrap {
   struct S x;
 } w;
-// CHECK-DAG: @w = global %struct.Wrap zeroinitializer, align 64
+// CHECK-DAG: @w = dso_local global %struct.Wrap zeroinitializer, align 64

Modified: cfe/trunk/test/CodeGen/ms-annotation.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-annotation.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms-annotation.c (original)
+++ cfe/trunk/test/CodeGen/ms-annotation.c Fri Feb 23 11:30:48 2018
@@ -11,7 +11,7 @@ void test1(void) {
   __annotation(L"unicode: \u0ca0_\u0ca0");
 }
 
-// CHECK-LABEL: define void @test1()
+// CHECK-LABEL: define dso_local void @test1()
 // CHECK: call void @llvm.codeview.annotation(metadata ![[A1:[0-9]+]])
 // CHECK: call void @llvm.codeview.annotation(metadata ![[A2:[0-9]+]])
 // CHECK: call void @llvm.codeview.annotation(metadata ![[A3:[0-9]+]])

Modified: cfe/trunk/test/CodeGen/ms-barriers-intrinsics.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-barriers-intrinsics.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms-barriers-intrinsics.c (original)
+++ cfe/trunk/test/CodeGen/ms-barriers-intrinsics.c Fri Feb 23 11:30:48 2018
@@ -12,26 +12,26 @@ typedef __SIZE_TYPE__ size_t;
 #include <intrin.h>
 
 void test_ReadWriteBarrier() { _ReadWriteBarrier(); }
-// CHECK-LABEL: define void @test_ReadWriteBarrier
+// CHECK-LABEL: define dso_local void @test_ReadWriteBarrier
 // CHECK:   fence syncscope("singlethread") seq_cst
 // CHECK:   ret void
 // CHECK: }
 
 void test_ReadBarrier() { _ReadBarrier(); }
-// CHECK-LABEL: define void @test_ReadBarrier
+// CHECK-LABEL: define dso_local void @test_ReadBarrier
 // CHECK:   fence syncscope("singlethread") seq_cst
 // CHECK:   ret void
 // CHECK: }
 
 void test_WriteBarrier() { _WriteBarrier(); }
-// CHECK-LABEL: define void @test_WriteBarrier
+// CHECK-LABEL: define dso_local void @test_WriteBarrier
 // CHECK:   fence syncscope("singlethread") seq_cst
 // CHECK:   ret void
 // CHECK: }
 
 #if defined(__x86_64__)
 void test__faststorefence() { __faststorefence(); }
-// CHECK-X64-LABEL: define void @test__faststorefence
+// CHECK-X64-LABEL: define dso_local void @test__faststorefence
 // CHECK-X64:   fence seq_cst
 // CHECK-X64:   ret void
 // CHECK-X64: }

Modified: cfe/trunk/test/CodeGen/ms-declspecs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-declspecs.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms-declspecs.c (original)
+++ cfe/trunk/test/CodeGen/ms-declspecs.c Fri Feb 23 11:30:48 2018
@@ -2,14 +2,14 @@
 
 __declspec(selectany) int x1 = 1;
 const __declspec(selectany) int x2 = 2;
-// CHECK: @x1 = weak_odr global i32 1, comdat, align 4
-// CHECK: @x2 = weak_odr constant i32 2, comdat, align 4
+// CHECK: @x1 = weak_odr dso_local global i32 1, comdat, align 4
+// CHECK: @x2 = weak_odr dso_local constant i32 2, comdat, align 4
 
 // selectany turns extern variable declarations into definitions.
 __declspec(selectany) int x3;
 extern __declspec(selectany) int x4;
-// CHECK: @x3 = weak_odr global i32 0, comdat, align 4
-// CHECK: @x4 = weak_odr global i32 0, comdat, align 4
+// CHECK: @x3 = weak_odr dso_local global i32 0, comdat, align 4
+// CHECK: @x4 = weak_odr dso_local global i32 0, comdat, align 4
 
 struct __declspec(align(16)) S {
   char x;
@@ -19,14 +19,14 @@ union { struct S s; } u;
 // CHECK: @u = {{.*}}zeroinitializer, align 16
 
 
-// CHECK: define void @t3() [[NAKED:#[0-9]+]] {
+// CHECK: define dso_local void @t3() [[NAKED:#[0-9]+]] {
 __declspec(naked) void t3() {}
 
-// CHECK: define void @t22() [[NUW:#[0-9]+]]
+// CHECK: define dso_local void @t22() [[NUW:#[0-9]+]]
 void __declspec(nothrow) t22();
 void t22() {}
 
-// CHECK: define void @t2() [[NI:#[0-9]+]] {
+// CHECK: define dso_local void @t2() [[NI:#[0-9]+]] {
 __declspec(noinline) void t2() {}
 
 // CHECK: call void @f20_t() [[NR:#[0-9]+]]

Modified: cfe/trunk/test/CodeGen/ms-declspecs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-declspecs.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms-declspecs.cpp (original)
+++ cfe/trunk/test/CodeGen/ms-declspecs.cpp Fri Feb 23 11:30:48 2018
@@ -8,8 +8,8 @@ extern "C" {
 __declspec(selectany) int x4;
 }
 __declspec(selectany) int x5;
-// CHECK: @"\01?x1@@3HA" = weak_odr global i32 0, comdat, align 4
-// CHECK: @x2 = weak_odr global i32 0, comdat, align 4
-// CHECK: @"\01?x3@@3HA"  = weak_odr global i32 0, comdat, align 4
-// CHECK: @x4 = weak_odr global i32 0, comdat, align 4
-// CHECK: @"\01?x5@@3HA"  = weak_odr global i32 0, comdat, align 4
+// CHECK: @"\01?x1@@3HA" = weak_odr dso_local global i32 0, comdat, align 4
+// CHECK: @x2 = weak_odr dso_local global i32 0, comdat, align 4
+// CHECK: @"\01?x3@@3HA"  = weak_odr dso_local global i32 0, comdat, align 4
+// CHECK: @x4 = weak_odr dso_local global i32 0, comdat, align 4
+// CHECK: @"\01?x5@@3HA"  = weak_odr dso_local global i32 0, comdat, align 4

Modified: cfe/trunk/test/CodeGen/ms-inline-asm-align.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-inline-asm-align.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms-inline-asm-align.c (original)
+++ cfe/trunk/test/CodeGen/ms-inline-asm-align.c Fri Feb 23 11:30:48 2018
@@ -21,7 +21,7 @@ void align_test() {
 // DARWIN-SAME: .align 8
 // DARWIN-SAME: "~{dirflag},~{fpsr},~{flags}"()
 
-// WINDOWS-LABEL: define void @align_test()
+// WINDOWS-LABEL: define dso_local void @align_test()
 // WINDOWS: call void asm sideeffect inteldialect
 // WINDOWS-SAME: .align 8
 // WINDOWS-SAME: .align 16

Modified: cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c (original)
+++ cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c Fri Feb 23 11:30:48 2018
@@ -21,7 +21,7 @@ void t2() {
 }
 
 void ignore_fe_size() {
-  // CHECK-LABEL: define void @ignore_fe_size()
+  // CHECK-LABEL: define dso_local void @ignore_fe_size()
   char c;
   // CHECK: vaddps xmm1, xmm2, $1{1to4}
   __asm vaddps xmm1, xmm2, [c]{1to4}

Modified: cfe/trunk/test/CodeGen/ms-intrinsics.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-intrinsics.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms-intrinsics.c (original)
+++ cfe/trunk/test/CodeGen/ms-intrinsics.c Fri Feb 23 11:30:48 2018
@@ -55,7 +55,7 @@ void *test_ReturnAddress() {
 void *test_AddressOfReturnAddress() {
   return _AddressOfReturnAddress();
 }
-// CHECK-INTEL-LABEL: define i8* @test_AddressOfReturnAddress()
+// CHECK-INTEL-LABEL: define dso_local i8* @test_AddressOfReturnAddress()
 // CHECK-INTEL: = tail call i8* @llvm.addressofreturnaddress()
 // CHECK-INTEL: ret i8*
 #endif

Modified: cfe/trunk/test/CodeGen/ms-setjmp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-setjmp.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms-setjmp.c (original)
+++ cfe/trunk/test/CodeGen/ms-setjmp.c Fri Feb 23 11:30:48 2018
@@ -13,11 +13,11 @@ jmp_buf jb;
 
 int test_setjmp() {
   return _setjmp(jb);
-  // I386-LABEL: define i32 @test_setjmp
+  // I386-LABEL: define dso_local i32 @test_setjmp
   // I386:       %[[call:.*]] = call i32 (i8*, i32, ...) @_setjmp3(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @jb, i32 0, i32 0), i32 0)
   // I386-NEXT:  ret i32 %[[call]]
 
-  // X64-LABEL: define i32 @test_setjmp
+  // X64-LABEL: define dso_local i32 @test_setjmp
   // X64:       %[[addr:.*]] = call i8* @llvm.frameaddress(i32 0)
   // X64:       %[[call:.*]] = call i32 @_setjmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @jb, i32 0, i32 0), i8* %[[addr]])
   // X64-NEXT:  ret i32 %[[call]]
@@ -25,7 +25,7 @@ int test_setjmp() {
 
 int test_setjmpex() {
   return _setjmpex(jb);
-  // X64-LABEL: define i32 @test_setjmpex
+  // X64-LABEL: define dso_local i32 @test_setjmpex
   // X64:       %[[addr:.*]] = call i8* @llvm.frameaddress(i32 0)
   // X64:       %[[call:.*]] = call i32 @_setjmpex(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @jb, i32 0, i32 0), i8* %[[addr]])
   // X64-NEXT:  ret i32 %[[call]]

Modified: cfe/trunk/test/CodeGen/ms-x86-intrinsics.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-x86-intrinsics.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms-x86-intrinsics.c (original)
+++ cfe/trunk/test/CodeGen/ms-x86-intrinsics.c Fri Feb 23 11:30:48 2018
@@ -9,7 +9,7 @@
 char test__readfsbyte(unsigned long Offset) {
   return __readfsbyte(Offset);
 }
-// CHECK-I386-LABEL: define signext i8 @test__readfsbyte(i32 %Offset)
+// CHECK-I386-LABEL: define dso_local signext i8 @test__readfsbyte(i32 %Offset)
 // CHECK-I386:   [[PTR:%[0-9]+]] = inttoptr i32 %Offset to i8 addrspace(257)*
 // CHECK-I386:   [[VALUE:%[0-9]+]] = load volatile i8, i8 addrspace(257)* [[PTR]], align 1
 // CHECK-I386:   ret i8 [[VALUE:%[0-9]+]]
@@ -17,7 +17,7 @@ char test__readfsbyte(unsigned long Offs
 short test__readfsword(unsigned long Offset) {
   return __readfsword(Offset);
 }
-// CHECK-I386-LABEL: define signext i16 @test__readfsword(i32 %Offset)
+// CHECK-I386-LABEL: define dso_local signext i16 @test__readfsword(i32 %Offset)
 // CHECK-I386:   [[PTR:%[0-9]+]] = inttoptr i32 %Offset to i16 addrspace(257)*
 // CHECK-I386:   [[VALUE:%[0-9]+]] = load volatile i16, i16 addrspace(257)* [[PTR]], align 2
 // CHECK-I386:   ret i16 [[VALUE:%[0-9]+]]
@@ -25,7 +25,7 @@ short test__readfsword(unsigned long Off
 long test__readfsdword(unsigned long Offset) {
   return __readfsdword(Offset);
 }
-// CHECK-I386-LABEL: define i32 @test__readfsdword(i32 %Offset)
+// CHECK-I386-LABEL: define dso_local i32 @test__readfsdword(i32 %Offset)
 // CHECK-I386:   [[PTR:%[0-9]+]] = inttoptr i32 %Offset to i32 addrspace(257)*
 // CHECK-I386:   [[VALUE:%[0-9]+]] = load volatile i32, i32 addrspace(257)* [[PTR]], align 4
 // CHECK-I386:   ret i32 [[VALUE:%[0-9]+]]
@@ -33,7 +33,7 @@ long test__readfsdword(unsigned long Off
 long long test__readfsqword(unsigned long Offset) {
   return __readfsqword(Offset);
 }
-// CHECK-I386-LABEL: define i64 @test__readfsqword(i32 %Offset)
+// CHECK-I386-LABEL: define dso_local i64 @test__readfsqword(i32 %Offset)
 // CHECK-I386:   [[PTR:%[0-9]+]] = inttoptr i32 %Offset to i64 addrspace(257)*
 // CHECK-I386:   [[VALUE:%[0-9]+]] = load volatile i64, i64 addrspace(257)* [[PTR]], align 8
 // CHECK-I386:   ret i64 [[VALUE:%[0-9]+]]
@@ -42,7 +42,7 @@ long long test__readfsqword(unsigned lon
 __int64 test__emul(int a, int b) {
   return __emul(a, b);
 }
-// CHECK-LABEL: define i64 @test__emul(i32 %a, i32 %b)
+// CHECK-LABEL: define dso_local i64 @test__emul(i32 %a, i32 %b)
 // CHECK: [[X:%[0-9]+]] = sext i32 %a to i64
 // CHECK: [[Y:%[0-9]+]] = sext i32 %b to i64
 // CHECK: [[RES:%[0-9]+]] = mul nsw i64 [[Y]], [[X]]
@@ -51,7 +51,7 @@ __int64 test__emul(int a, int b) {
 unsigned __int64 test__emulu(unsigned int a, unsigned int b) {
   return __emulu(a, b);
 }
-// CHECK-LABEL: define i64 @test__emulu(i32 %a, i32 %b)
+// CHECK-LABEL: define dso_local i64 @test__emulu(i32 %a, i32 %b)
 // CHECK: [[X:%[0-9]+]] = zext i32 %a to i64
 // CHECK: [[Y:%[0-9]+]] = zext i32 %b to i64
 // CHECK: [[RES:%[0-9]+]] = mul nuw i64 [[Y]], [[X]]
@@ -62,7 +62,7 @@ unsigned __int64 test__emulu(unsigned in
 char test__readgsbyte(unsigned long Offset) {
   return __readgsbyte(Offset);
 }
-// CHECK-X64-LABEL: define i8 @test__readgsbyte(i32 %Offset)
+// CHECK-X64-LABEL: define dso_local i8 @test__readgsbyte(i32 %Offset)
 // CHECK-X64:   [[ZEXT:%[0-9]+]] = zext i32 %Offset to i64
 // CHECK-X64:   [[PTR:%[0-9]+]] = inttoptr i64 [[ZEXT]] to i8 addrspace(256)*
 // CHECK-X64:   [[VALUE:%[0-9]+]] = load volatile i8, i8 addrspace(256)* [[PTR]], align 1
@@ -71,7 +71,7 @@ char test__readgsbyte(unsigned long Offs
 short test__readgsword(unsigned long Offset) {
   return __readgsword(Offset);
 }
-// CHECK-X64-LABEL: define i16 @test__readgsword(i32 %Offset)
+// CHECK-X64-LABEL: define dso_local i16 @test__readgsword(i32 %Offset)
 // CHECK-X64:   [[ZEXT:%[0-9]+]] = zext i32 %Offset to i64
 // CHECK-X64:   [[PTR:%[0-9]+]] = inttoptr i64 [[ZEXT]] to i16 addrspace(256)*
 // CHECK-X64:   [[VALUE:%[0-9]+]] = load volatile i16, i16 addrspace(256)* [[PTR]], align 2
@@ -80,7 +80,7 @@ short test__readgsword(unsigned long Off
 long test__readgsdword(unsigned long Offset) {
   return __readgsdword(Offset);
 }
-// CHECK-X64-LABEL: define i32 @test__readgsdword(i32 %Offset)
+// CHECK-X64-LABEL: define dso_local i32 @test__readgsdword(i32 %Offset)
 // CHECK-X64:   [[ZEXT:%[0-9]+]] = zext i32 %Offset to i64
 // CHECK-X64:   [[PTR:%[0-9]+]] = inttoptr i64 [[ZEXT]] to i32 addrspace(256)*
 // CHECK-X64:   [[VALUE:%[0-9]+]] = load volatile i32, i32 addrspace(256)* [[PTR]], align 4
@@ -89,7 +89,7 @@ long test__readgsdword(unsigned long Off
 long long test__readgsqword(unsigned long Offset) {
   return __readgsqword(Offset);
 }
-// CHECK-X64-LABEL: define i64 @test__readgsqword(i32 %Offset)
+// CHECK-X64-LABEL: define dso_local i64 @test__readgsqword(i32 %Offset)
 // CHECK-X64:   [[ZEXT:%[0-9]+]] = zext i32 %Offset to i64
 // CHECK-X64:   [[PTR:%[0-9]+]] = inttoptr i64 [[ZEXT]] to i64 addrspace(256)*
 // CHECK-X64:   [[VALUE:%[0-9]+]] = load volatile i64, i64 addrspace(256)* [[PTR]], align 8
@@ -98,13 +98,13 @@ long long test__readgsqword(unsigned lon
 __int64 test__mulh(__int64 a, __int64 b) {
   return __mulh(a, b);
 }
-// CHECK-X64-LABEL: define i64 @test__mulh(i64 %a, i64 %b)
+// CHECK-X64-LABEL: define dso_local i64 @test__mulh(i64 %a, i64 %b)
 // CHECK-X64: = mul nsw i128 %
 
 unsigned __int64 test__umulh(unsigned __int64 a, unsigned __int64 b) {
   return __umulh(a, b);
 }
-// CHECK-X64-LABEL: define i64 @test__umulh(i64 %a, i64 %b)
+// CHECK-X64-LABEL: define dso_local i64 @test__umulh(i64 %a, i64 %b)
 // CHECK-X64: = mul nuw i128 %
 
 __int64 test_mul128(__int64 Multiplier,
@@ -112,7 +112,7 @@ __int64 test_mul128(__int64 Multiplier,
                     __int64 *HighProduct) {
   return _mul128(Multiplier, Multiplicand, HighProduct);
 }
-// CHECK-X64-LABEL: define i64 @test_mul128(i64 %Multiplier, i64 %Multiplicand, i64*{{[a-z_ ]*}}%HighProduct)
+// CHECK-X64-LABEL: define dso_local i64 @test_mul128(i64 %Multiplier, i64 %Multiplicand, i64*{{[a-z_ ]*}}%HighProduct)
 // CHECK-X64: = sext i64 %Multiplier to i128
 // CHECK-X64: = sext i64 %Multiplicand to i128
 // CHECK-X64: = mul nsw i128 %
@@ -124,7 +124,7 @@ unsigned __int64 test_umul128(unsigned _
                               unsigned __int64 *HighProduct) {
   return _umul128(Multiplier, Multiplicand, HighProduct);
 }
-// CHECK-X64-LABEL: define i64 @test_umul128(i64 %Multiplier, i64 %Multiplicand, i64*{{[a-z_ ]*}}%HighProduct)
+// CHECK-X64-LABEL: define dso_local i64 @test_umul128(i64 %Multiplier, i64 %Multiplicand, i64*{{[a-z_ ]*}}%HighProduct)
 // CHECK-X64: = zext i64 %Multiplier to i128
 // CHECK-X64: = zext i64 %Multiplicand to i128
 // CHECK-X64: = mul nuw i128 %

Modified: cfe/trunk/test/CodeGen/ms_abi.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms_abi.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms_abi.c (original)
+++ cfe/trunk/test/CodeGen/ms_abi.c Fri Feb 23 11:30:48 2018
@@ -13,7 +13,7 @@ void __attribute__((ms_abi)) f1(void);
 void __attribute__((sysv_abi)) f2(void);
 void f3(void) {
   // FREEBSD-LABEL: define void @f3()
-  // WIN64-LABEL: define void @f3()
+  // WIN64-LABEL: define dso_local void @f3()
   f1();
   // FREEBSD: call win64cc void @f1()
   // WIN64: call void @f1()
@@ -23,13 +23,13 @@ void f3(void) {
 }
 // FREEBSD: declare win64cc void @f1()
 // FREEBSD: declare void @f2()
-// WIN64: declare void @f1()
-// WIN64: declare x86_64_sysvcc void @f2()
+// WIN64: declare dso_local void @f1()
+// WIN64: declare dso_local x86_64_sysvcc void @f2()
 
 // Win64 ABI varargs
 void __attribute__((ms_abi)) f4(int a, ...) {
   // FREEBSD-LABEL: define win64cc void @f4
-  // WIN64-LABEL: define void @f4
+  // WIN64-LABEL: define dso_local void @f4
   __builtin_ms_va_list ap;
   __builtin_ms_va_start(ap, a);
   // FREEBSD: %[[AP:.*]] = alloca i8*
@@ -79,7 +79,7 @@ void __attribute__((ms_abi)) f4(int a, .
 
 // Let's verify that normal va_lists work right on Win64, too.
 void f5(int a, ...) {
-  // WIN64-LABEL: define void @f5
+  // WIN64-LABEL: define dso_local void @f5
   __builtin_va_list ap;
   __builtin_va_start(ap, a);
   // WIN64: %[[AP:.*]] = alloca i8*
@@ -110,7 +110,7 @@ void f5(int a, ...) {
 void __attribute__((sysv_abi)) f6(__builtin_ms_va_list ap) {
   // FREEBSD-LABEL: define void @f6
   // FREEBSD: store i8* %ap, i8** %[[AP:.*]]
-  // WIN64-LABEL: define x86_64_sysvcc void @f6
+  // WIN64-LABEL: define dso_local x86_64_sysvcc void @f6
   // WIN64: store i8* %ap, i8** %[[AP:.*]]
   int b = __builtin_va_arg(ap, int);
   // FREEBSD: %[[AP_CUR:.*]] = load i8*, i8** %[[AP]]
@@ -155,7 +155,7 @@ struct i128 {
 };
 
 __attribute__((ms_abi)) struct i128 f7(struct i128 a) {
-  // WIN64: define void @f7(%struct.i128* noalias sret %agg.result, %struct.i128* %a)
+  // WIN64: define dso_local void @f7(%struct.i128* noalias sret %agg.result, %struct.i128* %a)
   // FREEBSD: define win64cc void @f7(%struct.i128* noalias sret %agg.result, %struct.i128* %a)
   return a;
 }

Modified: cfe/trunk/test/CodeGen/ms_abi_aarch64.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms_abi_aarch64.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms_abi_aarch64.c (original)
+++ cfe/trunk/test/CodeGen/ms_abi_aarch64.c Fri Feb 23 11:30:48 2018
@@ -5,7 +5,7 @@ void __attribute__((ms_abi)) f1(void);
 void f2(void);
 void f3(void) {
   // LINUX-LABEL: define void @f3()
-  // WIN64-LABEL: define void @f3()
+  // WIN64-LABEL: define dso_local void @f3()
   f1();
   // LINUX: call win64cc void @f1()
   // WIN64: call void @f1()
@@ -15,13 +15,13 @@ void f3(void) {
 }
 // LINUX: declare win64cc void @f1()
 // LINUX: declare void @f2()
-// WIN64: declare void @f1()
-// WIN64: declare void @f2()
+// WIN64: declare dso_local void @f1()
+// WIN64: declare dso_local void @f2()
 
 // Win64 ABI varargs
 void __attribute__((ms_abi)) f4(int a, ...) {
   // LINUX-LABEL: define win64cc void @f4
-  // WIN64-LABEL: define void @f4
+  // WIN64-LABEL: define dso_local void @f4
   __builtin_ms_va_list ap;
   __builtin_ms_va_start(ap, a);
   // LINUX: %[[AP:.*]] = alloca i8*
@@ -50,7 +50,7 @@ void __attribute__((ms_abi)) f4(int a, .
 
 // Let's verify that normal va_lists work right on Win64, too.
 void f5(int a, ...) {
-  // WIN64-LABEL: define void @f5
+  // WIN64-LABEL: define dso_local void @f5
   __builtin_va_list ap;
   __builtin_va_start(ap, a);
   // WIN64: %[[AP:.*]] = alloca i8*

Modified: cfe/trunk/test/CodeGen/ms_this.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms_this.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms_this.cpp (original)
+++ cfe/trunk/test/CodeGen/ms_this.cpp Fri Feb 23 11:30:48 2018
@@ -13,7 +13,7 @@ public:
   void runc();
 };
 
-// CHECK: define void @"\01?runc at t2@@
+// CHECK: define dso_local void @"\01?runc at t2@@
 void t2::runc() {
   double num = 0;
   __asm {
@@ -26,7 +26,7 @@ void t2::runc() {
 	   };
 }
 
-// CHECK: define void @"\01?runc at t1@@
+// CHECK: define dso_local void @"\01?runc at t1@@
 void t1::runc() {
   double num = 0;
   __asm {
@@ -41,7 +41,7 @@ void t1::runc() {
 
 struct s {
   int a;
-  // CHECK: define linkonce_odr void @"\01?func at s@@
+  // CHECK: define linkonce_odr dso_local void @"\01?func at s@@
   void func() {
     __asm mov rax, [this]
     // CHECK: [[THIS_ADDR_S:%.+]] = alloca %struct.s*

Modified: cfe/trunk/test/CodeGen/no-common.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/no-common.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/no-common.c (original)
+++ cfe/trunk/test/CodeGen/no-common.c Fri Feb 23 11:30:48 2018
@@ -1,15 +1,15 @@
 // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-DEFAULT
 // RUN: %clang_cc1 %s -fno-common -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-NOCOMMON
 
-// CHECK-DEFAULT: @x = common global
-// CHECK-NOCOMMON: @x = global
+// CHECK-DEFAULT: @x = common {{(dso_local )?}}global
+// CHECK-NOCOMMON: @x = {{(dso_local )?}}global
 int x;
 
-// CHECK-DEFAULT: @ABC = global
-// CHECK-NOCOMMON: @ABC = global
+// CHECK-DEFAULT: @ABC = {{(dso_local )?}}global
+// CHECK-NOCOMMON: @ABC = {{(dso_local )?}}global
 typedef void* (*fn_t)(long a, long b, char *f, int c);
 fn_t ABC __attribute__ ((nocommon));
 
-// CHECK-DEFAULT: @y = common global
-// CHECK-NOCOMMON: @y = common global
+// CHECK-DEFAULT: @y = common {{(dso_local )?}}global
+// CHECK-NOCOMMON: @y = common {{(dso_local )?}}global
 int y __attribute__((common));

Modified: cfe/trunk/test/CodeGen/overloadable.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/overloadable.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/overloadable.c (original)
+++ cfe/trunk/test/CodeGen/overloadable.c Fri Feb 23 11:30:48 2018
@@ -41,7 +41,7 @@ void addrof_single(int *a) __attribute__
 void addrof_single(char *a) __attribute__((overloadable, enable_if(0, "")));
 void addrof_single(char *a) __attribute__((overloadable));
 
-// CHECK-LABEL: define void @foo
+// CHECK-LABEL: define {{(dso_local )?}}void @foo
 void foo() {
   // CHECK: store void (i8*)* @_Z11addrof_manyPc
   void (*p1)(char *) = &addrof_many;
@@ -64,7 +64,7 @@ void foo() {
 void ovl_bar(char *) __attribute__((overloadable));
 void ovl_bar(int) __attribute__((overloadable));
 
-// CHECK-LABEL: define void @bar
+// CHECK-LABEL: define {{(dso_local )?}}void @bar
 void bar() {
   char charbuf[1];
   unsigned char ucharbuf[1];
@@ -79,7 +79,7 @@ void ovl_baz(int *, int) __attribute__((
 void ovl_baz(unsigned int *, unsigned int) __attribute__((overloadable));
 void ovl_baz2(int, int *) __attribute__((overloadable));
 void ovl_baz2(unsigned int, unsigned int *) __attribute__((overloadable));
-// CHECK-LABEL: define void @baz
+// CHECK-LABEL: define {{(dso_local )?}}void @baz
 void baz() {
   unsigned int j;
   // Initial rules for incompatible pointer conversions made this overload

Modified: cfe/trunk/test/CodeGen/pgo-sample-thinlto-summary.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/pgo-sample-thinlto-summary.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/pgo-sample-thinlto-summary.c (original)
+++ cfe/trunk/test/CodeGen/pgo-sample-thinlto-summary.c Fri Feb 23 11:30:48 2018
@@ -13,8 +13,8 @@ void foo(int n) {
     g += baz(i);
 }
 
-// SAMPLEPGO-LABEL: define void @bar
-// THINLTO-LABEL: define void @bar
+// SAMPLEPGO-LABEL: define {{(dso_local )?}}void @bar
+// THINLTO-LABEL: define {{(dso_local )?}}void @bar
 // SAMPLEPGO-NOT: call{{.*}}foo
 // THINLTO: call{{.*}}foo
 void bar(int n) {
@@ -23,8 +23,8 @@ void bar(int n) {
 }
 
 // Checks if loop unroll is invoked by normal compile, but not thinlto compile.
-// SAMPLEPGO-LABEL: define void @unroll
-// THINLTO-LABEL: define void @unroll
+// SAMPLEPGO-LABEL: define {{(dso_local )?}}void @unroll
+// THINLTO-LABEL: define {{(dso_local )?}}void @unroll
 // SAMPLEPGO: call{{.*}}baz
 // SAMPLEPGO: call{{.*}}baz
 // THINLTO: call{{.*}}baz
@@ -35,8 +35,8 @@ void unroll() {
 }
 
 // Checks that icp is not invoked for ThinLTO, but invoked for normal samplepgo.
-// SAMPLEPGO-LABEL: define void @icp
-// THINLTO-LABEL: define void @icp
+// SAMPLEPGO-LABEL: define {{(dso_local )?}}void @icp
+// THINLTO-LABEL: define {{(dso_local )?}}void @icp
 // SAMPLEPGO: if.true.direct_targ
 // FIXME: the following condition needs to be reversed once
 //        LTOPreLinkDefaultPipeline is customized.

Modified: cfe/trunk/test/CodeGen/pr19841.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/pr19841.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/pr19841.cpp (original)
+++ cfe/trunk/test/CodeGen/pr19841.cpp Fri Feb 23 11:30:48 2018
@@ -12,7 +12,7 @@ class A {
   unsigned char _highlightColorTableVGA[];
   static const unsigned char b[];
 };
-// CHECK: [[Common_A_b:@[^ ]+]] = constant [1 x i8] zeroinitializer
+// CHECK: [[Common_A_b:@[^ ]+]] = {{(dso_local )?}}constant [1 x i8] zeroinitializer
 class B {
 public:
   Common::RenderMode _configRenderMode;

Modified: cfe/trunk/test/CodeGen/pr4349.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/pr4349.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/pr4349.c (original)
+++ cfe/trunk/test/CodeGen/pr4349.c Fri Feb 23 11:30:48 2018
@@ -16,22 +16,22 @@ struct svar
 {
     void *ptr;
 };
-// CHECK: @svars1 = global [1 x %struct.svar] [%struct.svar { i8* bitcast (%struct.cpu* @cpu to i8*) }]
+// CHECK: @svars1 = {{(dso_local )?}}global [1 x %struct.svar] [%struct.svar { i8* bitcast (%struct.cpu* @cpu to i8*) }]
 struct svar svars1[] =
 {
     { &((cpu.pc).w[0]) }
 };
-// CHECK: @svars2 = global [1 x %struct.svar] [%struct.svar { i8* getelementptr (i8, i8* bitcast (%struct.cpu* @cpu to i8*), i64 1) }]
+// CHECK: @svars2 = {{(dso_local )?}}global [1 x %struct.svar] [%struct.svar { i8* getelementptr (i8, i8* bitcast (%struct.cpu* @cpu to i8*), i64 1) }]
 struct svar svars2[] =
 {
     { &((cpu.pc).b[0][1]) }
 };
-// CHECK: @svars3 = global [1 x %struct.svar] [%struct.svar { i8* getelementptr (i8, i8* bitcast (%struct.cpu* @cpu to i8*), i64 2) }]
+// CHECK: @svars3 = {{(dso_local )?}}global [1 x %struct.svar] [%struct.svar { i8* getelementptr (i8, i8* bitcast (%struct.cpu* @cpu to i8*), i64 2) }]
 struct svar svars3[] =
 {
     { &((cpu.pc).w[1]) }
 };
-// CHECK: @svars4 = global [1 x %struct.svar] [%struct.svar { i8* getelementptr (i8, i8* bitcast (%struct.cpu* @cpu to i8*), i64 3) }]
+// CHECK: @svars4 = {{(dso_local )?}}global [1 x %struct.svar] [%struct.svar { i8* getelementptr (i8, i8* bitcast (%struct.cpu* @cpu to i8*), i64 3) }]
 struct svar svars4[] =
 {
     { &((cpu.pc).b[1][1]) }

Modified: cfe/trunk/test/CodeGen/preserve-call-conv.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/preserve-call-conv.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/preserve-call-conv.c (original)
+++ cfe/trunk/test/CodeGen/preserve-call-conv.c Fri Feb 23 11:30:48 2018
@@ -8,13 +8,13 @@
 // is lowered to the corresponding calling convention attrribute at the LLVM IR
 // level.
 void foo() __attribute__((preserve_most)) {
-  // CHECK-LABEL: define preserve_mostcc void @foo()
+  // CHECK-LABEL: define {{(dso_local )?}}preserve_mostcc void @foo()
 }
 
 // Check that the preserve_most calling convention attribute at the source level
 // is lowered to the corresponding calling convention attrribute at the LLVM IR
 // level.
 void boo() __attribute__((preserve_all)) {
-  // CHECK-LABEL: define preserve_allcc void @boo()
+  // CHECK-LABEL: define {{(dso_local )?}}preserve_allcc void @boo()
 }
 

Modified: cfe/trunk/test/CodeGen/regcall.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/regcall.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/regcall.c (original)
+++ cfe/trunk/test/CodeGen/regcall.c Fri Feb 23 11:30:48 2018
@@ -6,34 +6,34 @@
 #include <xmmintrin.h>
 
 void __regcall v1(int a, int b) {}
-// Win32: define x86_regcallcc void @__regcall3__v1(i32 inreg %a, i32 inreg %b)
-// Win64: define x86_regcallcc void @__regcall3__v1(i32 %a, i32 %b)
+// Win32: define dso_local x86_regcallcc void @__regcall3__v1(i32 inreg %a, i32 inreg %b)
+// Win64: define dso_local x86_regcallcc void @__regcall3__v1(i32 %a, i32 %b)
 // Lin32: define x86_regcallcc void @__regcall3__v1(i32 inreg %a, i32 inreg %b)
 // Lin64: define x86_regcallcc void @__regcall3__v1(i32 %a, i32 %b)
 
 void __attribute__((regcall)) v1b(int a, int b) {}
-// Win32: define x86_regcallcc void @__regcall3__v1b(i32 inreg %a, i32 inreg %b)
-// Win64: define x86_regcallcc void @__regcall3__v1b(i32 %a, i32 %b)
+// Win32: define dso_local x86_regcallcc void @__regcall3__v1b(i32 inreg %a, i32 inreg %b)
+// Win64: define dso_local x86_regcallcc void @__regcall3__v1b(i32 %a, i32 %b)
 // Lin32: define x86_regcallcc void @__regcall3__v1b(i32 inreg %a, i32 inreg %b)
 // Lin64: define x86_regcallcc void @__regcall3__v1b(i32 %a, i32 %b)
 
 void __regcall v2(char a, char b) {}
-// Win32: define x86_regcallcc void @__regcall3__v2(i8 inreg signext %a, i8 inreg signext %b)
-// Win64: define x86_regcallcc void @__regcall3__v2(i8 %a, i8 %b)
+// Win32: define dso_local x86_regcallcc void @__regcall3__v2(i8 inreg signext %a, i8 inreg signext %b)
+// Win64: define dso_local x86_regcallcc void @__regcall3__v2(i8 %a, i8 %b)
 // Lin32: define x86_regcallcc void @__regcall3__v2(i8 inreg signext %a, i8 inreg signext %b)
 // Lin64: define x86_regcallcc void @__regcall3__v2(i8 signext %a, i8 signext %b)
 
 struct Small { int x; };
 void __regcall v3(int a, struct Small b, int c) {}
-// Win32: define x86_regcallcc void @__regcall3__v3(i32 inreg %a, i32 %b.0, i32 inreg %c)
-// Win64: define x86_regcallcc void @__regcall3__v3(i32 %a, i32 %b.coerce, i32 %c)
+// Win32: define dso_local x86_regcallcc void @__regcall3__v3(i32 inreg %a, i32 %b.0, i32 inreg %c)
+// Win64: define dso_local x86_regcallcc void @__regcall3__v3(i32 %a, i32 %b.coerce, i32 %c)
 // Lin32: define x86_regcallcc void @__regcall3__v3(i32 inreg %a, i32 inreg, i32 %b.0, i32 inreg %c)
 // Lin64: define x86_regcallcc void @__regcall3__v3(i32 %a, i32 %b.coerce, i32 %c)
 
 struct Large { int a[5]; };
 void __regcall v4(int a, struct Large b, int c) {}
-// Win32: define x86_regcallcc void @__regcall3__v4(i32 inreg %a, %struct.Large* byval align 4 %b, i32 inreg %c)
-// Win64: define x86_regcallcc void @__regcall3__v4(i32 %a, %struct.Large* %b, i32 %c)
+// Win32: define dso_local x86_regcallcc void @__regcall3__v4(i32 inreg %a, %struct.Large* byval align 4 %b, i32 inreg %c)
+// Win64: define dso_local x86_regcallcc void @__regcall3__v4(i32 %a, %struct.Large* %b, i32 %c)
 // Lin32: define x86_regcallcc void @__regcall3__v4(i32 inreg %a, %struct.Large* byval align 4 %b, i32 %c)
 // Lin64: define x86_regcallcc void @__regcall3__v4(i32 %a, [5 x i32] %b.coerce, i32 %c)
 
@@ -42,8 +42,8 @@ struct HFA4 { double w, x, y, z; };
 struct HFA5 { double v, w, x, y, z; };
 
 void __regcall hfa1(int a, struct HFA4 b, int c) {}
-// Win32: define x86_regcallcc void @__regcall3__hfa1(i32 inreg %a, double %b.0, double %b.1, double %b.2, double %b.3, i32 inreg %c)
-// Win64: define x86_regcallcc void @__regcall3__hfa1(i32 %a, double %b.0, double %b.1, double %b.2, double %b.3, i32 %c)
+// Win32: define dso_local x86_regcallcc void @__regcall3__hfa1(i32 inreg %a, double %b.0, double %b.1, double %b.2, double %b.3, i32 inreg %c)
+// Win64: define dso_local x86_regcallcc void @__regcall3__hfa1(i32 %a, double %b.0, double %b.1, double %b.2, double %b.3, i32 %c)
 // Lin32: define x86_regcallcc void @__regcall3__hfa1(i32 inreg %a, double %b.0, double %b.1, double %b.2, double %b.3, i32 inreg %c)
 // Lin64: define x86_regcallcc void @__regcall3__hfa1(i32 %a, double %b.coerce0, double %b.coerce1, double %b.coerce2, double %b.coerce3, i32 %c)
 
@@ -51,16 +51,16 @@ void __regcall hfa1(int a, struct HFA4 b
 // indirectly. Additional vector arguments can consume the rest of the SSE
 // registers.
 void __regcall hfa2(struct HFA4 a, struct HFA4 b, double c) {}
-// Win32: define x86_regcallcc void @__regcall3__hfa2(double %a.0, double %a.1, double %a.2, double %a.3, double %b.0, double %b.1, double %b.2, double %b.3, double* inreg)
-// Win64: define x86_regcallcc void @__regcall3__hfa2(double %a.0, double %a.1, double %a.2, double %a.3, double %b.0, double %b.1, double %b.2, double %b.3, double %c)
+// Win32: define dso_local x86_regcallcc void @__regcall3__hfa2(double %a.0, double %a.1, double %a.2, double %a.3, double %b.0, double %b.1, double %b.2, double %b.3, double* inreg)
+// Win64: define dso_local x86_regcallcc void @__regcall3__hfa2(double %a.0, double %a.1, double %a.2, double %a.3, double %b.0, double %b.1, double %b.2, double %b.3, double %c)
 // Lin32: define x86_regcallcc void @__regcall3__hfa2(double %a.0, double %a.1, double %a.2, double %a.3, double %b.0, double %b.1, double %b.2, double %b.3, double* inreg)
 // Lin64: define x86_regcallcc void @__regcall3__hfa2(double %a.coerce0, double %a.coerce1, double %a.coerce2, double %a.coerce3, double %b.coerce0, double %b.coerce1, double %b.coerce2, double %b.coerce3, double %c)
 
 // Ensure that we pass builtin types directly while counting them against the
 // SSE register usage.
 void __regcall hfa3(double a, double b, double c, double d, double e, struct HFA2 f) {}
-// Win32: define x86_regcallcc void @__regcall3__hfa3(double %a, double %b, double %c, double %d, double %e, double %f.0, double %f.1)
-// Win64: define x86_regcallcc void @__regcall3__hfa3(double %a, double %b, double %c, double %d, double %e, double %f.0, double %f.1)
+// Win32: define dso_local x86_regcallcc void @__regcall3__hfa3(double %a, double %b, double %c, double %d, double %e, double %f.0, double %f.1)
+// Win64: define dso_local x86_regcallcc void @__regcall3__hfa3(double %a, double %b, double %c, double %d, double %e, double %f.0, double %f.1)
 // Lin32: define x86_regcallcc void @__regcall3__hfa3(double %a, double %b, double %c, double %d, double %e, double %f.0, double %f.1)
 // Lin64: define x86_regcallcc void @__regcall3__hfa3(double %a, double %b, double %c, double %d, double %e, double %f.coerce0, double %f.coerce1)
 
@@ -68,16 +68,16 @@ void __regcall hfa3(double a, double b,
 // Because they are not classified as homogeneous, they don't get special
 // handling to ensure alignment.
 void __regcall hfa4(struct HFA5 a) {}
-// Win32: define x86_regcallcc void @__regcall3__hfa4(%struct.HFA5* byval align 4)
-// Win64: define x86_regcallcc void @__regcall3__hfa4(%struct.HFA5* %a)
+// Win32: define dso_local x86_regcallcc void @__regcall3__hfa4(%struct.HFA5* byval align 4)
+// Win64: define dso_local x86_regcallcc void @__regcall3__hfa4(%struct.HFA5* %a)
 // Lin32: define x86_regcallcc void @__regcall3__hfa4(%struct.HFA5* byval align 4 %a)
 // Lin64: define x86_regcallcc void @__regcall3__hfa4(double %a.coerce0, double %a.coerce1, double %a.coerce2, double %a.coerce3, double %a.coerce4)
 
 // Return HFAs of 4 or fewer elements in registers.
 static struct HFA2 g_hfa2;
 struct HFA2 __regcall hfa5(void) { return g_hfa2; }
-// Win32: define x86_regcallcc %struct.HFA2 @__regcall3__hfa5()
-// Win64: define x86_regcallcc %struct.HFA2 @__regcall3__hfa5()
+// Win32: define dso_local x86_regcallcc %struct.HFA2 @__regcall3__hfa5()
+// Win64: define dso_local x86_regcallcc %struct.HFA2 @__regcall3__hfa5()
 // Lin32: define x86_regcallcc %struct.HFA2 @__regcall3__hfa5()
 // Lin64: define x86_regcallcc %struct.HFA2 @__regcall3__hfa5()
 
@@ -86,20 +86,20 @@ struct HVA2 { v4f32 x, y; };
 struct HVA4 { v4f32 w, x, y, z; };
 
 void __regcall hva1(int a, struct HVA4 b, int c) {}
-// Win32: define x86_regcallcc void @__regcall3__hva1(i32 inreg %a, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, i32 inreg %c)
-// Win64: define x86_regcallcc void @__regcall3__hva1(i32 %a, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, i32 %c)
+// Win32: define dso_local x86_regcallcc void @__regcall3__hva1(i32 inreg %a, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, i32 inreg %c)
+// Win64: define dso_local x86_regcallcc void @__regcall3__hva1(i32 %a, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, i32 %c)
 // Lin32: define x86_regcallcc void @__regcall3__hva1(i32 inreg %a, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, i32 inreg %c)
 // Lin64: define x86_regcallcc void @__regcall3__hva1(i32 %a, <4 x float> %b.coerce0, <4 x float> %b.coerce1, <4 x float> %b.coerce2, <4 x float> %b.coerce3, i32 %c)
 
 void __regcall hva2(struct HVA4 a, struct HVA4 b, v4f32 c) {}
-// Win32: define x86_regcallcc void @__regcall3__hva2(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, <4 x float>* inreg)
-// Win64: define x86_regcallcc void @__regcall3__hva2(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, <4 x float> %c)
+// Win32: define dso_local x86_regcallcc void @__regcall3__hva2(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, <4 x float>* inreg)
+// Win64: define dso_local x86_regcallcc void @__regcall3__hva2(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, <4 x float> %c)
 // Lin32: define x86_regcallcc void @__regcall3__hva2(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, <4 x float>* inreg)
 // Lin64: define x86_regcallcc void @__regcall3__hva2(<4 x float> %a.coerce0, <4 x float> %a.coerce1, <4 x float> %a.coerce2, <4 x float> %a.coerce3, <4 x float> %b.coerce0, <4 x float> %b.coerce1, <4 x float> %b.coerce2, <4 x float> %b.coerce3, <4 x float> %c)
 
 void __regcall hva3(v4f32 a, v4f32 b, v4f32 c, v4f32 d, v4f32 e, struct HVA2 f) {}
-// Win32: define x86_regcallcc void @__regcall3__hva3(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, <4 x float> %e, <4 x float> %f.0, <4 x float> %f.1)
-// Win64: define x86_regcallcc void @__regcall3__hva3(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, <4 x float> %e, <4 x float> %f.0, <4 x float> %f.1)
+// Win32: define dso_local x86_regcallcc void @__regcall3__hva3(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, <4 x float> %e, <4 x float> %f.0, <4 x float> %f.1)
+// Win64: define dso_local x86_regcallcc void @__regcall3__hva3(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, <4 x float> %e, <4 x float> %f.0, <4 x float> %f.1)
 // Lin32: define x86_regcallcc void @__regcall3__hva3(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, <4 x float> %e, <4 x float> %f.0, <4 x float> %f.1)
 // Lin64: define x86_regcallcc void @__regcall3__hva3(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, <4 x float> %e, <4 x float> %f.coerce0, <4 x float> %f.coerce1)
 
@@ -107,14 +107,14 @@ typedef float __attribute__((ext_vector_
 struct OddSizeHVA { v3f32 x, y; };
 
 void __regcall odd_size_hva(struct OddSizeHVA a) {}
-// Win32: define x86_regcallcc void @__regcall3__odd_size_hva(<3 x float> %a.0, <3 x float> %a.1)
-// Win64: define x86_regcallcc void @__regcall3__odd_size_hva(<3 x float> %a.0, <3 x float> %a.1)
+// Win32: define dso_local x86_regcallcc void @__regcall3__odd_size_hva(<3 x float> %a.0, <3 x float> %a.1)
+// Win64: define dso_local x86_regcallcc void @__regcall3__odd_size_hva(<3 x float> %a.0, <3 x float> %a.1)
 // Lin32: define x86_regcallcc void @__regcall3__odd_size_hva(<3 x float> %a.0, <3 x float> %a.1)
 // Lin64: define x86_regcallcc void @__regcall3__odd_size_hva(<3 x float> %a.coerce0, <3 x float> %a.coerce1)
 
 struct HFA6 { __m128 f[4]; };
 struct HFA6 __regcall ret_reg_reused(struct HFA6 a, struct HFA6 b, struct HFA6 c, struct HFA6 d){ struct HFA6 h; return h;}
-// Win32: define x86_regcallcc %struct.HFA6 @__regcall3__ret_reg_reused(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, %struct.HFA6* inreg %c, %struct.HFA6* inreg %d)
-// Win64: define x86_regcallcc %struct.HFA6 @__regcall3__ret_reg_reused(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, <4 x float> %c.0, <4 x float> %c.1, <4 x float> %c.2, <4 x float> %c.3, <4 x float> %d.0, <4 x float> %d.1, <4 x float> %d.2, <4 x float> %d.3)
+// Win32: define dso_local x86_regcallcc %struct.HFA6 @__regcall3__ret_reg_reused(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, %struct.HFA6* inreg %c, %struct.HFA6* inreg %d)
+// Win64: define dso_local x86_regcallcc %struct.HFA6 @__regcall3__ret_reg_reused(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, <4 x float> %c.0, <4 x float> %c.1, <4 x float> %c.2, <4 x float> %c.3, <4 x float> %d.0, <4 x float> %d.1, <4 x float> %d.2, <4 x float> %d.3)
 // Lin32: define x86_regcallcc %struct.HFA6 @__regcall3__ret_reg_reused(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, %struct.HFA6* inreg %c, %struct.HFA6* inreg %d)
 // Lin64: define x86_regcallcc %struct.HFA6 @__regcall3__ret_reg_reused([4 x <4 x float>] %a.coerce, [4 x <4 x float>] %b.coerce, [4 x <4 x float>] %c.coerce, [4 x <4 x float>] %d.coerce)

Modified: cfe/trunk/test/CodeGen/tentative-decls.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/tentative-decls.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/tentative-decls.c (original)
+++ cfe/trunk/test/CodeGen/tentative-decls.c Fri Feb 23 11:30:48 2018
@@ -1,16 +1,16 @@
 // RUN: %clang_cc1 -emit-llvm -w -o - %s | FileCheck %s
 
-// CHECK-DAG: @r = common global [1 x {{.*}}] zeroinitializer
+// CHECK-DAG: @r = common {{(dso_local )?}}global [1 x {{.*}}] zeroinitializer
 
 int r[];
 int (*a)[] = &r;
 
 struct s0;
 struct s0 x;
-// CHECK-DAG: @x = common global %struct.s0 zeroinitializer
+// CHECK-DAG: @x = common {{(dso_local )?}}global %struct.s0 zeroinitializer
 
 struct s0 y;
-// CHECK-DAG: @y = common global %struct.s0 zeroinitializer
+// CHECK-DAG: @y = common {{(dso_local )?}}global %struct.s0 zeroinitializer
 struct s0 *f0() {
   return &y;
 }
@@ -19,14 +19,14 @@ struct s0 {
   int x;
 };
 
-// CHECK-DAG: @b = common global [1 x {{.*}}] zeroinitializer
+// CHECK-DAG: @b = common {{(dso_local )?}}global [1 x {{.*}}] zeroinitializer
 int b[];
 int *f1() {
   return b;
 }
 
 // Check that the most recent tentative definition wins.
-// CHECK-DAG: @c = common global [4 x {{.*}}] zeroinitializer
+// CHECK-DAG: @c = common {{(dso_local )?}}global [4 x {{.*}}] zeroinitializer
 int c[];
 int c[4];
 

Modified: cfe/trunk/test/CodeGen/variadic-null-win64.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/variadic-null-win64.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/variadic-null-win64.c (original)
+++ cfe/trunk/test/CodeGen/variadic-null-win64.c Fri Feb 23 11:30:48 2018
@@ -15,7 +15,7 @@ void f(const char *f) {
   v(f, 1, 2, 3, NULL);
   kr(f, 1, 2, 3, 0);
 }
-// WINDOWS: define void @f(i8* %f)
+// WINDOWS: define dso_local void @f(i8* %f)
 // WINDOWS: call void (i8*, ...) @v(i8* {{.*}}, i32 1, i32 2, i32 3, i64 0)
 // WINDOWS: call void bitcast (void (...)* @kr to void (i8*, i32, i32, i32, i32)*)(i8* {{.*}}, i32 1, i32 2, i32 3, i32 0)
 // LINUX: define void @f(i8* %f)

Modified: cfe/trunk/test/CodeGen/vectorcall.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/vectorcall.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/vectorcall.c (original)
+++ cfe/trunk/test/CodeGen/vectorcall.c Fri Feb 23 11:30:48 2018
@@ -2,56 +2,56 @@
 // RUN: %clang_cc1 -emit-llvm %s -o - -ffreestanding -triple=x86_64-pc-win32     | FileCheck %s --check-prefix=X64
 
 void __vectorcall v1(int a, int b) {}
-// X32: define x86_vectorcallcc void @"\01v1@@8"(i32 inreg %a, i32 inreg %b)
-// X64: define x86_vectorcallcc void @"\01v1@@16"(i32 %a, i32 %b)
+// X32: define dso_local x86_vectorcallcc void @"\01v1@@8"(i32 inreg %a, i32 inreg %b)
+// X64: define dso_local x86_vectorcallcc void @"\01v1@@16"(i32 %a, i32 %b)
 
 void __vectorcall v2(char a, char b) {}
-// X32: define x86_vectorcallcc void @"\01v2@@8"(i8 inreg signext %a, i8 inreg signext %b)
-// X64: define x86_vectorcallcc void @"\01v2@@16"(i8 %a, i8 %b)
+// X32: define dso_local x86_vectorcallcc void @"\01v2@@8"(i8 inreg signext %a, i8 inreg signext %b)
+// X64: define dso_local x86_vectorcallcc void @"\01v2@@16"(i8 %a, i8 %b)
 
 struct Small { int x; };
 void __vectorcall v3(int a, struct Small b, int c) {}
-// X32: define x86_vectorcallcc void @"\01v3@@12"(i32 inreg %a, i32 %b.0, i32 inreg %c)
-// X64: define x86_vectorcallcc void @"\01v3@@24"(i32 %a, i32 %b.coerce, i32 %c)
+// X32: define dso_local x86_vectorcallcc void @"\01v3@@12"(i32 inreg %a, i32 %b.0, i32 inreg %c)
+// X64: define dso_local x86_vectorcallcc void @"\01v3@@24"(i32 %a, i32 %b.coerce, i32 %c)
 
 struct Large { int a[5]; };
 void __vectorcall v4(int a, struct Large b, int c) {}
-// X32: define x86_vectorcallcc void @"\01v4@@28"(i32 inreg %a, %struct.Large* byval align 4 %b, i32 inreg %c)
-// X64: define x86_vectorcallcc void @"\01v4@@40"(i32 %a, %struct.Large* %b, i32 %c)
+// X32: define dso_local x86_vectorcallcc void @"\01v4@@28"(i32 inreg %a, %struct.Large* byval align 4 %b, i32 inreg %c)
+// X64: define dso_local x86_vectorcallcc void @"\01v4@@40"(i32 %a, %struct.Large* %b, i32 %c)
 
 struct HFA2 { double x, y; };
 struct HFA4 { double w, x, y, z; };
 struct HFA5 { double v, w, x, y, z; };
 
 void __vectorcall hfa1(int a, struct HFA4 b, int c) {}
-// X32: define x86_vectorcallcc void @"\01hfa1@@40"(i32 inreg %a, %struct.HFA4 inreg %b.coerce, i32 inreg %c)
-// X64: define x86_vectorcallcc void @"\01hfa1@@48"(i32 %a, %struct.HFA4 inreg %b.coerce, i32 %c)
+// X32: define dso_local x86_vectorcallcc void @"\01hfa1@@40"(i32 inreg %a, %struct.HFA4 inreg %b.coerce, i32 inreg %c)
+// X64: define dso_local x86_vectorcallcc void @"\01hfa1@@48"(i32 %a, %struct.HFA4 inreg %b.coerce, i32 %c)
 
 // HFAs that would require more than six total SSE registers are passed
 // indirectly. Additional vector arguments can consume the rest of the SSE
 // registers.
 void __vectorcall hfa2(struct HFA4 a, struct HFA4 b, double c) {}
-// X32: define x86_vectorcallcc void @"\01hfa2@@72"(%struct.HFA4 inreg %a.coerce, %struct.HFA4* inreg %b, double %c)
-// X64: define x86_vectorcallcc void @"\01hfa2@@72"(%struct.HFA4 inreg %a.coerce, %struct.HFA4* %b, double %c)
+// X32: define dso_local x86_vectorcallcc void @"\01hfa2@@72"(%struct.HFA4 inreg %a.coerce, %struct.HFA4* inreg %b, double %c)
+// X64: define dso_local x86_vectorcallcc void @"\01hfa2@@72"(%struct.HFA4 inreg %a.coerce, %struct.HFA4* %b, double %c)
 
 // Ensure that we pass builtin types directly while counting them against the
 // SSE register usage.
 void __vectorcall hfa3(double a, double b, double c, double d, double e, struct HFA2 f) {}
-// X32: define x86_vectorcallcc void @"\01hfa3@@56"(double %a, double %b, double %c, double %d, double %e, %struct.HFA2* inreg %f)
-// X64: define x86_vectorcallcc void @"\01hfa3@@56"(double %a, double %b, double %c, double %d, double %e, %struct.HFA2* %f)
+// X32: define dso_local x86_vectorcallcc void @"\01hfa3@@56"(double %a, double %b, double %c, double %d, double %e, %struct.HFA2* inreg %f)
+// X64: define dso_local x86_vectorcallcc void @"\01hfa3@@56"(double %a, double %b, double %c, double %d, double %e, %struct.HFA2* %f)
 
 // Aggregates with more than four elements are not HFAs and are passed byval.
 // Because they are not classified as homogeneous, they don't get special
 // handling to ensure alignment.
 void __vectorcall hfa4(struct HFA5 a) {}
-// X32: define x86_vectorcallcc void @"\01hfa4@@40"(%struct.HFA5* byval align 4)
-// X64: define x86_vectorcallcc void @"\01hfa4@@40"(%struct.HFA5* %a)
+// X32: define dso_local x86_vectorcallcc void @"\01hfa4@@40"(%struct.HFA5* byval align 4)
+// X64: define dso_local x86_vectorcallcc void @"\01hfa4@@40"(%struct.HFA5* %a)
 
 // Return HFAs of 4 or fewer elements in registers.
 static struct HFA2 g_hfa2;
 struct HFA2 __vectorcall hfa5(void) { return g_hfa2; }
-// X32: define x86_vectorcallcc %struct.HFA2 @"\01hfa5@@0"()
-// X64: define x86_vectorcallcc %struct.HFA2 @"\01hfa5@@0"()
+// X32: define dso_local x86_vectorcallcc %struct.HFA2 @"\01hfa5@@0"()
+// X64: define dso_local x86_vectorcallcc %struct.HFA2 @"\01hfa5@@0"()
 
 typedef float __attribute__((vector_size(16))) v4f32;
 struct HVA2 { v4f32 x, y; };
@@ -60,52 +60,52 @@ struct HVA4 { v4f32 w, x, y, z; };
 struct HVA5 { v4f32 w, x, y, z, p; };
 
 v4f32 __vectorcall hva1(int a, struct HVA4 b, int c) {return b.w;}
-// X32: define x86_vectorcallcc <4 x float> @"\01hva1@@72"(i32 inreg %a, %struct.HVA4 inreg %b.coerce, i32 inreg %c)
-// X64: define x86_vectorcallcc <4 x float> @"\01hva1@@80"(i32 %a, %struct.HVA4 inreg %b.coerce, i32 %c)
+// X32: define dso_local x86_vectorcallcc <4 x float> @"\01hva1@@72"(i32 inreg %a, %struct.HVA4 inreg %b.coerce, i32 inreg %c)
+// X64: define dso_local x86_vectorcallcc <4 x float> @"\01hva1@@80"(i32 %a, %struct.HVA4 inreg %b.coerce, i32 %c)
 
 v4f32 __vectorcall hva2(struct HVA4 a, struct HVA4 b, v4f32 c) {return c;}
-// X32: define x86_vectorcallcc <4 x float> @"\01hva2@@144"(%struct.HVA4 inreg %a.coerce, %struct.HVA4* inreg %b, <4 x float> %c)
-// X64: define x86_vectorcallcc <4 x float> @"\01hva2@@144"(%struct.HVA4 inreg %a.coerce, %struct.HVA4* %b, <4 x float> %c)
+// X32: define dso_local x86_vectorcallcc <4 x float> @"\01hva2@@144"(%struct.HVA4 inreg %a.coerce, %struct.HVA4* inreg %b, <4 x float> %c)
+// X64: define dso_local x86_vectorcallcc <4 x float> @"\01hva2@@144"(%struct.HVA4 inreg %a.coerce, %struct.HVA4* %b, <4 x float> %c)
 
 v4f32 __vectorcall hva3(v4f32 a, v4f32 b, v4f32 c, v4f32 d, v4f32 e, struct HVA2 f) {return f.x;}
-// X32: define x86_vectorcallcc <4 x float> @"\01hva3@@112"(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, <4 x float> %e, %struct.HVA2* inreg %f)
-// X64: define x86_vectorcallcc <4 x float> @"\01hva3@@112"(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, <4 x float> %e, %struct.HVA2* %f)
+// X32: define dso_local x86_vectorcallcc <4 x float> @"\01hva3@@112"(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, <4 x float> %e, %struct.HVA2* inreg %f)
+// X64: define dso_local x86_vectorcallcc <4 x float> @"\01hva3@@112"(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, <4 x float> %e, %struct.HVA2* %f)
 
 // vector types have higher priority then HVA structures, So vector types are allocated first
 // and HVAs are allocated if enough registers are available
 v4f32 __vectorcall hva4(struct HVA4 a, struct HVA2 b, v4f32 c) {return b.y;}
-// X32: define x86_vectorcallcc <4 x float> @"\01hva4@@112"(%struct.HVA4 inreg %a.coerce, %struct.HVA2* inreg %b, <4 x float> %c)
-// X64: define x86_vectorcallcc <4 x float> @"\01hva4@@112"(%struct.HVA4 inreg %a.coerce, %struct.HVA2* %b, <4 x float> %c)
+// X32: define dso_local x86_vectorcallcc <4 x float> @"\01hva4@@112"(%struct.HVA4 inreg %a.coerce, %struct.HVA2* inreg %b, <4 x float> %c)
+// X64: define dso_local x86_vectorcallcc <4 x float> @"\01hva4@@112"(%struct.HVA4 inreg %a.coerce, %struct.HVA2* %b, <4 x float> %c)
 
 v4f32 __vectorcall hva5(struct HVA3 a, struct HVA3 b, v4f32 c, struct HVA2 d) {return d.y;}
-// X32: define x86_vectorcallcc <4 x float> @"\01hva5@@144"(%struct.HVA3 inreg %a.coerce, %struct.HVA3* inreg %b, <4 x float> %c, %struct.HVA2 inreg %d.coerce)
-// X64: define x86_vectorcallcc <4 x float> @"\01hva5@@144"(%struct.HVA3 inreg %a.coerce, %struct.HVA3* %b, <4 x float> %c, %struct.HVA2 inreg %d.coerce)
+// X32: define dso_local x86_vectorcallcc <4 x float> @"\01hva5@@144"(%struct.HVA3 inreg %a.coerce, %struct.HVA3* inreg %b, <4 x float> %c, %struct.HVA2 inreg %d.coerce)
+// X64: define dso_local x86_vectorcallcc <4 x float> @"\01hva5@@144"(%struct.HVA3 inreg %a.coerce, %struct.HVA3* %b, <4 x float> %c, %struct.HVA2 inreg %d.coerce)
 
 struct HVA4 __vectorcall hva6(struct HVA4 a, struct HVA4 b) { return b;}
-// X32: define x86_vectorcallcc %struct.HVA4 @"\01hva6@@128"(%struct.HVA4 inreg %a.coerce, %struct.HVA4* inreg %b)
-// X64: define x86_vectorcallcc %struct.HVA4 @"\01hva6@@128"(%struct.HVA4 inreg %a.coerce, %struct.HVA4* %b)
+// X32: define dso_local x86_vectorcallcc %struct.HVA4 @"\01hva6@@128"(%struct.HVA4 inreg %a.coerce, %struct.HVA4* inreg %b)
+// X64: define dso_local x86_vectorcallcc %struct.HVA4 @"\01hva6@@128"(%struct.HVA4 inreg %a.coerce, %struct.HVA4* %b)
 
 struct HVA5 __vectorcall hva7() {struct HVA5 a = {}; return a;}
-// X32: define x86_vectorcallcc void @"\01hva7@@0"(%struct.HVA5* inreg noalias sret %agg.result)
-// X64: define x86_vectorcallcc void @"\01hva7@@0"(%struct.HVA5* noalias sret %agg.result)
+// X32: define dso_local x86_vectorcallcc void @"\01hva7@@0"(%struct.HVA5* inreg noalias sret %agg.result)
+// X64: define dso_local x86_vectorcallcc void @"\01hva7@@0"(%struct.HVA5* noalias sret %agg.result)
 
 v4f32 __vectorcall hva8(v4f32 a, v4f32 b, v4f32 c, v4f32 d, int e, v4f32 f) {return f;}
-// X32: define x86_vectorcallcc <4 x float> @"\01hva8@@84"(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, i32 inreg %e, <4 x float> %f)
-// X64: define x86_vectorcallcc <4 x float> @"\01hva8@@88"(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, i32 %e, <4 x float> %f)
+// X32: define dso_local x86_vectorcallcc <4 x float> @"\01hva8@@84"(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, i32 inreg %e, <4 x float> %f)
+// X64: define dso_local x86_vectorcallcc <4 x float> @"\01hva8@@88"(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, i32 %e, <4 x float> %f)
 
 typedef float __attribute__((ext_vector_type(3))) v3f32;
 struct OddSizeHVA { v3f32 x, y; };
 
 void __vectorcall odd_size_hva(struct OddSizeHVA a) {}
-// X32: define x86_vectorcallcc void @"\01odd_size_hva@@32"(%struct.OddSizeHVA inreg %a.coerce)
-// X64: define x86_vectorcallcc void @"\01odd_size_hva@@32"(%struct.OddSizeHVA inreg %a.coerce)
+// X32: define dso_local x86_vectorcallcc void @"\01odd_size_hva@@32"(%struct.OddSizeHVA inreg %a.coerce)
+// X64: define dso_local x86_vectorcallcc void @"\01odd_size_hva@@32"(%struct.OddSizeHVA inreg %a.coerce)
 
 // The Vectorcall ABI only allows passing the first 6 items in registers in x64, so this shouldn't
 // consider 'p7' as a register.  Instead p5 gets put into the register on the second pass.
 // x86 should pass p2, p6 and p7 in registers, then p1 in the second pass.
 struct HFA2 __vectorcall AddParticles(struct HFA2 p1, float p2, struct HFA4 p3, int p4, struct HFA2 p5, float p6, float p7, int p8){ return p1;}
-// X32: define x86_vectorcallcc %struct.HFA2 @"\01AddParticles@@84"(%struct.HFA2 inreg %p1.coerce, float %p2, %struct.HFA4* inreg %p3, i32 inreg %p4, %struct.HFA2* %p5, float %p6, float %p7, i32 %p8)
-// X64: define x86_vectorcallcc %struct.HFA2 @"\01AddParticles@@104"(%struct.HFA2 inreg %p1.coerce, float %p2, %struct.HFA4* %p3, i32 %p4, %struct.HFA2 inreg %p5.coerce, float %p6, float %p7, i32 %p8)
+// X32: define dso_local x86_vectorcallcc %struct.HFA2 @"\01AddParticles@@84"(%struct.HFA2 inreg %p1.coerce, float %p2, %struct.HFA4* inreg %p3, i32 inreg %p4, %struct.HFA2* %p5, float %p6, float %p7, i32 %p8)
+// X64: define dso_local x86_vectorcallcc %struct.HFA2 @"\01AddParticles@@104"(%struct.HFA2 inreg %p1.coerce, float %p2, %struct.HFA4* %p3, i32 %p4, %struct.HFA2 inreg %p5.coerce, float %p6, float %p7, i32 %p8)
 
 // Vectorcall in both architectures allows passing of an HVA as long as there is room,
 // even if it is not one of the first 6 arguments.  First pass puts p4 into a
@@ -113,6 +113,6 @@ struct HFA2 __vectorcall AddParticles(st
 // in a register, does NOT put p7 in a register (since theres no room), then puts 
 // p8 in a register.
 void __vectorcall HVAAnywhere(struct HFA2 p1, int p2, int p3, float p4, int p5, int p6, struct HFA4 p7, struct HFA2 p8, float p9){}
-// X32: define x86_vectorcallcc void @"\01HVAAnywhere@@88"(%struct.HFA2 inreg %p1.coerce, i32 inreg %p2, i32 inreg %p3, float %p4, i32 %p5, i32 %p6, %struct.HFA4* %p7, %struct.HFA2 inreg %p8.coerce, float %p9)
-// X64: define x86_vectorcallcc void @"\01HVAAnywhere@@112"(%struct.HFA2 inreg %p1.coerce, i32 %p2, i32 %p3, float %p4, i32 %p5, i32 %p6, %struct.HFA4* %p7, %struct.HFA2 inreg %p8.coerce, float %p9) 
+// X32: define dso_local x86_vectorcallcc void @"\01HVAAnywhere@@88"(%struct.HFA2 inreg %p1.coerce, i32 inreg %p2, i32 inreg %p3, float %p4, i32 %p5, i32 %p6, %struct.HFA4* %p7, %struct.HFA2 inreg %p8.coerce, float %p9)
+// X64: define dso_local x86_vectorcallcc void @"\01HVAAnywhere@@112"(%struct.HFA2 inreg %p1.coerce, i32 %p2, i32 %p3, float %p4, i32 %p5, i32 %p6, %struct.HFA4* %p7, %struct.HFA2 inreg %p8.coerce, float %p9) 
 

Modified: cfe/trunk/test/CodeGen/volatile-1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/volatile-1.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/volatile-1.c (original)
+++ cfe/trunk/test/CodeGen/volatile-1.c Fri Feb 23 11:30:48 2018
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -Wno-return-type -Wno-unused-value -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -Wno-return-type -Wno-unused-value -emit-llvm %s -w -o - | FileCheck %s
 
-// CHECK: @i = common global [[INT:i[0-9]+]] 0
+// CHECK: @i = common {{(dso_local )?}}global [[INT:i[0-9]+]] 0
 volatile int i, j, k;
 volatile int ar[5];
 volatile char c;
-// CHECK: @ci = common global [[CINT:.*]] zeroinitializer
+// CHECK: @ci = common {{(dso_local )?}}global [[CINT:.*]] zeroinitializer
 volatile _Complex int ci;
 volatile struct S {
 #ifdef __cplusplus

Modified: cfe/trunk/test/CodeGen/windows-itanium.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/windows-itanium.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/windows-itanium.c (original)
+++ cfe/trunk/test/CodeGen/windows-itanium.c Fri Feb 23 11:30:48 2018
@@ -8,8 +8,8 @@ int function() {
   return 32;
 }
 
-// CHECK-C: define i32 @function() {{.*}} {
-// CHECK-CXX: define i32 @_Z8functionv() {{.*}} {
+// CHECK-C: define dso_local i32 @function() {{.*}} {
+// CHECK-CXX: define dso_local i32 @_Z8functionv() {{.*}} {
 // CHECK:   ret i32 32
 // CHECK: }
 

Modified: cfe/trunk/test/CodeGen/windows-on-arm-dllimport-dllexport.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/windows-on-arm-dllimport-dllexport.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/windows-on-arm-dllimport-dllexport.c (original)
+++ cfe/trunk/test/CodeGen/windows-on-arm-dllimport-dllexport.c Fri Feb 23 11:30:48 2018
@@ -17,9 +17,9 @@ void call_imported_function() {
 }
 
 // CHECK: @import_int = external dllimport global i32
-// CHECK: @export_int = common dllexport global i32 0, align 4
+// CHECK: @export_int = common dso_local dllexport global i32 0, align 4
 
-// CHECK: define dllexport arm_aapcs_vfpcc void @export_implemented_function()
+// CHECK: define dso_local dllexport arm_aapcs_vfpcc void @export_implemented_function()
 
 // CHECK: declare dllimport arm_aapcs_vfpcc void @import_function(i32)
 

Modified: cfe/trunk/test/CodeGen/windows-struct-abi.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/windows-struct-abi.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/windows-struct-abi.c (original)
+++ cfe/trunk/test/CodeGen/windows-struct-abi.c Fri Feb 23 11:30:48 2018
@@ -6,11 +6,11 @@ struct f1 {
 
 struct f1 return_f1(void) { while (1); }
 
-// CHECK: define i32 @return_f1()
+// CHECK: define dso_local i32 @return_f1()
 
 void receive_f1(struct f1 a0) { }
 
-// CHECK: define void @receive_f1(float %a0.0)
+// CHECK: define dso_local void @receive_f1(float %a0.0)
 
 struct f2 {
   float f;
@@ -19,11 +19,11 @@ struct f2 {
 
 struct f2 return_f2(void) { while (1); }
 
-// CHECK: define i64 @return_f2()
+// CHECK: define dso_local i64 @return_f2()
 
 void receive_f2(struct f2 a0) { }
 
-// CHECK: define void @receive_f2(float %a0.0, float %a0.1)
+// CHECK: define dso_local void @receive_f2(float %a0.0, float %a0.1)
 
 struct f4 {
   float f;
@@ -34,9 +34,9 @@ struct f4 {
 
 struct f4 return_f4(void) { while (1); }
 
-// CHECK: define void @return_f4(%struct.f4* noalias sret %agg.result)
+// CHECK: define dso_local void @return_f4(%struct.f4* noalias sret %agg.result)
 
 void receive_f4(struct f4 a0) { }
 
-// CHECK: define void @receive_f4(float %a0.0, float %a0.1, float %a0.2, float %a0.3)
+// CHECK: define dso_local void @receive_f4(float %a0.0, float %a0.1, float %a0.2, float %a0.3)
 

Modified: cfe/trunk/test/CodeGen/windows-swiftcall.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/windows-swiftcall.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/windows-swiftcall.c (original)
+++ cfe/trunk/test/CodeGen/windows-swiftcall.c Fri Feb 23 11:30:48 2018
@@ -40,7 +40,7 @@ void test_context_error_1() {
   float *error;
   context_error_1(&x, &error);
 }
-// CHECK-LABEL: define void @test_context_error_1()
+// CHECK-LABEL: define dso_local void @test_context_error_1()
 // CHECK:       [[X:%.*]] = alloca i32, align 4
 // CHECK:       [[ERROR:%.*]] = alloca float*, align 8
 // CHECK:       [[TEMP:%.*]] = alloca swifterror float*, align 8
@@ -97,7 +97,7 @@ typedef struct {
   float f1;
 } struct_1;
 TEST(struct_1);
-// CHECK-LABEL: define swiftcc { i64, i64 } @return_struct_1() {{.*}}{
+// CHECK-LABEL: define dso_local swiftcc { i64, i64 } @return_struct_1() {{.*}}{
 // CHECK:   [[RET:%.*]] = alloca [[STRUCT1:%.*]], align 4
 // CHECK:   [[VAR:%.*]] = alloca [[STRUCT1]], align 4
 // CHECK:   call void @llvm.memset
@@ -111,7 +111,7 @@ TEST(struct_1);
 // CHECK:   [[R1:%.*]] = insertvalue { i64, i64 } [[R0]], i64 [[T1]], 1
 // CHECK:   ret { i64, i64 } [[R1]]
 // CHECK: }
-// CHECK-LABEL: define swiftcc void @take_struct_1(i64, i64) {{.*}}{
+// CHECK-LABEL: define dso_local swiftcc void @take_struct_1(i64, i64) {{.*}}{
 // CHECK:   [[V:%.*]] = alloca [[STRUCT1:%.*]], align 4
 // CHECK:   [[CAST:%.*]] = bitcast [[STRUCT1]]* [[V]] to { i64, i64 }*
 // CHECK:   [[GEP0:%.*]] = getelementptr inbounds { i64, i64 }, { i64, i64 }* [[CAST]], i32 0, i32 0
@@ -120,7 +120,7 @@ TEST(struct_1);
 // CHECK:   store i64 %1, i64* [[GEP1]], align 4
 // CHECK:   ret void
 // CHECK: }
-// CHECK-LABEL: define void @test_struct_1() {{.*}}{
+// CHECK-LABEL: define dso_local void @test_struct_1() {{.*}}{
 // CHECK:   [[AGG:%.*]] = alloca [[STRUCT1:%.*]], align 4
 // CHECK:   [[RET:%.*]] = call swiftcc { i64, i64 } @return_struct_1()
 // CHECK:   [[CAST:%.*]] = bitcast [[STRUCT1]]* [[AGG]] to { i64, i64 }*
@@ -147,7 +147,7 @@ typedef struct {
   float f1;
 } struct_2;
 TEST(struct_2);
-// CHECK-LABEL: define swiftcc { i64, i64 } @return_struct_2() {{.*}}{
+// CHECK-LABEL: define dso_local swiftcc { i64, i64 } @return_struct_2() {{.*}}{
 // CHECK:   [[RET:%.*]] = alloca [[STRUCT2_TYPE]], align 4
 // CHECK:   [[VAR:%.*]] = alloca [[STRUCT2_TYPE]], align 4
 // CHECK:   [[CASTVAR:%.*]] = bitcast {{.*}} [[VAR]]
@@ -164,7 +164,7 @@ TEST(struct_2);
 // CHECK:   [[R1:%.*]] = insertvalue { i64, i64 } [[R0]], i64 [[T1]], 1
 // CHECK:   ret { i64, i64 } [[R1]]
 // CHECK: }
-// CHECK-LABEL: define swiftcc void @take_struct_2(i64, i64) {{.*}}{
+// CHECK-LABEL: define dso_local swiftcc void @take_struct_2(i64, i64) {{.*}}{
 // CHECK:   [[V:%.*]] = alloca [[STRUCT:%.*]], align 4
 // CHECK:   [[CAST:%.*]] = bitcast [[STRUCT]]* [[V]] to { i64, i64 }*
 // CHECK:   [[GEP0:%.*]] = getelementptr inbounds { i64, i64 }, { i64, i64 }* [[CAST]], i32 0, i32 0
@@ -173,7 +173,7 @@ TEST(struct_2);
 // CHECK:   store i64 %1, i64* [[GEP1]], align 4
 // CHECK:   ret void
 // CHECK: }
-// CHECK-LABEL: define void @test_struct_2() {{.*}} {
+// CHECK-LABEL: define dso_local void @test_struct_2() {{.*}} {
 // CHECK:   [[TMP:%.*]] = alloca [[STRUCT2_TYPE]], align 4
 // CHECK:   [[CALL:%.*]] = call swiftcc { i64, i64 } @return_struct_2()
 // CHECK:   [[CAST_TMP:%.*]] = bitcast [[STRUCT2_TYPE]]* [[TMP]] to { i64, i64 }*
@@ -203,7 +203,7 @@ typedef struct {
   __attribute__((packed)) float f;
 } struct_misaligned_1;
 TEST(struct_misaligned_1)
-// CHECK-LABEL: define swiftcc i64 @return_struct_misaligned_1()
+// CHECK-LABEL: define dso_local swiftcc i64 @return_struct_misaligned_1()
 // CHECK:  [[RET:%.*]] = alloca [[STRUCT:%.*]], align 1
 // CHECK:  [[RES:%.*]] = alloca [[STRUCT]], align 1
 // CHECK:  [[CAST:%.*]] = bitcast [[STRUCT]]* [[RES]] to i8*
@@ -216,14 +216,14 @@ TEST(struct_misaligned_1)
 // CHECK:  [[R0:%.*]] = load i64, i64* [[GEP]], align 1
 // CHECK:  ret i64 [[R0]]
 // CHECK:}
-// CHECK-LABEL: define swiftcc void @take_struct_misaligned_1(i64) {{.*}}{
+// CHECK-LABEL: define dso_local swiftcc void @take_struct_misaligned_1(i64) {{.*}}{
 // CHECK:   [[V:%.*]] = alloca [[STRUCT:%.*]], align 1
 // CHECK:   [[CAST:%.*]] = bitcast [[STRUCT]]* [[V]] to { i64 }*
 // CHECK:   [[GEP:%.*]] = getelementptr inbounds { i64 }, { i64 }* [[CAST]], i32 0, i32 0
 // CHECK:   store i64 %0, i64* [[GEP]], align 1
 // CHECK:   ret void
 // CHECK: }
-// CHECK: define void @test_struct_misaligned_1() {{.*}}{
+// CHECK: define dso_local void @test_struct_misaligned_1() {{.*}}{
 // CHECK:   [[AGG:%.*]] = alloca [[STRUCT:%.*]], align 1
 // CHECK:   [[CALL:%.*]] = call swiftcc i64 @return_struct_misaligned_1()
 // CHECK:   [[T0:%.*]] = bitcast [[STRUCT]]* [[AGG]] to { i64 }*
@@ -256,7 +256,7 @@ typedef union {
   double d;
 } union_het_fp;
 TEST(union_het_fp)
-// CHECK-LABEL: define swiftcc i64 @return_union_het_fp()
+// CHECK-LABEL: define dso_local swiftcc i64 @return_union_het_fp()
 // CHECK:  [[RET:%.*]] = alloca [[UNION:%.*]], align 8
 // CHECK:  [[RES:%.*]] = alloca [[UNION]], align 8
 // CHECK:  [[CAST:%.*]] = bitcast [[UNION]]* [[RES]] to i8*
@@ -268,14 +268,14 @@ TEST(union_het_fp)
 // CHECK:  [[GEP:%.*]] = getelementptr inbounds { i64 }, { i64 }* [[CAST]], i32 0, i32 0
 // CHECK:  [[R0:%.*]] = load i64, i64* [[GEP]], align 8
 // CHECK:  ret i64 [[R0]]
-// CHECK-LABEL: define swiftcc void @take_union_het_fp(i64) {{.*}}{
+// CHECK-LABEL: define dso_local swiftcc void @take_union_het_fp(i64) {{.*}}{
 // CHECK:   [[V:%.*]] = alloca [[UNION:%.*]], align 8
 // CHECK:   [[CAST:%.*]] = bitcast [[UNION]]* [[V]] to { i64 }*
 // CHECK:   [[GEP:%.*]] = getelementptr inbounds { i64 }, { i64 }* [[CAST]], i32 0, i32 0
 // CHECK:   store i64 %0, i64* [[GEP]], align 8
 // CHECK:   ret void
 // CHECK: }
-// CHECK-LABEL: define void @test_union_het_fp() {{.*}}{
+// CHECK-LABEL: define dso_local void @test_union_het_fp() {{.*}}{
 // CHECK:   [[AGG:%.*]] = alloca [[UNION:%.*]], align 8
 // CHECK:   [[CALL:%.*]] = call swiftcc i64 @return_union_het_fp()
 // CHECK:   [[T0:%.*]] = bitcast [[UNION]]* [[AGG]] to { i64 }*
@@ -294,7 +294,7 @@ typedef union {
   float f2;
 } union_hom_fp;
 TEST(union_hom_fp)
-// CHECK-LABEL: define void @test_union_hom_fp()
+// CHECK-LABEL: define dso_local void @test_union_hom_fp()
 // CHECK:   [[TMP:%.*]] = alloca [[REC:%.*]], align 4
 // CHECK:   [[CALL:%.*]] = call [[SWIFTCC]] float @return_union_hom_fp()
 // CHECK:   [[CAST_TMP:%.*]] = bitcast [[REC]]* [[TMP]] to [[AGG:{ float }]]*
@@ -311,7 +311,7 @@ typedef union {
   float4 fv2;
 } union_hom_fp_partial;
 TEST(union_hom_fp_partial)
-// CHECK: define void @test_union_hom_fp_partial()
+// CHECK: define dso_local void @test_union_hom_fp_partial()
 // CHECK:   [[AGG:%.*]] = alloca [[UNION:%.*]], align 16
 // CHECK:   [[CALL:%.*]] = call swiftcc { i64, i64 } @return_union_hom_fp_partial()
 // CHECK:   [[CAST:%.*]] = bitcast [[UNION]]* [[AGG]] to { i64, i64 }*
@@ -335,7 +335,7 @@ typedef union {
   float4 fv2;
 } union_het_fpv_partial;
 TEST(union_het_fpv_partial)
-// CHECK-LABEL: define void @test_union_het_fpv_partial()
+// CHECK-LABEL: define dso_local void @test_union_het_fpv_partial()
 // CHECK:   [[AGG:%.*]] = alloca [[UNION:%.*]], align 16
 // CHECK:   [[CALL:%.*]] = call swiftcc { i64, i64 } @return_union_het_fpv_partial()
 // CHECK:   [[CAST:%.*]] = bitcast [[UNION]]* [[AGG]] to { i64, i64 }*
@@ -385,7 +385,7 @@ TEST(int8)
 // CHECK:   [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
 // CHECK:   store <4 x i32> %1, <4 x i32>* [[T0]], align
 // CHECK:   ret void
-// CHECK-LABEL: define void @test_int8()
+// CHECK-LABEL: define dso_local void @test_int8()
 // CHECK:   [[TMP1:%.*]] = alloca [[REC]], align
 // CHECK:   [[TMP2:%.*]] = alloca [[REC]], align
 // CHECK:   [[CALL:%.*]] = call [[SWIFTCC]] [[UAGG]] @return_int8()
@@ -429,7 +429,7 @@ TEST(int5)
 // CHECK:   [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 1
 // CHECK:   store i32 %1, i32* [[T0]], align
 // CHECK:   ret void
-// CHECK-LABEL: define void @test_int5()
+// CHECK-LABEL: define dso_local void @test_int5()
 // CHECK:   [[TMP1:%.*]] = alloca [[REC]], align
 // CHECK:   [[TMP2:%.*]] = alloca [[REC]], align
 // CHECK:   [[CALL:%.*]] = call [[SWIFTCC]] [[UAGG]] @return_int5()
@@ -455,4 +455,4 @@ typedef struct {
   int3 v __attribute__((packed));
 } misaligned_int3;
 TEST(misaligned_int3)
-// CHECK-LABEL: define swiftcc void @take_misaligned_int3(i64, i64)
+// CHECK-LABEL: define dso_local swiftcc void @take_misaligned_int3(i64, i64)

Modified: cfe/trunk/test/CodeGen/x86_32-arguments-win32.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/x86_32-arguments-win32.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/x86_32-arguments-win32.c (original)
+++ cfe/trunk/test/CodeGen/x86_32-arguments-win32.c Fri Feb 23 11:30:48 2018
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -w -triple i386-pc-win32 -emit-llvm -o - %s | FileCheck %s
 
-// CHECK-LABEL: define i64 @f1_1()
-// CHECK-LABEL: define void @f1_2(i32 %a0.0, i32 %a0.1)
+// CHECK-LABEL: define dso_local i64 @f1_1()
+// CHECK-LABEL: define dso_local void @f1_2(i32 %a0.0, i32 %a0.1)
 struct s1 {
   int a;
   int b;
@@ -9,37 +9,37 @@ struct s1 {
 struct s1 f1_1(void) { while (1) {} }
 void f1_2(struct s1 a0) {}
 
-// CHECK-LABEL: define i32 @f2_1()
+// CHECK-LABEL: define dso_local i32 @f2_1()
 struct s2 {
   short a;
   short b;
 };
 struct s2 f2_1(void) { while (1) {} }
 
-// CHECK-LABEL: define i16 @f3_1()
+// CHECK-LABEL: define dso_local i16 @f3_1()
 struct s3 {
   char a;
   char b;
 };
 struct s3 f3_1(void) { while (1) {} }
 
-// CHECK-LABEL: define i8 @f4_1()
+// CHECK-LABEL: define dso_local i8 @f4_1()
 struct s4 {
   char a:4;
   char b:4;
 };
 struct s4 f4_1(void) { while (1) {} }
 
-// CHECK-LABEL: define i64 @f5_1()
-// CHECK-LABEL: define void @f5_2(double %a0.0)
+// CHECK-LABEL: define dso_local i64 @f5_1()
+// CHECK-LABEL: define dso_local void @f5_2(double %a0.0)
 struct s5 {
   double a;
 };
 struct s5 f5_1(void) { while (1) {} }
 void f5_2(struct s5 a0) {}
 
-// CHECK-LABEL: define i32 @f6_1()
-// CHECK-LABEL: define void @f6_2(float %a0.0)
+// CHECK-LABEL: define dso_local i32 @f6_1()
+// CHECK-LABEL: define dso_local void @f6_2(float %a0.0)
 struct s6 {
   float a;
 };

Modified: cfe/trunk/test/CodeGen/x86_32-fpcc-struct-return.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/x86_32-fpcc-struct-return.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/x86_32-fpcc-struct-return.c (original)
+++ cfe/trunk/test/CodeGen/x86_32-fpcc-struct-return.c Fri Feb 23 11:30:48 2018
@@ -17,15 +17,15 @@ typedef struct { } ZeroSized;
 // CHECK: ret void
 Big returnBig(Big x) { return x; }
 
-// CHECK-PCC-LABEL: define void @returnSmall
+// CHECK-PCC-LABEL: define {{(dso_local )?}}void @returnSmall
 // CHECK-PCC: ret void
-// CHECK-REG-LABEL: define i32 @returnSmall
+// CHECK-REG-LABEL: define {{(dso_local )?}}i32 @returnSmall
 // CHECK-REG: ret i32
 Small returnSmall(Small x) { return x; }
 
-// CHECK-PCC-LABEL: define void @returnShort
+// CHECK-PCC-LABEL: define {{(dso_local )?}}void @returnShort
 // CHECK-PCC: ret void
-// CHECK-REG-LABEL: define i16 @returnShort
+// CHECK-REG-LABEL: define {{(dso_local )?}}i16 @returnShort
 // CHECK-REG: ret i16
 Short returnShort(Short x) { return x; }
 

Modified: cfe/trunk/test/CodeGen/x86_64-arguments-win32.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/x86_64-arguments-win32.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/x86_64-arguments-win32.c (original)
+++ cfe/trunk/test/CodeGen/x86_64-arguments-win32.c Fri Feb 23 11:30:48 2018
@@ -3,29 +3,29 @@
 // To be ABI compatible with code generated by MSVC, there shouldn't be any
 // sign/zero extensions on types smaller than 64bit.
 
-// CHECK-LABEL: define void @f1(i8 %a)
+// CHECK-LABEL: define dso_local void @f1(i8 %a)
 void f1(char a) {}
 
-// CHECK-LABEL: define void @f2(i8 %a)
+// CHECK-LABEL: define dso_local void @f2(i8 %a)
 void f2(unsigned char a) {}
 
-// CHECK-LABEL: define void @f3(i16 %a)
+// CHECK-LABEL: define dso_local void @f3(i16 %a)
 void f3(short a) {}
 
-// CHECK-LABEL: define void @f4(i16 %a)
+// CHECK-LABEL: define dso_local void @f4(i16 %a)
 void f4(unsigned short a) {}
 
 // For ABI compatibility with ICC, _Complex should be passed/returned
 // as if it were a struct with two elements.
 
-// CHECK-LABEL: define void @f5(i64 %a.coerce)
+// CHECK-LABEL: define dso_local void @f5(i64 %a.coerce)
 void f5(_Complex float a) {}
 
-// CHECK-LABEL: define void @f6({ double, double }* %a)
+// CHECK-LABEL: define dso_local void @f6({ double, double }* %a)
 void f6(_Complex double a) {}
 
-// CHECK-LABEL: define i64 @f7()
+// CHECK-LABEL: define dso_local i64 @f7()
 _Complex float f7() { return 1.0; }
 
-// CHECK-LABEL: define void @f8({ double, double }* noalias sret %agg.result)
+// CHECK-LABEL: define dso_local void @f8({ double, double }* noalias sret %agg.result)
 _Complex double f8() { return 1.0; }

Modified: cfe/trunk/test/CodeGenCXX/PR19955.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/PR19955.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/PR19955.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/PR19955.cpp Fri Feb 23 11:30:48 2018
@@ -6,13 +6,13 @@ extern void __declspec(dllimport) fun();
 
 extern int *varp;
 int *varp = &var;
-// CHECK-DAG: @"\01?varp@@3PAHA" = global i32* null
-// X64-DAG: @"\01?varp@@3PEAHEA" = global i32* null
+// CHECK-DAG: @"\01?varp@@3PAHA" = dso_local global i32* null
+// X64-DAG: @"\01?varp@@3PEAHEA" = dso_local global i32* null
 
 extern void (*funp)();
 void (*funp)() = &fun;
-// CHECK-DAG: @"\01?funp@@3P6AXXZA" = global void ()* null
-// X64-DAG: @"\01?funp@@3P6AXXZEA" = global void ()* null
+// CHECK-DAG: @"\01?funp@@3P6AXXZA" = dso_local global void ()* null
+// X64-DAG: @"\01?funp@@3P6AXXZEA" = dso_local global void ()* null
 
 // CHECK-LABEL: @"\01??__Evarp@@YAXXZ"
 // CHECK-DAG: store i32* @"\01?var@@3HA", i32** @"\01?varp@@3PAHA"

Modified: cfe/trunk/test/CodeGenCXX/array-default-argument.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/array-default-argument.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/array-default-argument.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/array-default-argument.cpp Fri Feb 23 11:30:48 2018
@@ -12,7 +12,7 @@ struct B {
 };
 
 void f();
-// CHECK-LABEL: define void @_Z1gv()
+// CHECK-LABEL: define {{(dso_local )?}}void @_Z1gv()
 void g() {
   // CHECK: br label %[[LOOP:.*]]
 

Modified: cfe/trunk/test/CodeGenCXX/atomic-dllexport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/atomic-dllexport.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/atomic-dllexport.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/atomic-dllexport.cpp Fri Feb 23 11:30:48 2018
@@ -3,7 +3,7 @@
 
 struct __declspec(dllexport) SomeStruct {
   // Copy assignment operator should be produced, and exported:
-  // M32: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.SomeStruct* @"\01??4SomeStruct@@QAEAAU0 at ABU0@@Z"
-  // M64: define weak_odr dllexport                dereferenceable({{[0-9]+}}) %struct.SomeStruct* @"\01??4SomeStruct@@QEAAAEAU0 at AEBU0@@Z"
+  // M32: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.SomeStruct* @"\01??4SomeStruct@@QAEAAU0 at ABU0@@Z"
+  // M64: define weak_odr dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.SomeStruct* @"\01??4SomeStruct@@QEAAAEAU0 at AEBU0@@Z"
   _Atomic(int) mData;
 };

Modified: cfe/trunk/test/CodeGenCXX/attr-x86-interrupt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/attr-x86-interrupt.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/attr-x86-interrupt.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/attr-x86-interrupt.cpp Fri Feb 23 11:30:48 2018
@@ -26,10 +26,10 @@ static void foo9(int *a) __attribute__((
 // X86_LINUX: define x86_intrcc void @{{.*}}foo8{{.*}}(i32* %{{.+}})
 // X86_LINUX: define linkonce_odr x86_intrcc void @{{.*}}foo9{{.*}}(i32* %{{.+}})
 // X86_64_WIN: @llvm.used = appending global [3 x i8*] [i8* bitcast (void (i32*, i64)* @{{.*}}foo7{{.*}} to i8*), i8* bitcast (void (i32*)* @{{.*}}foo8{{.*}} to i8*), i8* bitcast (void (i32*)* @{{.*}}foo9{{.*}} to i8*)], section "llvm.metadata"
-// X86_64_WIN: define x86_intrcc void @{{.*}}foo7{{.*}}(i32* %{{.+}}, i64 %{{.+}})
-// X86_64_WIN: define x86_intrcc void @{{.*}}foo8{{.*}}(i32* %{{.+}})
-// X86_64_WIN: define linkonce_odr x86_intrcc void @{{.*}}foo9{{.*}}(i32* %{{.+}})
+// X86_64_WIN: define dso_local x86_intrcc void @{{.*}}foo7{{.*}}(i32* %{{.+}}, i64 %{{.+}})
+// X86_64_WIN: define dso_local x86_intrcc void @{{.*}}foo8{{.*}}(i32* %{{.+}})
+// X86_64_WIN: define linkonce_odr dso_local x86_intrcc void @{{.*}}foo9{{.*}}(i32* %{{.+}})
 // X86_WIN: @llvm.used = appending global [3 x i8*] [i8* bitcast (void (i32*, i32)* @{{.*}}foo7{{.*}} to i8*), i8* bitcast (void (i32*)* @{{.*}}foo8{{.*}} to i8*), i8* bitcast (void (i32*)* @{{.*}}foo9{{.*}} to i8*)], section "llvm.metadata"
-// X86_WIN: define x86_intrcc void @{{.*}}foo7{{.*}}(i32* %{{.+}}, i32 %{{.+}})
-// X86_WIN: define x86_intrcc void @{{.*}}foo8{{.*}}(i32* %{{.+}})
-// X86_WIN: define linkonce_odr x86_intrcc void @{{.*}}foo9{{.*}}(i32* %{{.+}})
+// X86_WIN: define dso_local x86_intrcc void @{{.*}}foo7{{.*}}(i32* %{{.+}}, i32 %{{.+}})
+// X86_WIN: define dso_local x86_intrcc void @{{.*}}foo8{{.*}}(i32* %{{.+}})
+// X86_WIN: define linkonce_odr dso_local x86_intrcc void @{{.*}}foo9{{.*}}(i32* %{{.+}})

Modified: cfe/trunk/test/CodeGenCXX/captured-statements.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/captured-statements.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/captured-statements.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/captured-statements.cpp Fri Feb 23 11:30:48 2018
@@ -182,7 +182,7 @@ void test_capture_lambda() {
 }
 
 inline int test_captured_linkage() {
-  // CHECK-7: @_ZZ21test_captured_linkagevE1i = linkonce_odr global i32 0
+  // CHECK-7: @_ZZ21test_captured_linkagevE1i = linkonce_odr {{(dso_local )?}}global i32 0
   int j;
   #pragma clang __debug captured
   {

Modified: cfe/trunk/test/CodeGenCXX/const-base-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/const-base-cast.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/const-base-cast.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/const-base-cast.cpp Fri Feb 23 11:30:48 2018
@@ -7,4 +7,4 @@ struct B { char y; };
 struct C : A,B {};
 unsigned char x = ((char*)(B*)(C*)0x1000) - (char*)0x1000;
 
-// CHECK: @x = global i8 1
+// CHECK: @x = {{(dso_local )?}}global i8 1

Modified: cfe/trunk/test/CodeGenCXX/const-global-linkage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/const-global-linkage.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/const-global-linkage.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/const-global-linkage.cpp Fri Feb 23 11:30:48 2018
@@ -4,7 +4,7 @@ const int x = 10;
 const int y = 20;
 const volatile int z = 30;
 // CHECK-NOT: @x
-// CHECK: @z = constant i32 30
+// CHECK: @z = {{(dso_local )?}}constant i32 30
 // CHECK: @_ZL1y = internal constant i32 20
 const int& b() { return y; }
 
@@ -12,6 +12,6 @@ const char z1[] = "asdf";
 const char z2[] = "zxcv";
 const volatile char z3[] = "zxcv";
 // CHECK-NOT: @z1
-// CHECK: @z3 = constant
+// CHECK: @z3 = {{(dso_local )?}}constant
 // CHECK: @_ZL2z2 = internal constant
 const char* b2() { return z2; }

Modified: cfe/trunk/test/CodeGenCXX/constructor-destructor-return-this.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/constructor-destructor-return-this.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/constructor-destructor-return-this.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/constructor-destructor-return-this.cpp Fri Feb 23 11:30:48 2018
@@ -45,8 +45,8 @@ B::~B() { }
 // CHECKIOS5-LABEL: define %class.B* @_ZN1BD2Ev(%class.B* %this)
 // CHECKIOS5-LABEL: define %class.B* @_ZN1BD1Ev(%class.B* %this)
 
-// CHECKMS-LABEL: define x86_thiscallcc %class.B* @"\01??0B@@QAE at PAH@Z"(%class.B* returned %this, i32* %i)
-// CHECKMS-LABEL: define x86_thiscallcc void @"\01??1B@@UAE at XZ"(%class.B* %this)
+// CHECKMS-LABEL: define dso_local x86_thiscallcc %class.B* @"\01??0B@@QAE at PAH@Z"(%class.B* returned %this, i32* %i)
+// CHECKMS-LABEL: define dso_local x86_thiscallcc void @"\01??1B@@UAE at XZ"(%class.B* %this)
 
 class C : public A, public B {
 public:
@@ -83,8 +83,8 @@ C::~C() { }
 // CHECKIOS5-LABEL: define void @_ZN1CD0Ev(%class.C* %this)
 // CHECKIOS5-LABEL: define void @_ZThn8_N1CD0Ev(%class.C* %this)
 
-// CHECKMS-LABEL: define x86_thiscallcc %class.C* @"\01??0C@@QAE at PAHPAD@Z"(%class.C* returned %this, i32* %i, i8* %c)
-// CHECKMS-LABEL: define x86_thiscallcc void @"\01??1C@@UAE at XZ"(%class.C* %this)
+// CHECKMS-LABEL: define dso_local x86_thiscallcc %class.C* @"\01??0C@@QAE at PAHPAD@Z"(%class.C* returned %this, i32* %i, i8* %c)
+// CHECKMS-LABEL: define dso_local x86_thiscallcc void @"\01??1C@@UAE at XZ"(%class.C* %this)
 
 class D : public virtual A {
 public:
@@ -110,8 +110,8 @@ D::~D() { }
 // CHECKIOS5-LABEL: define %class.D* @_ZN1DD2Ev(%class.D* %this, i8** %vtt)
 // CHECKIOS5-LABEL: define %class.D* @_ZN1DD1Ev(%class.D* %this)
 
-// CHECKMS-LABEL: define x86_thiscallcc %class.D* @"\01??0D@@QAE at XZ"(%class.D* returned %this, i32 %is_most_derived)
-// CHECKMS-LABEL: define x86_thiscallcc void @"\01??1D@@UAE at XZ"(%class.D* %this)
+// CHECKMS-LABEL: define dso_local x86_thiscallcc %class.D* @"\01??0D@@QAE at XZ"(%class.D* returned %this, i32 %is_most_derived)
+// CHECKMS-LABEL: define dso_local x86_thiscallcc void @"\01??1D@@UAE at XZ"(%class.D* %this)
 
 class E {
 public:

Modified: cfe/trunk/test/CodeGenCXX/dllexport-alias.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllexport-alias.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllexport-alias.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllexport-alias.cpp Fri Feb 23 11:30:48 2018
@@ -14,5 +14,5 @@ A::A() {}
 
 A::~A() {}
 
-// CHECK: @_ZN1AC1Ev = dllexport alias void (%class.A*), void (%class.A*)* @_ZN1AC2Ev
-// CHECK: @_ZN1AD1Ev = dllexport alias void (%class.A*), void (%class.A*)* @_ZN1AD2Ev
+// CHECK: @_ZN1AC1Ev = dso_local dllexport alias void (%class.A*), void (%class.A*)* @_ZN1AC2Ev
+// CHECK: @_ZN1AD1Ev = dso_local dllexport alias void (%class.A*), void (%class.A*)* @_ZN1AD2Ev

Modified: cfe/trunk/test/CodeGenCXX/dllexport-ctor-closure.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllexport-ctor-closure.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllexport-ctor-closure.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllexport-ctor-closure.cpp Fri Feb 23 11:30:48 2018
@@ -77,6 +77,6 @@ struct __declspec(dllexport) CtorClosure
 CtorClosureOutOfLine::CtorClosureOutOfLine(const HasImplicitDtor2 &v) {}
 
 // CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FCtorClosureInline@@QAEXXZ"
-// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01??1HasImplicitDtor1@@QAE at XZ"
+// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"\01??1HasImplicitDtor1@@QAE at XZ"
 // CHECK-LABEL: define weak_odr dllexport x86_thiscallcc void @"\01??_FCtorClosureOutOfLine@@QAEXXZ"
-// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01??1HasImplicitDtor2@@QAE at XZ"
+// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"\01??1HasImplicitDtor2@@QAE at XZ"

Modified: cfe/trunk/test/CodeGenCXX/dllexport-dtor-thunks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllexport-dtor-thunks.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllexport-dtor-thunks.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllexport-dtor-thunks.cpp Fri Feb 23 11:30:48 2018
@@ -6,5 +6,5 @@ struct __declspec(dllexport) C : A, B {
 C::~C() {}
 
 // This thunk should *not* be dllexport.
-// CHECK: define linkonce_odr i8* @"\01??_EC@@W7EAAPEAXI at Z"
-// CHECK: define dllexport void @"\01??1C@@UEAA at XZ"
+// CHECK: define linkonce_odr dso_local i8* @"\01??_EC@@W7EAAPEAXI at Z"
+// CHECK: define dso_local dllexport void @"\01??1C@@UEAA at XZ"

Modified: cfe/trunk/test/CodeGenCXX/dllexport-members.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllexport-members.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllexport-members.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllexport-members.cpp Fri Feb 23 11:30:48 2018
@@ -26,101 +26,101 @@ extern "C" void free(void* p);
 struct ExportMembers {
   struct Nested;
 
-  // M32-DAG: define          dllexport x86_thiscallcc void @"\01?normalDef at ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this)
-  // M64-DAG: define          dllexport                void @"\01?normalDef at ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this)
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?normalInclass at ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this)
-  // M64-DAG: define weak_odr dllexport                void @"\01?normalInclass at ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this)
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?normalInlineDef at ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this)
-  // M64-DAG: define weak_odr dllexport                void @"\01?normalInlineDef at ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this)
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?normalInlineDecl at ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this)
-  // M64-DAG: define weak_odr dllexport                void @"\01?normalInlineDecl at ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this)
-  // G32-DAG: define          dllexport x86_thiscallcc void @_ZN13ExportMembers9normalDefEv(%struct.ExportMembers* %this)
-  // G64-DAG: define          dllexport                void @_ZN13ExportMembers9normalDefEv(%struct.ExportMembers* %this)
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers13normalInclassEv(%struct.ExportMembers* %this)
-  // G64-DAG: define weak_odr dllexport                void @_ZN13ExportMembers13normalInclassEv(%struct.ExportMembers* %this)
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers15normalInlineDefEv(%struct.ExportMembers* %this)
-  // G64-DAG: define weak_odr dllexport                void @_ZN13ExportMembers15normalInlineDefEv(%struct.ExportMembers* %this)
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers16normalInlineDeclEv(%struct.ExportMembers* %this)
-  // G64-DAG: define weak_odr dllexport                void @_ZN13ExportMembers16normalInlineDeclEv(%struct.ExportMembers* %this)
-  // M32-DAG: define linkonce_odr       x86_thiscallcc void @"\01?referencedNonExportedInClass at ExportMembers@@QAEXXZ"
+  // M32-DAG: define          dso_local dllexport x86_thiscallcc void @"\01?normalDef at ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this)
+  // M64-DAG: define          dso_local dllexport                void @"\01?normalDef at ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this)
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?normalInclass at ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this)
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01?normalInclass at ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this)
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?normalInlineDef at ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this)
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01?normalInlineDef at ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this)
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?normalInlineDecl at ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this)
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01?normalInlineDecl at ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this)
+  // G32-DAG: define          dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers9normalDefEv(%struct.ExportMembers* %this)
+  // G64-DAG: define          dso_local dllexport                void @_ZN13ExportMembers9normalDefEv(%struct.ExportMembers* %this)
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers13normalInclassEv(%struct.ExportMembers* %this)
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers13normalInclassEv(%struct.ExportMembers* %this)
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers15normalInlineDefEv(%struct.ExportMembers* %this)
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers15normalInlineDefEv(%struct.ExportMembers* %this)
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers16normalInlineDeclEv(%struct.ExportMembers* %this)
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers16normalInlineDeclEv(%struct.ExportMembers* %this)
+  // M32-DAG: define linkonce_odr dso_local       x86_thiscallcc void @"\01?referencedNonExportedInClass at ExportMembers@@QAEXXZ"
   __declspec(dllexport)                void normalDef();
   __declspec(dllexport)                void normalInclass() { referencedNonExportedInClass(); }
   __declspec(dllexport)                void normalInlineDef();
   __declspec(dllexport)         inline void normalInlineDecl();
                                        void referencedNonExportedInClass() {}
 
-  // M32-DAG: define          dllexport x86_thiscallcc void @"\01?virtualDef at ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this)
-  // M64-DAG: define          dllexport                void @"\01?virtualDef at ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this)
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?virtualInclass at ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this)
-  // M64-DAG: define weak_odr dllexport                void @"\01?virtualInclass at ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this)
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?virtualInlineDef at ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this)
-  // M64-DAG: define weak_odr dllexport                void @"\01?virtualInlineDef at ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this)
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?virtualInlineDecl at ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this)
-  // M64-DAG: define weak_odr dllexport                void @"\01?virtualInlineDecl at ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this)
-  // G32-DAG: define          dllexport x86_thiscallcc void @_ZN13ExportMembers10virtualDefEv(%struct.ExportMembers* %this)
-  // G64-DAG: define          dllexport                void @_ZN13ExportMembers10virtualDefEv(%struct.ExportMembers* %this)
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers14virtualInclassEv(%struct.ExportMembers* %this)
-  // G64-DAG: define weak_odr dllexport                void @_ZN13ExportMembers14virtualInclassEv(%struct.ExportMembers* %this)
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers16virtualInlineDefEv(%struct.ExportMembers* %this)
-  // G64-DAG: define weak_odr dllexport                void @_ZN13ExportMembers16virtualInlineDefEv(%struct.ExportMembers* %this)
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers17virtualInlineDeclEv(%struct.ExportMembers* %this)
-  // G64-DAG: define weak_odr dllexport                void @_ZN13ExportMembers17virtualInlineDeclEv(%struct.ExportMembers* %this)
+  // M32-DAG: define          dso_local dllexport x86_thiscallcc void @"\01?virtualDef at ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this)
+  // M64-DAG: define          dso_local dllexport                void @"\01?virtualDef at ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this)
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?virtualInclass at ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this)
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01?virtualInclass at ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this)
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?virtualInlineDef at ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this)
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01?virtualInlineDef at ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this)
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?virtualInlineDecl at ExportMembers@@UAEXXZ"(%struct.ExportMembers* %this)
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01?virtualInlineDecl at ExportMembers@@UEAAXXZ"(%struct.ExportMembers* %this)
+  // G32-DAG: define          dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers10virtualDefEv(%struct.ExportMembers* %this)
+  // G64-DAG: define          dso_local dllexport                void @_ZN13ExportMembers10virtualDefEv(%struct.ExportMembers* %this)
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers14virtualInclassEv(%struct.ExportMembers* %this)
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers14virtualInclassEv(%struct.ExportMembers* %this)
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers16virtualInlineDefEv(%struct.ExportMembers* %this)
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers16virtualInlineDefEv(%struct.ExportMembers* %this)
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers17virtualInlineDeclEv(%struct.ExportMembers* %this)
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers17virtualInlineDeclEv(%struct.ExportMembers* %this)
   __declspec(dllexport) virtual        void virtualDef();
   __declspec(dllexport) virtual        void virtualInclass() {}
   __declspec(dllexport) virtual        void virtualInlineDef();
   __declspec(dllexport) virtual inline void virtualInlineDecl();
 
-  // MSC-DAG: define          dllexport                void @"\01?staticDef at ExportMembers@@SAXXZ"()
-  // MSC-DAG: define weak_odr dllexport                void @"\01?staticInclass at ExportMembers@@SAXXZ"()
-  // MSC-DAG: define weak_odr dllexport                void @"\01?staticInlineDef at ExportMembers@@SAXXZ"()
-  // MSC-DAG: define weak_odr dllexport                void @"\01?staticInlineDecl at ExportMembers@@SAXXZ"()
-  // GNU-DAG: define          dllexport                void @_ZN13ExportMembers9staticDefEv()
-  // GNU-DAG: define weak_odr dllexport                void @_ZN13ExportMembers13staticInclassEv()
-  // GNU-DAG: define weak_odr dllexport                void @_ZN13ExportMembers15staticInlineDefEv()
-  // GNU-DAG: define weak_odr dllexport                void @_ZN13ExportMembers16staticInlineDeclEv()
+  // MSC-DAG: define          dso_local dllexport                void @"\01?staticDef at ExportMembers@@SAXXZ"()
+  // MSC-DAG: define weak_odr dso_local dllexport                void @"\01?staticInclass at ExportMembers@@SAXXZ"()
+  // MSC-DAG: define weak_odr dso_local dllexport                void @"\01?staticInlineDef at ExportMembers@@SAXXZ"()
+  // MSC-DAG: define weak_odr dso_local dllexport                void @"\01?staticInlineDecl at ExportMembers@@SAXXZ"()
+  // GNU-DAG: define          dso_local dllexport                void @_ZN13ExportMembers9staticDefEv()
+  // GNU-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers13staticInclassEv()
+  // GNU-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers15staticInlineDefEv()
+  // GNU-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers16staticInlineDeclEv()
   __declspec(dllexport) static         void staticDef();
   __declspec(dllexport) static         void staticInclass() {}
   __declspec(dllexport) static         void staticInlineDef();
   __declspec(dllexport) static  inline void staticInlineDecl();
 
-  // M32-DAG: define          dllexport x86_thiscallcc void @"\01?protectedDef at ExportMembers@@IAEXXZ"(%struct.ExportMembers* %this)
-  // M64-DAG: define          dllexport                void @"\01?protectedDef at ExportMembers@@IEAAXXZ"(%struct.ExportMembers* %this)
-  // G32-DAG: define          dllexport x86_thiscallcc void @_ZN13ExportMembers12protectedDefEv(%struct.ExportMembers* %this)
-  // G64-DAG: define          dllexport                void @_ZN13ExportMembers12protectedDefEv(%struct.ExportMembers* %this)
-  // MSC-DAG: define          dllexport                void @"\01?protectedStaticDef at ExportMembers@@KAXXZ"()
-  // GNU-DAG: define          dllexport                void @_ZN13ExportMembers18protectedStaticDefEv()
+  // M32-DAG: define          dso_local dllexport x86_thiscallcc void @"\01?protectedDef at ExportMembers@@IAEXXZ"(%struct.ExportMembers* %this)
+  // M64-DAG: define          dso_local dllexport                void @"\01?protectedDef at ExportMembers@@IEAAXXZ"(%struct.ExportMembers* %this)
+  // G32-DAG: define          dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers12protectedDefEv(%struct.ExportMembers* %this)
+  // G64-DAG: define          dso_local dllexport                void @_ZN13ExportMembers12protectedDefEv(%struct.ExportMembers* %this)
+  // MSC-DAG: define          dso_local dllexport                void @"\01?protectedStaticDef at ExportMembers@@KAXXZ"()
+  // GNU-DAG: define          dso_local dllexport                void @_ZN13ExportMembers18protectedStaticDefEv()
 protected:
   __declspec(dllexport)                void protectedDef();
   __declspec(dllexport) static         void protectedStaticDef();
 
-  // M32-DAG: define          dllexport x86_thiscallcc void @"\01?privateDef at ExportMembers@@AAEXXZ"(%struct.ExportMembers* %this)
-  // M64-DAG: define          dllexport                void @"\01?privateDef at ExportMembers@@AEAAXXZ"(%struct.ExportMembers* %this)
-  // G32-DAG: define          dllexport x86_thiscallcc void @_ZN13ExportMembers10privateDefEv(%struct.ExportMembers* %this)
-  // G64-DAG: define          dllexport                void @_ZN13ExportMembers10privateDefEv(%struct.ExportMembers* %this)
-  // MSC-DAG: define          dllexport                void @"\01?privateStaticDef at ExportMembers@@CAXXZ"()
-  // GNU-DAG: define          dllexport                void @_ZN13ExportMembers16privateStaticDefEv()
+  // M32-DAG: define          dso_local dllexport x86_thiscallcc void @"\01?privateDef at ExportMembers@@AAEXXZ"(%struct.ExportMembers* %this)
+  // M64-DAG: define          dso_local dllexport                void @"\01?privateDef at ExportMembers@@AEAAXXZ"(%struct.ExportMembers* %this)
+  // G32-DAG: define          dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers10privateDefEv(%struct.ExportMembers* %this)
+  // G64-DAG: define          dso_local dllexport                void @_ZN13ExportMembers10privateDefEv(%struct.ExportMembers* %this)
+  // MSC-DAG: define          dso_local dllexport                void @"\01?privateStaticDef at ExportMembers@@CAXXZ"()
+  // GNU-DAG: define          dso_local dllexport                void @_ZN13ExportMembers16privateStaticDefEv()
 private:
   __declspec(dllexport)                void privateDef();
   __declspec(dllexport) static         void privateStaticDef();
 
-  // M32-DAG: define                    x86_thiscallcc void @"\01?ignored at ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this)
-  // M64-DAG: define                                   void @"\01?ignored at ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this)
-  // G32-DAG: define                    x86_thiscallcc void @_ZN13ExportMembers7ignoredEv(%struct.ExportMembers* %this)
-  // G64-DAG: define                                   void @_ZN13ExportMembers7ignoredEv(%struct.ExportMembers* %this)
+  // M32-DAG: define          dso_local x86_thiscallcc void @"\01?ignored at ExportMembers@@QAEXXZ"(%struct.ExportMembers* %this)
+  // M64-DAG: define          dso_local                void @"\01?ignored at ExportMembers@@QEAAXXZ"(%struct.ExportMembers* %this)
+  // G32-DAG: define          dso_local x86_thiscallcc void @_ZN13ExportMembers7ignoredEv(%struct.ExportMembers* %this)
+  // G64-DAG: define          dso_local                void @_ZN13ExportMembers7ignoredEv(%struct.ExportMembers* %this)
 public:
   void ignored();
 
-  // MSC-DAG: @"\01?StaticField at ExportMembers@@2HA"               = dllexport global i32 1, align 4
-  // MSC-DAG: @"\01?StaticConstField at ExportMembers@@2HB"          = dllexport constant i32 1, align 4
-  // MSC-DAG: @"\01?StaticConstFieldEqualInit at ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-  // MSC-DAG: @"\01?StaticConstFieldBraceInit at ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-  // MSC-DAG: @"\01?StaticConstFieldRefNotDef at ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-  // MSC-DAG: @"\01?ConstexprField at ExportMembers@@2HB"            = weak_odr dllexport constant i32 1, comdat, align 4
-  // GNU-DAG: @_ZN13ExportMembers11StaticFieldE                   = dllexport global i32 1, align 4
-  // GNU-DAG: @_ZN13ExportMembers16StaticConstFieldE              = dllexport constant i32 1, align 4
-  // GNU-DAG: @_ZN13ExportMembers25StaticConstFieldEqualInitE     = dllexport constant i32 1, align 4
-  // GNU-DAG: @_ZN13ExportMembers25StaticConstFieldBraceInitE     = dllexport constant i32 1, align 4
-  // GNU-DAG: @_ZN13ExportMembers14ConstexprFieldE                = dllexport constant i32 1, align 4
+  // MSC-DAG: @"\01?StaticField at ExportMembers@@2HA"               = dso_local dllexport global i32 1, align 4
+  // MSC-DAG: @"\01?StaticConstField at ExportMembers@@2HB"          = dso_local dllexport constant i32 1, align 4
+  // MSC-DAG: @"\01?StaticConstFieldEqualInit at ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+  // MSC-DAG: @"\01?StaticConstFieldBraceInit at ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+  // MSC-DAG: @"\01?StaticConstFieldRefNotDef at ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+  // MSC-DAG: @"\01?ConstexprField at ExportMembers@@2HB"            = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+  // GNU-DAG: @_ZN13ExportMembers11StaticFieldE                   = dso_local dllexport global i32 1, align 4
+  // GNU-DAG: @_ZN13ExportMembers16StaticConstFieldE              = dso_local dllexport constant i32 1, align 4
+  // GNU-DAG: @_ZN13ExportMembers25StaticConstFieldEqualInitE     = dso_local dllexport constant i32 1, align 4
+  // GNU-DAG: @_ZN13ExportMembers25StaticConstFieldBraceInitE     = dso_local dllexport constant i32 1, align 4
+  // GNU-DAG: @_ZN13ExportMembers14ConstexprFieldE                = dso_local dllexport constant i32 1, align 4
   __declspec(dllexport) static         int  StaticField;
   __declspec(dllexport) static  const  int  StaticConstField;
   __declspec(dllexport) static  const  int  StaticConstFieldEqualInit = 1;
@@ -154,99 +154,99 @@ constexpr int ExportMembers::ConstexprFi
 
 // Export individual members of a nested class.
 struct ExportMembers::Nested {
-  // M32-DAG: define          dllexport x86_thiscallcc void @"\01?normalDef at Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M64-DAG: define          dllexport                void @"\01?normalDef at Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?normalInclass at Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M64-DAG: define weak_odr dllexport                void @"\01?normalInclass at Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?normalInlineDef at Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M64-DAG: define weak_odr dllexport                void @"\01?normalInlineDef at Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?normalInlineDecl at Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M64-DAG: define weak_odr dllexport                void @"\01?normalInlineDecl at Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // G32-DAG: define          dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested9normalDefEv(%"struct.ExportMembers::Nested"* %this)
-  // G64-DAG: define          dllexport                void @_ZN13ExportMembers6Nested9normalDefEv(%"struct.ExportMembers::Nested"* %this)
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested13normalInclassEv(%"struct.ExportMembers::Nested"* %this)
-  // G64-DAG: define weak_odr dllexport                void @_ZN13ExportMembers6Nested13normalInclassEv(%"struct.ExportMembers::Nested"* %this)
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested15normalInlineDefEv(%"struct.ExportMembers::Nested"* %this)
-  // G64-DAG: define weak_odr dllexport                void @_ZN13ExportMembers6Nested15normalInlineDefEv(%"struct.ExportMembers::Nested"* %this)
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested16normalInlineDeclEv(%"struct.ExportMembers::Nested"* %this)
-  // G64-DAG: define weak_odr dllexport                void @_ZN13ExportMembers6Nested16normalInlineDeclEv(%"struct.ExportMembers::Nested"* %this)
+  // M32-DAG: define          dso_local dllexport x86_thiscallcc void @"\01?normalDef at Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M64-DAG: define          dso_local dllexport                void @"\01?normalDef at Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?normalInclass at Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01?normalInclass at Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?normalInlineDef at Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01?normalInlineDef at Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?normalInlineDecl at Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01?normalInlineDecl at Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // G32-DAG: define          dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested9normalDefEv(%"struct.ExportMembers::Nested"* %this)
+  // G64-DAG: define          dso_local dllexport                void @_ZN13ExportMembers6Nested9normalDefEv(%"struct.ExportMembers::Nested"* %this)
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested13normalInclassEv(%"struct.ExportMembers::Nested"* %this)
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers6Nested13normalInclassEv(%"struct.ExportMembers::Nested"* %this)
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested15normalInlineDefEv(%"struct.ExportMembers::Nested"* %this)
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers6Nested15normalInlineDefEv(%"struct.ExportMembers::Nested"* %this)
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested16normalInlineDeclEv(%"struct.ExportMembers::Nested"* %this)
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers6Nested16normalInlineDeclEv(%"struct.ExportMembers::Nested"* %this)
   __declspec(dllexport)                void normalDef();
   __declspec(dllexport)                void normalInclass() {}
   __declspec(dllexport)                void normalInlineDef();
   __declspec(dllexport)         inline void normalInlineDecl();
 
-  // M32-DAG: define          dllexport x86_thiscallcc void @"\01?virtualDef at Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M64-DAG: define          dllexport                void @"\01?virtualDef at Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?virtualInclass at Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M64-DAG: define weak_odr dllexport                void @"\01?virtualInclass at Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?virtualInlineDef at Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M64-DAG: define weak_odr dllexport                void @"\01?virtualInlineDef at Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?virtualInlineDecl at Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M64-DAG: define weak_odr dllexport                void @"\01?virtualInlineDecl at Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // G32-DAG: define          dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested10virtualDefEv(%"struct.ExportMembers::Nested"* %this)
-  // G64-DAG: define          dllexport                void @_ZN13ExportMembers6Nested10virtualDefEv(%"struct.ExportMembers::Nested"* %this)
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested14virtualInclassEv(%"struct.ExportMembers::Nested"* %this)
-  // G64-DAG: define weak_odr dllexport                void @_ZN13ExportMembers6Nested14virtualInclassEv(%"struct.ExportMembers::Nested"* %this)
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested16virtualInlineDefEv(%"struct.ExportMembers::Nested"* %this)
-  // G64-DAG: define weak_odr dllexport                void @_ZN13ExportMembers6Nested16virtualInlineDefEv(%"struct.ExportMembers::Nested"* %this)
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested17virtualInlineDeclEv(%"struct.ExportMembers::Nested"* %this)
-  // G64-DAG: define weak_odr dllexport                void @_ZN13ExportMembers6Nested17virtualInlineDeclEv(%"struct.ExportMembers::Nested"* %this)
+  // M32-DAG: define          dso_local dllexport x86_thiscallcc void @"\01?virtualDef at Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M64-DAG: define          dso_local dllexport                void @"\01?virtualDef at Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?virtualInclass at Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01?virtualInclass at Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?virtualInlineDef at Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01?virtualInlineDef at Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?virtualInlineDecl at Nested@ExportMembers@@UAEXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01?virtualInlineDecl at Nested@ExportMembers@@UEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // G32-DAG: define          dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested10virtualDefEv(%"struct.ExportMembers::Nested"* %this)
+  // G64-DAG: define          dso_local dllexport                void @_ZN13ExportMembers6Nested10virtualDefEv(%"struct.ExportMembers::Nested"* %this)
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested14virtualInclassEv(%"struct.ExportMembers::Nested"* %this)
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers6Nested14virtualInclassEv(%"struct.ExportMembers::Nested"* %this)
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested16virtualInlineDefEv(%"struct.ExportMembers::Nested"* %this)
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers6Nested16virtualInlineDefEv(%"struct.ExportMembers::Nested"* %this)
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested17virtualInlineDeclEv(%"struct.ExportMembers::Nested"* %this)
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers6Nested17virtualInlineDeclEv(%"struct.ExportMembers::Nested"* %this)
   __declspec(dllexport) virtual        void virtualDef();
   __declspec(dllexport) virtual        void virtualInclass() {}
   __declspec(dllexport) virtual        void virtualInlineDef();
   __declspec(dllexport) virtual inline void virtualInlineDecl();
 
-  // MSC-DAG: define          dllexport                void @"\01?staticDef at Nested@ExportMembers@@SAXXZ"()
-  // MSC-DAG: define weak_odr dllexport                void @"\01?staticInclass at Nested@ExportMembers@@SAXXZ"()
-  // MSC-DAG: define weak_odr dllexport                void @"\01?staticInlineDef at Nested@ExportMembers@@SAXXZ"()
-  // MSC-DAG: define weak_odr dllexport                void @"\01?staticInlineDecl at Nested@ExportMembers@@SAXXZ"()
-  // GNU-DAG: define          dllexport                void @_ZN13ExportMembers6Nested9staticDefEv()
-  // GNU-DAG: define weak_odr dllexport                void @_ZN13ExportMembers6Nested13staticInclassEv()
-  // GNU-DAG: define weak_odr dllexport                void @_ZN13ExportMembers6Nested15staticInlineDefEv()
-  // GNU-DAG: define weak_odr dllexport                void @_ZN13ExportMembers6Nested16staticInlineDeclEv()
+  // MSC-DAG: define          dso_local dllexport                void @"\01?staticDef at Nested@ExportMembers@@SAXXZ"()
+  // MSC-DAG: define weak_odr dso_local dllexport                void @"\01?staticInclass at Nested@ExportMembers@@SAXXZ"()
+  // MSC-DAG: define weak_odr dso_local dllexport                void @"\01?staticInlineDef at Nested@ExportMembers@@SAXXZ"()
+  // MSC-DAG: define weak_odr dso_local dllexport                void @"\01?staticInlineDecl at Nested@ExportMembers@@SAXXZ"()
+  // GNU-DAG: define          dso_local dllexport                void @_ZN13ExportMembers6Nested9staticDefEv()
+  // GNU-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers6Nested13staticInclassEv()
+  // GNU-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers6Nested15staticInlineDefEv()
+  // GNU-DAG: define weak_odr dso_local dllexport                void @_ZN13ExportMembers6Nested16staticInlineDeclEv()
   __declspec(dllexport) static         void staticDef();
   __declspec(dllexport) static         void staticInclass() {}
   __declspec(dllexport) static         void staticInlineDef();
   __declspec(dllexport) static  inline void staticInlineDecl();
 
-  // M32-DAG: define          dllexport x86_thiscallcc void @"\01?protectedDef at Nested@ExportMembers@@IAEXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M64-DAG: define          dllexport                void @"\01?protectedDef at Nested@ExportMembers@@IEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // G32-DAG: define          dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested12protectedDefEv(%"struct.ExportMembers::Nested"* %this)
-  // G64-DAG: define          dllexport                void @_ZN13ExportMembers6Nested12protectedDefEv(%"struct.ExportMembers::Nested"* %this)
-  // MSC-DAG: define          dllexport                void @"\01?protectedStaticDef at Nested@ExportMembers@@KAXXZ"()
-  // GNU-DAG: define          dllexport                void @_ZN13ExportMembers6Nested18protectedStaticDefEv()
+  // M32-DAG: define          dso_local dllexport x86_thiscallcc void @"\01?protectedDef at Nested@ExportMembers@@IAEXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M64-DAG: define          dso_local dllexport                void @"\01?protectedDef at Nested@ExportMembers@@IEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // G32-DAG: define          dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested12protectedDefEv(%"struct.ExportMembers::Nested"* %this)
+  // G64-DAG: define          dso_local dllexport                void @_ZN13ExportMembers6Nested12protectedDefEv(%"struct.ExportMembers::Nested"* %this)
+  // MSC-DAG: define          dso_local dllexport                void @"\01?protectedStaticDef at Nested@ExportMembers@@KAXXZ"()
+  // GNU-DAG: define          dso_local dllexport                void @_ZN13ExportMembers6Nested18protectedStaticDefEv()
 protected:
   __declspec(dllexport)                void protectedDef();
   __declspec(dllexport) static         void protectedStaticDef();
 
-  // M32-DAG: define          dllexport x86_thiscallcc void @"\01?privateDef at Nested@ExportMembers@@AAEXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M64-DAG: define          dllexport                void @"\01?privateDef at Nested@ExportMembers@@AEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // G32-DAG: define          dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested10privateDefEv(%"struct.ExportMembers::Nested"* %this)
-  // G64-DAG: define          dllexport                void @_ZN13ExportMembers6Nested10privateDefEv(%"struct.ExportMembers::Nested"* %this)
-  // MSC-DAG: define          dllexport                void @"\01?privateStaticDef at Nested@ExportMembers@@CAXXZ"()
-  // GNU-DAG: define          dllexport                void @_ZN13ExportMembers6Nested16privateStaticDefEv()
+  // M32-DAG: define          dso_local dllexport x86_thiscallcc void @"\01?privateDef at Nested@ExportMembers@@AAEXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M64-DAG: define          dso_local dllexport                void @"\01?privateDef at Nested@ExportMembers@@AEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // G32-DAG: define          dso_local dllexport x86_thiscallcc void @_ZN13ExportMembers6Nested10privateDefEv(%"struct.ExportMembers::Nested"* %this)
+  // G64-DAG: define          dso_local dllexport                void @_ZN13ExportMembers6Nested10privateDefEv(%"struct.ExportMembers::Nested"* %this)
+  // MSC-DAG: define          dso_local dllexport                void @"\01?privateStaticDef at Nested@ExportMembers@@CAXXZ"()
+  // GNU-DAG: define          dso_local dllexport                void @_ZN13ExportMembers6Nested16privateStaticDefEv()
 private:
   __declspec(dllexport)                void privateDef();
   __declspec(dllexport) static         void privateStaticDef();
 
-  // M32-DAG: define                    x86_thiscallcc void @"\01?ignored at Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // M64-DAG: define                                   void @"\01?ignored at Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
-  // G32-DAG: define                    x86_thiscallcc void @_ZN13ExportMembers6Nested7ignoredEv(%"struct.ExportMembers::Nested"* %this)
-  // G64-DAG: define                                   void @_ZN13ExportMembers6Nested7ignoredEv(%"struct.ExportMembers::Nested"* %this)
+  // M32-DAG: define          dso_local x86_thiscallcc void @"\01?ignored at Nested@ExportMembers@@QAEXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // M64-DAG: define          dso_local                void @"\01?ignored at Nested@ExportMembers@@QEAAXXZ"(%"struct.ExportMembers::Nested"* %this)
+  // G32-DAG: define          dso_local x86_thiscallcc void @_ZN13ExportMembers6Nested7ignoredEv(%"struct.ExportMembers::Nested"* %this)
+  // G64-DAG: define          dso_local                void @_ZN13ExportMembers6Nested7ignoredEv(%"struct.ExportMembers::Nested"* %this)
 public:
   void ignored();
 
-  // MSC-DAG: @"\01?StaticField at Nested@ExportMembers@@2HA"               = dllexport global i32 1, align 4
-  // MSC-DAG: @"\01?StaticConstField at Nested@ExportMembers@@2HB"          = dllexport constant i32 1, align 4
-  // MSC-DAG: @"\01?StaticConstFieldEqualInit at Nested@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-  // MSC-DAG: @"\01?StaticConstFieldBraceInit at Nested@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-  // MSC-DAG: @"\01?StaticConstFieldRefNotDef at Nested@ExportMembers@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-  // MSC-DAG: @"\01?ConstexprField at Nested@ExportMembers@@2HB"            = weak_odr dllexport constant i32 1, comdat, align 4
-  // GNU-DAG: @_ZN13ExportMembers6Nested11StaticFieldE                   = dllexport global i32 1, align 4
-  // GNU-DAG: @_ZN13ExportMembers6Nested16StaticConstFieldE              = dllexport constant i32 1, align 4
-  // GNU-DAG: @_ZN13ExportMembers6Nested25StaticConstFieldEqualInitE     = dllexport constant i32 1, align 4
-  // GNU-DAG: @_ZN13ExportMembers6Nested25StaticConstFieldBraceInitE     = dllexport constant i32 1, align 4
-  // GNU-DAG: @_ZN13ExportMembers6Nested14ConstexprFieldE                = dllexport constant i32 1, align 4
+  // MSC-DAG: @"\01?StaticField at Nested@ExportMembers@@2HA"               = dso_local dllexport global i32 1, align 4
+  // MSC-DAG: @"\01?StaticConstField at Nested@ExportMembers@@2HB"          = dso_local dllexport constant i32 1, align 4
+  // MSC-DAG: @"\01?StaticConstFieldEqualInit at Nested@ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+  // MSC-DAG: @"\01?StaticConstFieldBraceInit at Nested@ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+  // MSC-DAG: @"\01?StaticConstFieldRefNotDef at Nested@ExportMembers@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+  // MSC-DAG: @"\01?ConstexprField at Nested@ExportMembers@@2HB"            = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+  // GNU-DAG: @_ZN13ExportMembers6Nested11StaticFieldE                   = dso_local dllexport global i32 1, align 4
+  // GNU-DAG: @_ZN13ExportMembers6Nested16StaticConstFieldE              = dso_local dllexport constant i32 1, align 4
+  // GNU-DAG: @_ZN13ExportMembers6Nested25StaticConstFieldEqualInitE     = dso_local dllexport constant i32 1, align 4
+  // GNU-DAG: @_ZN13ExportMembers6Nested25StaticConstFieldBraceInitE     = dso_local dllexport constant i32 1, align 4
+  // GNU-DAG: @_ZN13ExportMembers6Nested14ConstexprFieldE                = dso_local dllexport constant i32 1, align 4
   __declspec(dllexport) static         int  StaticField;
   __declspec(dllexport) static  const  int  StaticConstField;
   __declspec(dllexport) static  const  int  StaticConstFieldEqualInit = 1;
@@ -280,48 +280,48 @@ constexpr int ExportMembers::Nested::Con
 
 // Export special member functions.
 struct ExportSpecials {
-  // M32-DAG: define dllexport x86_thiscallcc %struct.ExportSpecials* @"\01??0ExportSpecials@@QAE at XZ"(%struct.ExportSpecials* returned %this)
-  // M64-DAG: define dllexport                %struct.ExportSpecials* @"\01??0ExportSpecials@@QEAA at XZ"(%struct.ExportSpecials* returned %this)
-  // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1Ev(%struct.ExportSpecials* %this)
-  // G64-DAG: define dllexport                void @_ZN14ExportSpecialsC1Ev(%struct.ExportSpecials* %this)
-  // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2Ev(%struct.ExportSpecials* %this)
-  // G64-DAG: define dllexport                void @_ZN14ExportSpecialsC2Ev(%struct.ExportSpecials* %this)
+  // M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportSpecials* @"\01??0ExportSpecials@@QAE at XZ"(%struct.ExportSpecials* returned %this)
+  // M64-DAG: define dso_local dllexport                %struct.ExportSpecials* @"\01??0ExportSpecials@@QEAA at XZ"(%struct.ExportSpecials* returned %this)
+  // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1Ev(%struct.ExportSpecials* %this)
+  // G64-DAG: define dso_local dllexport                void @_ZN14ExportSpecialsC1Ev(%struct.ExportSpecials* %this)
+  // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2Ev(%struct.ExportSpecials* %this)
+  // G64-DAG: define dso_local dllexport                void @_ZN14ExportSpecialsC2Ev(%struct.ExportSpecials* %this)
   __declspec(dllexport) ExportSpecials();
 
-  // M32-DAG: define dllexport x86_thiscallcc void @"\01??1ExportSpecials@@QAE at XZ"(%struct.ExportSpecials* %this)
-  // M64-DAG: define dllexport                void @"\01??1ExportSpecials@@QEAA at XZ"(%struct.ExportSpecials* %this)
-  // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsD1Ev(%struct.ExportSpecials* %this)
-  // G64-DAG: define dllexport                void @_ZN14ExportSpecialsD1Ev(%struct.ExportSpecials* %this)
-  // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsD2Ev(%struct.ExportSpecials* %this)
-  // G64-DAG: define dllexport                void @_ZN14ExportSpecialsD2Ev(%struct.ExportSpecials* %this)
+  // M32-DAG: define dso_local dllexport x86_thiscallcc void @"\01??1ExportSpecials@@QAE at XZ"(%struct.ExportSpecials* %this)
+  // M64-DAG: define dso_local dllexport                void @"\01??1ExportSpecials@@QEAA at XZ"(%struct.ExportSpecials* %this)
+  // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsD1Ev(%struct.ExportSpecials* %this)
+  // G64-DAG: define dso_local dllexport                void @_ZN14ExportSpecialsD1Ev(%struct.ExportSpecials* %this)
+  // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsD2Ev(%struct.ExportSpecials* %this)
+  // G64-DAG: define dso_local dllexport                void @_ZN14ExportSpecialsD2Ev(%struct.ExportSpecials* %this)
   __declspec(dllexport) ~ExportSpecials();
 
-  // M32-DAG: define dllexport x86_thiscallcc %struct.ExportSpecials* @"\01??0ExportSpecials@@QAE at ABU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // M64-DAG: define dllexport                %struct.ExportSpecials* @"\01??0ExportSpecials@@QEAA at AEBU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define dllexport                void @_ZN14ExportSpecialsC1ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define dllexport                void @_ZN14ExportSpecialsC2ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportSpecials* @"\01??0ExportSpecials@@QAE at ABU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // M64-DAG: define dso_local dllexport                %struct.ExportSpecials* @"\01??0ExportSpecials@@QEAA at AEBU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define dso_local dllexport                void @_ZN14ExportSpecialsC1ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define dso_local dllexport                void @_ZN14ExportSpecialsC2ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
   __declspec(dllexport) ExportSpecials(const ExportSpecials&);
 
-  // M32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"\01??4ExportSpecials@@QAEAAU0 at ABU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // M64-DAG: define dllexport                dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"\01??4ExportSpecials@@QEAAAEAU0 at AEBU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define dllexport                dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"\01??4ExportSpecials@@QAEAAU0 at ABU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // M64-DAG: define dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"\01??4ExportSpecials@@QEAAAEAU0 at AEBU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
   __declspec(dllexport) ExportSpecials& operator=(const ExportSpecials&);
 
-  // M32-DAG: define dllexport x86_thiscallcc %struct.ExportSpecials* @"\01??0ExportSpecials@@QAE@$$QAU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // M64-DAG: define dllexport                %struct.ExportSpecials* @"\01??0ExportSpecials@@QEAA@$$QEAU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define dllexport                void @_ZN14ExportSpecialsC1EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define dllexport                void @_ZN14ExportSpecialsC2EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportSpecials* @"\01??0ExportSpecials@@QAE@$$QAU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // M64-DAG: define dso_local dllexport                %struct.ExportSpecials* @"\01??0ExportSpecials@@QEAA@$$QEAU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define dso_local dllexport                void @_ZN14ExportSpecialsC1EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define dso_local dllexport                void @_ZN14ExportSpecialsC2EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
   __declspec(dllexport) ExportSpecials(ExportSpecials&&);
 
-  // M32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"\01??4ExportSpecials@@QAEAAU0@$$QAU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // M64-DAG: define dllexport                dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"\01??4ExportSpecials@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSEOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define dllexport                dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSEOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"\01??4ExportSpecials@@QAEAAU0@$$QAU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // M64-DAG: define dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"\01??4ExportSpecials@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSEOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSEOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
   __declspec(dllexport) ExportSpecials& operator=(ExportSpecials&&);
 };
 ExportSpecials::ExportSpecials() {}
@@ -334,40 +334,40 @@ ExportSpecials& ExportSpecials::operator
 
 // Export class with inline special member functions.
 struct ExportInlineSpecials {
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QAE at XZ"(%struct.ExportInlineSpecials* returned %this)
-  // M64-DAG: define weak_odr dllexport                %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QEAA at XZ"(
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsC1Ev(
-  // G64-DAG: define weak_odr dllexport                void @_ZN20ExportInlineSpecialsC1Ev(
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QAE at XZ"(%struct.ExportInlineSpecials* returned %this)
+  // M64-DAG: define weak_odr dso_local dllexport                %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QEAA at XZ"(
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsC1Ev(
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN20ExportInlineSpecialsC1Ev(
   __declspec(dllexport) ExportInlineSpecials() {}
 
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??1ExportInlineSpecials@@QAE at XZ"(
-  // M64-DAG: define weak_odr dllexport                void @"\01??1ExportInlineSpecials@@QEAA at XZ"(
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsD1Ev(
-  // G64-DAG: define weak_odr dllexport                void @_ZN20ExportInlineSpecialsD1Ev(
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??1ExportInlineSpecials@@QAE at XZ"(
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01??1ExportInlineSpecials@@QEAA at XZ"(
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsD1Ev(
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN20ExportInlineSpecialsD1Ev(
   __declspec(dllexport) ~ExportInlineSpecials() {}
 
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QAE at ABU0@@Z"(
-  // M64-DAG: define weak_odr dllexport                %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QEAA at AEBU0@@Z"(
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsC1ERKS_(
-  // G64-DAG: define weak_odr dllexport                void @_ZN20ExportInlineSpecialsC1ERKS_(
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QAE at ABU0@@Z"(
+  // M64-DAG: define weak_odr dso_local dllexport                %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QEAA at AEBU0@@Z"(
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsC1ERKS_(
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN20ExportInlineSpecialsC1ERKS_(
   __declspec(dllexport) inline ExportInlineSpecials(const ExportInlineSpecials&);
 
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"\01??4ExportInlineSpecials@@QAEAAU0 at ABU0@@Z"(
-  // M64-DAG: define weak_odr dllexport                dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"\01??4ExportInlineSpecials@@QEAAAEAU0 at AEBU0@@Z"(
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSERKS_(
-  // G64-DAG: define weak_odr dllexport                dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSERKS_(
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"\01??4ExportInlineSpecials@@QAEAAU0 at ABU0@@Z"(
+  // M64-DAG: define weak_odr dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"\01??4ExportInlineSpecials@@QEAAAEAU0 at AEBU0@@Z"(
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSERKS_(
+  // G64-DAG: define weak_odr dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSERKS_(
   __declspec(dllexport) ExportInlineSpecials& operator=(const ExportInlineSpecials&);
 
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QAE@$$QAU0@@Z"(
-  // M64-DAG: define weak_odr dllexport                %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QEAA@$$QEAU0@@Z"(
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsC1EOS_(
-  // G64-DAG: define weak_odr dllexport                void @_ZN20ExportInlineSpecialsC1EOS_(
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QAE@$$QAU0@@Z"(
+  // M64-DAG: define weak_odr dso_local dllexport                %struct.ExportInlineSpecials* @"\01??0ExportInlineSpecials@@QEAA@$$QEAU0@@Z"(
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN20ExportInlineSpecialsC1EOS_(
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN20ExportInlineSpecialsC1EOS_(
   __declspec(dllexport) ExportInlineSpecials(ExportInlineSpecials&&) {}
 
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"\01??4ExportInlineSpecials@@QAEAAU0@$$QAU0@@Z"(
-  // M64-DAG: define weak_odr dllexport                dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"\01??4ExportInlineSpecials@@QEAAAEAU0@$$QEAU0@@Z"(
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSEOS_(
-  // G64-DAG: define weak_odr dllexport                dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSEOS_(
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"\01??4ExportInlineSpecials@@QAEAAU0@$$QAU0@@Z"(
+  // M64-DAG: define weak_odr dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @"\01??4ExportInlineSpecials@@QEAAAEAU0@$$QEAU0@@Z"(
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSEOS_(
+  // G64-DAG: define weak_odr dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportInlineSpecials* @_ZN20ExportInlineSpecialsaSEOS_(
   __declspec(dllexport) ExportInlineSpecials& operator=(ExportInlineSpecials&&) { return *this; }
 };
 ExportInlineSpecials::ExportInlineSpecials(const ExportInlineSpecials&) {}
@@ -384,74 +384,74 @@ struct ExportDefaultedDefs {
   __declspec(dllexport) ExportDefaultedDefs& operator=(ExportDefaultedDefs&&);
 };
 
-// M32-DAG: define dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QAE at XZ"(%struct.ExportDefaultedDefs* returned %this)
-// M64-DAG: define dllexport                %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QEAA at XZ"(%struct.ExportDefaultedDefs* returned %this)
-// G32-DAG: define dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1Ev(%struct.ExportDefaultedDefs* %this)
-// G64-DAG: define dllexport                void @_ZN19ExportDefaultedDefsC1Ev(%struct.ExportDefaultedDefs* %this)
-// G32-DAG: define dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2Ev(%struct.ExportDefaultedDefs* %this)
-// G64-DAG: define dllexport                void @_ZN19ExportDefaultedDefsC2Ev(%struct.ExportDefaultedDefs* %this)
+// M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QAE at XZ"(%struct.ExportDefaultedDefs* returned %this)
+// M64-DAG: define dso_local dllexport                %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QEAA at XZ"(%struct.ExportDefaultedDefs* returned %this)
+// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1Ev(%struct.ExportDefaultedDefs* %this)
+// G64-DAG: define dso_local dllexport                void @_ZN19ExportDefaultedDefsC1Ev(%struct.ExportDefaultedDefs* %this)
+// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2Ev(%struct.ExportDefaultedDefs* %this)
+// G64-DAG: define dso_local dllexport                void @_ZN19ExportDefaultedDefsC2Ev(%struct.ExportDefaultedDefs* %this)
 __declspec(dllexport) ExportDefaultedDefs::ExportDefaultedDefs() = default;
 
-// M32-DAG: define dllexport x86_thiscallcc void @"\01??1ExportDefaultedDefs@@QAE at XZ"(%struct.ExportDefaultedDefs* %this)
-// M64-DAG: define dllexport                void @"\01??1ExportDefaultedDefs@@QEAA at XZ"(%struct.ExportDefaultedDefs* %this)
-// G32-DAG: define dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsD1Ev(%struct.ExportDefaultedDefs* %this)
-// G64-DAG: define dllexport                void @_ZN19ExportDefaultedDefsD1Ev(%struct.ExportDefaultedDefs* %this)
-// G32-DAG: define dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsD2Ev(%struct.ExportDefaultedDefs* %this)
-// G64-DAG: define dllexport                void @_ZN19ExportDefaultedDefsD2Ev(%struct.ExportDefaultedDefs* %this)
+// M32-DAG: define dso_local dllexport x86_thiscallcc void @"\01??1ExportDefaultedDefs@@QAE at XZ"(%struct.ExportDefaultedDefs* %this)
+// M64-DAG: define dso_local dllexport                void @"\01??1ExportDefaultedDefs@@QEAA at XZ"(%struct.ExportDefaultedDefs* %this)
+// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsD1Ev(%struct.ExportDefaultedDefs* %this)
+// G64-DAG: define dso_local dllexport                void @_ZN19ExportDefaultedDefsD1Ev(%struct.ExportDefaultedDefs* %this)
+// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsD2Ev(%struct.ExportDefaultedDefs* %this)
+// G64-DAG: define dso_local dllexport                void @_ZN19ExportDefaultedDefsD2Ev(%struct.ExportDefaultedDefs* %this)
 ExportDefaultedDefs::~ExportDefaultedDefs() = default;
 
-// M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QAE at ABU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// M64-DAG: define weak_odr dllexport                %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QEAA at AEBU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define weak_odr dllexport                void @_ZN19ExportDefaultedDefsC1ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define weak_odr dllexport                void @_ZN19ExportDefaultedDefsC2ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QAE at ABU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M64-DAG: define weak_odr dso_local dllexport                %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QEAA at AEBU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G64-DAG: define weak_odr dso_local dllexport                void @_ZN19ExportDefaultedDefsC1ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G64-DAG: define weak_odr dso_local dllexport                void @_ZN19ExportDefaultedDefsC2ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
 __declspec(dllexport) ExportDefaultedDefs::ExportDefaultedDefs(const ExportDefaultedDefs&) = default;
 
-// M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"\01??4ExportDefaultedDefs@@QAEAAU0 at ABU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// M64-DAG: define weak_odr dllexport                dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"\01??4ExportDefaultedDefs@@QEAAAEAU0 at AEBU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define weak_odr dllexport                dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"\01??4ExportDefaultedDefs@@QAEAAU0 at ABU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M64-DAG: define weak_odr dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"\01??4ExportDefaultedDefs@@QEAAAEAU0 at AEBU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G64-DAG: define weak_odr dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
 inline ExportDefaultedDefs& ExportDefaultedDefs::operator=(const ExportDefaultedDefs&) = default;
 
-// M32-DAG: define dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QAE@$$QAU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// M64-DAG: define dllexport                %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QEAA@$$QEAU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define dllexport                void @_ZN19ExportDefaultedDefsC1EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define dllexport                void @_ZN19ExportDefaultedDefsC2EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QAE@$$QAU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M64-DAG: define dso_local dllexport                %struct.ExportDefaultedDefs* @"\01??0ExportDefaultedDefs@@QEAA@$$QEAU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G64-DAG: define dso_local dllexport                void @_ZN19ExportDefaultedDefsC1EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G64-DAG: define dso_local dllexport                void @_ZN19ExportDefaultedDefsC2EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
 __declspec(dllexport) ExportDefaultedDefs::ExportDefaultedDefs(ExportDefaultedDefs&&) = default;
 
-// M32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"\01??4ExportDefaultedDefs@@QAEAAU0@$$QAU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// M64-DAG: define dllexport                dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"\01??4ExportDefaultedDefs@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSEOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define dllexport                dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSEOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"\01??4ExportDefaultedDefs@@QAEAAU0@$$QAU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M64-DAG: define dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"\01??4ExportDefaultedDefs@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSEOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G64-DAG: define dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSEOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
 ExportDefaultedDefs& ExportDefaultedDefs::operator=(ExportDefaultedDefs&&) = default;
 
 
 // Export defaulted member function definitions declared inside class.
 struct ExportDefaultedInclassDefs {
   __declspec(dllexport) ExportDefaultedInclassDefs() = default;
-  // M32VS2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
-  // M64VS2013-DAG: define weak_odr dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
-  // M32VS2015-NOT: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
-  // M64VS2015-NOT: define weak_odr dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
+  // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
+  // M64VS2013-DAG: define weak_odr dso_local dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
+  // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
+  // M64VS2015-NOT: define weak_odr dso_local dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
 
   __declspec(dllexport) ~ExportDefaultedInclassDefs() = default;
-  // M32VS2013-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??1ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* %this)
-  // M64VS2013-DAG: define weak_odr dllexport                void @"\01??1ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* %this)
-  // M32VS2015-NOT: define weak_odr dllexport x86_thiscallcc void @"\01??1ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* %this)
-  // M64VS2015-NOT: define weak_odr dllexport                void @"\01??1ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* %this)
+  // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??1ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* %this)
+  // M64VS2013-DAG: define weak_odr dso_local dllexport                void @"\01??1ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* %this)
+  // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??1ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* %this)
+  // M64VS2015-NOT: define weak_odr dso_local dllexport                void @"\01??1ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* %this)
 
   __declspec(dllexport) ExportDefaultedInclassDefs(const ExportDefaultedInclassDefs&) = default;
-  // M32VS2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
-  // M64VS2013-DAG: define weak_odr dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
-  // M32VS2015-NOT: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
-  // M64VS2015-NOT: define weak_odr dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+  // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+  // M64VS2013-DAG: define weak_odr dso_local dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+  // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+  // M64VS2015-NOT: define weak_odr dso_local dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
 
   __declspec(dllexport) ExportDefaultedInclassDefs& operator=(const ExportDefaultedInclassDefs&) = default;
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"\01??4ExportDefaultedInclassDefs@@QAEAAU0 at ABU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
-  // M64-DAG: define weak_odr dllexport                dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"\01??4ExportDefaultedInclassDefs@@QEAAAEAU0 at AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"\01??4ExportDefaultedInclassDefs@@QAEAAU0 at ABU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+  // M64-DAG: define weak_odr dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"\01??4ExportDefaultedInclassDefs@@QEAAAEAU0 at AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
 };
 
 
@@ -463,28 +463,28 @@ struct ExportAlloc {
   __declspec(dllexport) void operator delete[](void*);
 };
 
-// M32-DAG: define dllexport i8* @"\01??2ExportAlloc@@SAPAXI at Z"(i32 %n)
-// M64-DAG: define dllexport i8* @"\01??2ExportAlloc@@SAPEAX_K at Z"(i64 %n)
-// G32-DAG: define dllexport i8* @_ZN11ExportAllocnwEj(i32 %n)
-// G64-DAG: define dllexport i8* @_ZN11ExportAllocnwEy(i64 %n)
+// M32-DAG: define dso_local dllexport i8* @"\01??2ExportAlloc@@SAPAXI at Z"(i32 %n)
+// M64-DAG: define dso_local dllexport i8* @"\01??2ExportAlloc@@SAPEAX_K at Z"(i64 %n)
+// G32-DAG: define dso_local dllexport i8* @_ZN11ExportAllocnwEj(i32 %n)
+// G64-DAG: define dso_local dllexport i8* @_ZN11ExportAllocnwEy(i64 %n)
 void* ExportAlloc::operator new(__SIZE_TYPE__ n) { return malloc(n); }
 
-// M32-DAG: define dllexport i8* @"\01??_UExportAlloc@@SAPAXI at Z"(i32 %n)
-// M64-DAG: define dllexport i8* @"\01??_UExportAlloc@@SAPEAX_K at Z"(i64 %n)
-// G32-DAG: define dllexport i8* @_ZN11ExportAllocnaEj(i32 %n)
-// G64-DAG: define dllexport i8* @_ZN11ExportAllocnaEy(i64 %n)
+// M32-DAG: define dso_local dllexport i8* @"\01??_UExportAlloc@@SAPAXI at Z"(i32 %n)
+// M64-DAG: define dso_local dllexport i8* @"\01??_UExportAlloc@@SAPEAX_K at Z"(i64 %n)
+// G32-DAG: define dso_local dllexport i8* @_ZN11ExportAllocnaEj(i32 %n)
+// G64-DAG: define dso_local dllexport i8* @_ZN11ExportAllocnaEy(i64 %n)
 void* ExportAlloc::operator new[](__SIZE_TYPE__ n) { return malloc(n); }
 
-// M32-DAG: define dllexport void @"\01??3ExportAlloc@@SAXPAX at Z"(i8* %p)
-// M64-DAG: define dllexport void @"\01??3ExportAlloc@@SAXPEAX at Z"(i8* %p)
-// G32-DAG: define dllexport void @_ZN11ExportAllocdlEPv(i8* %p)
-// G64-DAG: define dllexport void @_ZN11ExportAllocdlEPv(i8* %p)
+// M32-DAG: define dso_local dllexport void @"\01??3ExportAlloc@@SAXPAX at Z"(i8* %p)
+// M64-DAG: define dso_local dllexport void @"\01??3ExportAlloc@@SAXPEAX at Z"(i8* %p)
+// G32-DAG: define dso_local dllexport void @_ZN11ExportAllocdlEPv(i8* %p)
+// G64-DAG: define dso_local dllexport void @_ZN11ExportAllocdlEPv(i8* %p)
 void ExportAlloc::operator delete(void* p) { free(p); }
 
-// M32-DAG: define dllexport void @"\01??_VExportAlloc@@SAXPAX at Z"(i8* %p)
-// M64-DAG: define dllexport void @"\01??_VExportAlloc@@SAXPEAX at Z"(i8* %p)
-// G32-DAG: define dllexport void @_ZN11ExportAllocdaEPv(i8* %p)
-// G64-DAG: define dllexport void @_ZN11ExportAllocdaEPv(i8* %p)
+// M32-DAG: define dso_local dllexport void @"\01??_VExportAlloc@@SAXPAX at Z"(i8* %p)
+// M64-DAG: define dso_local dllexport void @"\01??_VExportAlloc@@SAXPEAX at Z"(i8* %p)
+// G32-DAG: define dso_local dllexport void @_ZN11ExportAllocdaEPv(i8* %p)
+// G64-DAG: define dso_local dllexport void @_ZN11ExportAllocdaEPv(i8* %p)
 void ExportAlloc::operator delete[](void* p) { free(p); }
 
 
@@ -501,125 +501,125 @@ struct MemFunTmpl {
 
 // Export implicit instantiation of an exported member function template.
 void useMemFunTmpl() {
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$exportedNormal at UImplicitInst_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
-  // M64-DAG: define weak_odr dllexport                void @"\01??$exportedNormal at UImplicitInst_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
-  // G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI21ImplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this)
-  // G64-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl14exportedNormalI21ImplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this)
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??$exportedNormal at UImplicitInst_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
+  // M64-DAG: define weak_odr dso_local dllexport                void @"\01??$exportedNormal at UImplicitInst_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
+  // G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI21ImplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this)
+  // G64-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl14exportedNormalI21ImplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this)
   MemFunTmpl().exportedNormal<ImplicitInst_Exported>();
 
-  // MSC-DAG: define weak_odr dllexport                void @"\01??$exportedStatic at UImplicitInst_Exported@@@MemFunTmpl@@SAXXZ"()
-  // GNU-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl14exportedStaticI21ImplicitInst_ExportedEEvv()
+  // MSC-DAG: define weak_odr dso_local dllexport                void @"\01??$exportedStatic at UImplicitInst_Exported@@@MemFunTmpl@@SAXXZ"()
+  // GNU-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl14exportedStaticI21ImplicitInst_ExportedEEvv()
   MemFunTmpl().exportedStatic<ImplicitInst_Exported>();
 }
 
 
 // Export explicit instantiation declaration of an exported member function
 // template.
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$exportedNormal at UExplicitDecl_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
-// M64-DAG: define weak_odr dllexport                void @"\01??$exportedNormal at UExplicitDecl_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
-// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl14exportedNormalI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this)
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??$exportedNormal at UExplicitDecl_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
+// M64-DAG: define weak_odr dso_local dllexport                void @"\01??$exportedNormal at UExplicitDecl_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl14exportedNormalI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this)
 extern template void MemFunTmpl::exportedNormal<ExplicitDecl_Exported>();
        template void MemFunTmpl::exportedNormal<ExplicitDecl_Exported>();
 
-// MSC-DAG: define weak_odr dllexport                void @"\01??$exportedStatic at UExplicitDecl_Exported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl14exportedStaticI21ExplicitDecl_ExportedEEvv()
+// MSC-DAG: define weak_odr dso_local dllexport                void @"\01??$exportedStatic at UExplicitDecl_Exported@@@MemFunTmpl@@SAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl14exportedStaticI21ExplicitDecl_ExportedEEvv()
 extern template void MemFunTmpl::exportedStatic<ExplicitDecl_Exported>();
        template void MemFunTmpl::exportedStatic<ExplicitDecl_Exported>();
 
 
 // Export explicit instantiation definition of an exported member function
 // template.
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$exportedNormal at UExplicitInst_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
-// M64-DAG: define weak_odr dllexport                void @"\01??$exportedNormal at UExplicitInst_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
-// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl14exportedNormalI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this)
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??$exportedNormal at UExplicitInst_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
+// M64-DAG: define weak_odr dso_local dllexport                void @"\01??$exportedNormal at UExplicitInst_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl14exportedNormalI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this)
 template void MemFunTmpl::exportedNormal<ExplicitInst_Exported>();
 
-// MSC-DAG: define weak_odr dllexport                void @"\01??$exportedStatic at UExplicitInst_Exported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl14exportedStaticI21ExplicitInst_ExportedEEvv()
+// MSC-DAG: define weak_odr dso_local dllexport                void @"\01??$exportedStatic at UExplicitInst_Exported@@@MemFunTmpl@@SAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl14exportedStaticI21ExplicitInst_ExportedEEvv()
 template void MemFunTmpl::exportedStatic<ExplicitInst_Exported>();
 
 
 // Export specialization of an exported member function template.
-// M32-DAG: define          dllexport x86_thiscallcc void @"\01??$exportedNormal at UExplicitSpec_Def_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
-// M64-DAG: define          dllexport                void @"\01??$exportedNormal at UExplicitSpec_Def_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
-// G32-DAG: define          dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define          dllexport                void @_ZN10MemFunTmpl14exportedNormalI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this)
+// M32-DAG: define          dso_local dllexport x86_thiscallcc void @"\01??$exportedNormal at UExplicitSpec_Def_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
+// M64-DAG: define          dso_local dllexport                void @"\01??$exportedNormal at UExplicitSpec_Def_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
+// G32-DAG: define          dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define          dso_local dllexport                void @_ZN10MemFunTmpl14exportedNormalI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this)
 template<> __declspec(dllexport) void MemFunTmpl::exportedNormal<ExplicitSpec_Def_Exported>() {}
 
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$exportedNormal at UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
-// M64-DAG: define weak_odr dllexport                void @"\01??$exportedNormal at UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
-// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl14exportedNormalI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this)
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??$exportedNormal at UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
+// M64-DAG: define weak_odr dso_local dllexport                void @"\01??$exportedNormal at UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl14exportedNormalI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this)
 template<> __declspec(dllexport) inline void MemFunTmpl::exportedNormal<ExplicitSpec_InlineDef_Exported>() {}
 
-// MSC-DAG: define          dllexport                void @"\01??$exportedStatic at UExplicitSpec_Def_Exported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define          dllexport                void @_ZN10MemFunTmpl14exportedStaticI25ExplicitSpec_Def_ExportedEEvv()
+// MSC-DAG: define          dso_local dllexport                void @"\01??$exportedStatic at UExplicitSpec_Def_Exported@@@MemFunTmpl@@SAXXZ"()
+// GNU-DAG: define          dso_local dllexport                void @_ZN10MemFunTmpl14exportedStaticI25ExplicitSpec_Def_ExportedEEvv()
 template<> __declspec(dllexport) void MemFunTmpl::exportedStatic<ExplicitSpec_Def_Exported>() {}
 
-// MSC-DAG: define weak_odr dllexport                void @"\01??$exportedStatic at UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl14exportedStaticI31ExplicitSpec_InlineDef_ExportedEEvv()
+// MSC-DAG: define weak_odr dso_local dllexport                void @"\01??$exportedStatic at UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@SAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl14exportedStaticI31ExplicitSpec_InlineDef_ExportedEEvv()
 template<> __declspec(dllexport) inline void MemFunTmpl::exportedStatic<ExplicitSpec_InlineDef_Exported>() {}
 
 
 // Not exporting specialization of an exported member function template without
-// explicit dllexport.
-// M32-DAG: define                    x86_thiscallcc void @"\01??$exportedNormal at UExplicitSpec_NotExported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
-// M64-DAG: define                                   void @"\01??$exportedNormal at UExplicitSpec_NotExported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
-// G32-DAG: define                    x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI24ExplicitSpec_NotExportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define                                   void @_ZN10MemFunTmpl14exportedNormalI24ExplicitSpec_NotExportedEEvv(%struct.MemFunTmpl* %this)
+// explicit dso_local dllexport.
+// M32-DAG: define          dso_local x86_thiscallcc void @"\01??$exportedNormal at UExplicitSpec_NotExported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
+// M64-DAG: define          dso_local                void @"\01??$exportedNormal at UExplicitSpec_NotExported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
+// G32-DAG: define          dso_local x86_thiscallcc void @_ZN10MemFunTmpl14exportedNormalI24ExplicitSpec_NotExportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define          dso_local                void @_ZN10MemFunTmpl14exportedNormalI24ExplicitSpec_NotExportedEEvv(%struct.MemFunTmpl* %this)
 template<> void MemFunTmpl::exportedNormal<ExplicitSpec_NotExported>() {}
 
-// M32-DAG: define                                   void @"\01??$exportedStatic at UExplicitSpec_NotExported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define                                   void @_ZN10MemFunTmpl14exportedStaticI24ExplicitSpec_NotExportedEEvv()
+// M32-DAG: define          dso_local                void @"\01??$exportedStatic at UExplicitSpec_NotExported@@@MemFunTmpl@@SAXXZ"()
+// GNU-DAG: define          dso_local                void @_ZN10MemFunTmpl14exportedStaticI24ExplicitSpec_NotExportedEEvv()
 template<> void MemFunTmpl::exportedStatic<ExplicitSpec_NotExported>() {}
 
 
 // Export explicit instantiation declaration of a non-exported member function
 // template.
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$normalDef at UExplicitDecl_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
-// M64-DAG: define weak_odr dllexport                void @"\01??$normalDef at UExplicitDecl_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
-// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this)
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??$normalDef at UExplicitDecl_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
+// M64-DAG: define weak_odr dso_local dllexport                void @"\01??$normalDef at UExplicitDecl_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ExportedEEvv(%struct.MemFunTmpl* %this)
 extern template __declspec(dllexport) void MemFunTmpl::normalDef<ExplicitDecl_Exported>();
        template __declspec(dllexport) void MemFunTmpl::normalDef<ExplicitDecl_Exported>();
 
-// M32-DAG: define weak_odr dllexport                void @"\01??$staticDef at UExplicitDecl_Exported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl9staticDefI21ExplicitDecl_ExportedEEvv()
+// M32-DAG: define weak_odr dso_local dllexport                void @"\01??$staticDef at UExplicitDecl_Exported@@@MemFunTmpl@@SAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl9staticDefI21ExplicitDecl_ExportedEEvv()
 extern template __declspec(dllexport) void MemFunTmpl::staticDef<ExplicitDecl_Exported>();
        template __declspec(dllexport) void MemFunTmpl::staticDef<ExplicitDecl_Exported>();
 
 
 // Export explicit instantiation definition of a non-exported member function
 // template.
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$normalDef at UExplicitInst_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
-// M64-DAG: define weak_odr dllexport                void @"\01??$normalDef at UExplicitInst_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
-// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this)
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??$normalDef at UExplicitInst_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
+// M64-DAG: define weak_odr dso_local dllexport                void @"\01??$normalDef at UExplicitInst_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ExportedEEvv(%struct.MemFunTmpl* %this)
 template __declspec(dllexport) void MemFunTmpl::normalDef<ExplicitInst_Exported>();
 
-// MSC-DAG: define weak_odr dllexport                void @"\01??$staticDef at UExplicitInst_Exported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl9staticDefI21ExplicitInst_ExportedEEvv()
+// MSC-DAG: define weak_odr dso_local dllexport                void @"\01??$staticDef at UExplicitInst_Exported@@@MemFunTmpl@@SAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl9staticDefI21ExplicitInst_ExportedEEvv()
 template __declspec(dllexport) void MemFunTmpl::staticDef<ExplicitInst_Exported>();
 
 
 // Export specialization of a non-exported member function template.
-// M32-DAG: define          dllexport x86_thiscallcc void @"\01??$normalDef at UExplicitSpec_Def_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
-// M64-DAG: define          dllexport                void @"\01??$normalDef at UExplicitSpec_Def_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??$normalDef at UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
-// M64-DAG: define weak_odr dllexport                void @"\01??$normalDef at UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
-// G32-DAG: define          dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define          dllexport                void @_ZN10MemFunTmpl9normalDefI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this)
-// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this)
+// M32-DAG: define          dso_local dllexport x86_thiscallcc void @"\01??$normalDef at UExplicitSpec_Def_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
+// M64-DAG: define          dso_local dllexport                void @"\01??$normalDef at UExplicitSpec_Def_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??$normalDef at UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
+// M64-DAG: define weak_odr dso_local dllexport                void @"\01??$normalDef at UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
+// G32-DAG: define          dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define          dso_local dllexport                void @_ZN10MemFunTmpl9normalDefI25ExplicitSpec_Def_ExportedEEvv(%struct.MemFunTmpl* %this)
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ExportedEEvv(%struct.MemFunTmpl* %this)
 template<> __declspec(dllexport) void MemFunTmpl::normalDef<ExplicitSpec_Def_Exported>() {}
 template<> __declspec(dllexport) inline void MemFunTmpl::normalDef<ExplicitSpec_InlineDef_Exported>() {}
 
-// MSC-DAG: define          dllexport                void @"\01??$staticDef at UExplicitSpec_Def_Exported@@@MemFunTmpl@@SAXXZ"()
-// MSC-DAG: define weak_odr dllexport                void @"\01??$staticDef at UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define          dllexport                void @_ZN10MemFunTmpl9staticDefI25ExplicitSpec_Def_ExportedEEvv()
-// GNU-DAG: define weak_odr dllexport                void @_ZN10MemFunTmpl9staticDefI31ExplicitSpec_InlineDef_ExportedEEvv()
+// MSC-DAG: define          dso_local dllexport                void @"\01??$staticDef at UExplicitSpec_Def_Exported@@@MemFunTmpl@@SAXXZ"()
+// MSC-DAG: define weak_odr dso_local dllexport                void @"\01??$staticDef at UExplicitSpec_InlineDef_Exported@@@MemFunTmpl@@SAXXZ"()
+// GNU-DAG: define          dso_local dllexport                void @_ZN10MemFunTmpl9staticDefI25ExplicitSpec_Def_ExportedEEvv()
+// GNU-DAG: define weak_odr dso_local dllexport                void @_ZN10MemFunTmpl9staticDefI31ExplicitSpec_InlineDef_ExportedEEvv()
 template<> __declspec(dllexport) void MemFunTmpl::staticDef<ExplicitSpec_Def_Exported>() {}
 template<> __declspec(dllexport) inline void MemFunTmpl::staticDef<ExplicitSpec_InlineDef_Exported>() {}
 
@@ -633,49 +633,49 @@ template<typename T> const int MemVarTmp
 template<typename T> const int MemVarTmpl::ExportedStaticVar;
 
 // Export implicit instantiation of an exported member variable template.
-// MSC-DAG: @"\01??$ExportedStaticVar at UImplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ImplicitInst_ExportedEE       = weak_odr dllexport constant i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExportedStaticVar at UImplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ImplicitInst_ExportedEE       = weak_odr dso_local dllexport constant i32 1, comdat, align 4
 int useMemVarTmpl() { return MemVarTmpl::ExportedStaticVar<ImplicitInst_Exported>; }
 
 // Export explicit instantiation declaration of an exported member variable
 // template.
-// MSC-DAG: @"\01??$ExportedStaticVar at UExplicitDecl_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ExplicitDecl_ExportedEE       = weak_odr dllexport constant i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExportedStaticVar at UExplicitDecl_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ExplicitDecl_ExportedEE       = weak_odr dso_local dllexport constant i32 1, comdat, align 4
 extern template const int MemVarTmpl::ExportedStaticVar<ExplicitDecl_Exported>;
        template const int MemVarTmpl::ExportedStaticVar<ExplicitDecl_Exported>;
 
 // Export explicit instantiation definition of an exported member variable
 // template.
-// MSC-DAG: @"\01??$ExportedStaticVar at UExplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ExplicitInst_ExportedEE       = weak_odr dllexport constant i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExportedStaticVar at UExplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI21ExplicitInst_ExportedEE       = weak_odr dso_local dllexport constant i32 1, comdat, align 4
 template const int MemVarTmpl::ExportedStaticVar<ExplicitInst_Exported>;
 
 // Export specialization of an exported member variable template.
-// MSC-DAG: @"\01??$ExportedStaticVar at UExplicitSpec_Def_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI25ExplicitSpec_Def_ExportedEE       = dllexport constant i32 1, align 4
+// MSC-DAG: @"\01??$ExportedStaticVar at UExplicitSpec_Def_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI25ExplicitSpec_Def_ExportedEE       = dso_local dllexport constant i32 1, align 4
 template<> __declspec(dllexport) const int MemVarTmpl::ExportedStaticVar<ExplicitSpec_Def_Exported> = 1;
 
 // Not exporting specialization of an exported member variable template without
 // explicit dllexport.
-// MSC-DAG: @"\01??$ExportedStaticVar at UExplicitSpec_NotExported@@@MemVarTmpl@@2HB" = weak_odr constant i32 1, comdat, align 4
-// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI24ExplicitSpec_NotExportedEE       = constant i32 1, align 4
+// MSC-DAG: @"\01??$ExportedStaticVar at UExplicitSpec_NotExported@@@MemVarTmpl@@2HB" = weak_odr dso_local constant i32 1, comdat, align 4
+// GNU-DAG: @_ZN10MemVarTmpl17ExportedStaticVarI24ExplicitSpec_NotExportedEE       = dso_local constant i32 1, align 4
 template<> const int MemVarTmpl::ExportedStaticVar<ExplicitSpec_NotExported> = 1;
 
 
 // Export explicit instantiation declaration of a non-exported member variable
 // template.
-// MSC-DAG: @"\01??$StaticVar at UExplicitDecl_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitDecl_ExportedEE        = weak_odr dllexport constant i32 1, comdat, align 4
+// MSC-DAG: @"\01??$StaticVar at UExplicitDecl_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitDecl_ExportedEE        = weak_odr dso_local dllexport constant i32 1, comdat, align 4
 extern template __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitDecl_Exported>;
        template __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitDecl_Exported>;
 
 // Export explicit instantiation definition of a non-exported member variable
 // template.
-// MSC-DAG: @"\01??$StaticVar at UExplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitInst_ExportedEE        = weak_odr dllexport constant i32 1, comdat, align 4
+// MSC-DAG: @"\01??$StaticVar at UExplicitInst_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitInst_ExportedEE        = weak_odr dso_local dllexport constant i32 1, comdat, align 4
 template __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitInst_Exported>;
 
 // Export specialization of a non-exported member variable template.
-// MSC-DAG: @"\01??$StaticVar at UExplicitSpec_Def_Exported@@@MemVarTmpl@@2HB" = weak_odr dllexport constant i32 1, comdat, align 4
-// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI25ExplicitSpec_Def_ExportedEE        = dllexport constant i32 1, align 4
+// MSC-DAG: @"\01??$StaticVar at UExplicitSpec_Def_Exported@@@MemVarTmpl@@2HB" = weak_odr dso_local dllexport constant i32 1, comdat, align 4
+// GNU-DAG: @_ZN10MemVarTmpl9StaticVarI25ExplicitSpec_Def_ExportedEE        = dso_local dllexport constant i32 1, align 4
 template<> __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitSpec_Def_Exported> = 1;

Modified: cfe/trunk/test/CodeGenCXX/dllexport-ms-friend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllexport-ms-friend.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllexport-ms-friend.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllexport-ms-friend.cpp Fri Feb 23 11:30:48 2018
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple %ms_abi_triple -fms-extensions -emit-llvm -O0 -o - %s | FileCheck %s
 
 // Friend functions defined in classes are emitted.
-// CHECK: define weak_odr dllexport void @"\01?friend1@@YAXXZ"()
+// CHECK: define weak_odr dso_local dllexport void @"\01?friend1@@YAXXZ"()
 struct FuncFriend1 {
   friend __declspec(dllexport) void friend1() {}
 };

Modified: cfe/trunk/test/CodeGenCXX/dllexport-pr26549.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllexport-pr26549.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllexport-pr26549.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllexport-pr26549.cpp Fri Feb 23 11:30:48 2018
@@ -3,7 +3,7 @@
 template <typename> struct MessageT { };
 extern template struct MessageT<int>;
 
-// CHECK: define weak_odr dllexport {{.*}} %struct.MessageT* @"\01??4?$MessageT at H@@QEAAAEAU0 at AEBU0@@Z"(
+// CHECK: define weak_odr dso_local dllexport {{.*}} %struct.MessageT* @"\01??4?$MessageT at H@@QEAAAEAU0 at AEBU0@@Z"(
 template struct __declspec(dllexport) MessageT<int>;
 // Previously we crashed when this dllexport was the last thing in the file.
 // DO NOT ADD MORE TESTS AFTER THIS LINE!

Modified: cfe/trunk/test/CodeGenCXX/dllexport-vtable-thunks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllexport-vtable-thunks.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllexport-vtable-thunks.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllexport-vtable-thunks.cpp Fri Feb 23 11:30:48 2018
@@ -11,7 +11,7 @@ struct __declspec(dllexport) C : A, B {
   virtual void m();
 };
 void C::m() {}
-// CHECK: define dllexport void @_ZThn8_N1C1mEv
+// CHECK: define dso_local dllexport void @_ZThn8_N1C1mEv
 
 struct Base {
   virtual void m();
@@ -20,4 +20,4 @@ struct __declspec(dllexport) Derived : v
   virtual void m();
 };
 void Derived::m() {}
-// CHECK: define dllexport void @_ZTv0_n24_N7Derived1mEv
+// CHECK: define dso_local dllexport void @_ZTv0_n24_N7Derived1mEv

Modified: cfe/trunk/test/CodeGenCXX/dllexport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllexport.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllexport.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllexport.cpp Fri Feb 23 11:30:48 2018
@@ -40,42 +40,42 @@ struct External { int v; };
 __declspec(dllexport) extern int ExternGlobalDecl;
 
 // dllexport implies a definition.
-// MSC-DAG: @"\01?GlobalDef@@3HA" = dllexport global i32 0, align 4
-// GNU-DAG: @GlobalDef            = dllexport global i32 0, align 4
+// MSC-DAG: @"\01?GlobalDef@@3HA" = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @GlobalDef            = dso_local dllexport global i32 0, align 4
 __declspec(dllexport) int GlobalDef;
 
 // Export definition.
-// MSC-DAG: @"\01?GlobalInit1@@3HA" = dllexport global i32 1, align 4
-// GNU-DAG: @GlobalInit1            = dllexport global i32 1, align 4
+// MSC-DAG: @"\01?GlobalInit1@@3HA" = dso_local dllexport global i32 1, align 4
+// GNU-DAG: @GlobalInit1            = dso_local dllexport global i32 1, align 4
 __declspec(dllexport) int GlobalInit1 = 1;
 
-// MSC-DAG: @"\01?GlobalInit2@@3HA" = dllexport global i32 1, align 4
-// GNU-DAG: @GlobalInit2            = dllexport global i32 1, align 4
+// MSC-DAG: @"\01?GlobalInit2@@3HA" = dso_local dllexport global i32 1, align 4
+// GNU-DAG: @GlobalInit2            = dso_local dllexport global i32 1, align 4
 int __declspec(dllexport) GlobalInit2 = 1;
 
 // Declare, then export definition.
-// MSC-DAG: @"\01?GlobalDeclInit@@3HA" = dllexport global i32 1, align 4
-// GNU-DAG: @GlobalDeclInit            = dllexport global i32 1, align 4
+// MSC-DAG: @"\01?GlobalDeclInit@@3HA" = dso_local dllexport global i32 1, align 4
+// GNU-DAG: @GlobalDeclInit            = dso_local dllexport global i32 1, align 4
 __declspec(dllexport) extern int GlobalDeclInit;
 int GlobalDeclInit = 1;
 
 // Redeclarations
-// MSC-DAG: @"\01?GlobalRedecl1@@3HA" = dllexport global i32 0, align 4
-// GNU-DAG: @GlobalRedecl1            = dllexport global i32 0, align 4
+// MSC-DAG: @"\01?GlobalRedecl1@@3HA" = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @GlobalRedecl1            = dso_local dllexport global i32 0, align 4
 __declspec(dllexport) extern int GlobalRedecl1;
 __declspec(dllexport)        int GlobalRedecl1;
 
-// MSC-DAG: @"\01?GlobalRedecl2@@3HA" = dllexport global i32 0, align 4
-// GNU-DAG: @GlobalRedecl2            = dllexport global i32 0, align 4
+// MSC-DAG: @"\01?GlobalRedecl2@@3HA" = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @GlobalRedecl2            = dso_local dllexport global i32 0, align 4
 __declspec(dllexport) extern int GlobalRedecl2;
                              int GlobalRedecl2;
 
-// MSC-DAG: @"\01?ExternalGlobal at ns@@3HA" = dllexport global i32 0, align 4
-// GNU-DAG: @_ZN2ns14ExternalGlobalE      = dllexport global i32 0, align 4
+// MSC-DAG: @"\01?ExternalGlobal at ns@@3HA" = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @_ZN2ns14ExternalGlobalE      = dso_local dllexport global i32 0, align 4
 namespace ns { __declspec(dllexport) int ExternalGlobal; }
 
-// MSC-DAG: @"\01?ExternalAutoTypeGlobal@@3UExternal@@A" = dllexport global %struct.External zeroinitializer, align 4
-// GNU-DAG: @ExternalAutoTypeGlobal                      = dllexport global %struct.External zeroinitializer, align 4
+// MSC-DAG: @"\01?ExternalAutoTypeGlobal@@3UExternal@@A" = dso_local dllexport global %struct.External zeroinitializer, align 4
+// GNU-DAG: @ExternalAutoTypeGlobal                      = dso_local dllexport global %struct.External zeroinitializer, align 4
 __declspec(dllexport) auto ExternalAutoTypeGlobal = External();
 
 int f();
@@ -86,7 +86,7 @@ int __declspec(dllexport) nonInlineStati
   return x++;
 };
 
-// MSC-DAG: @"\01?x@?1??inlineStaticLocalsFunc@@YAHXZ at 4HA" = weak_odr dllexport global i32 0, comdat
+// MSC-DAG: @"\01?x@?1??inlineStaticLocalsFunc@@YAHXZ at 4HA" = weak_odr dso_local dllexport global i32 0, comdat
 // MSC-DAG: @"\01??_B?1??inlineStaticLocalsFunc@@YAHXZ at 51" = weak_odr dllexport global i32 0, comdat
 // Note: MinGW doesn't seem to export the static local here.
 inline int __declspec(dllexport) inlineStaticLocalsFunc() {
@@ -102,49 +102,49 @@ inline int __declspec(dllexport) inlineS
 
 // Declarations are not exported.
 
-// MSC-DAG: @"\01??$VarTmplImplicitDef at UImplicitInst_Exported@@@@3HA" = external global
-// GNU-DAG: @_Z18VarTmplImplicitDefI21ImplicitInst_ExportedE          = external global
+// MSC-DAG: @"\01??$VarTmplImplicitDef at UImplicitInst_Exported@@@@3HA" = external dso_local global
+// GNU-DAG: @_Z18VarTmplImplicitDefI21ImplicitInst_ExportedE          = external dso_local global
 template<typename T> __declspec(dllexport) extern int VarTmplImplicitDef;
 USEVAR(VarTmplImplicitDef<ImplicitInst_Exported>)
 
 // Export definition.
-// MSC-DAG: @"\01??$VarTmplInit1 at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z12VarTmplInit1I21ExplicitInst_ExportedE          = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmplInit1 at UExplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4
+// GNU-DAG: @_Z12VarTmplInit1I21ExplicitInst_ExportedE          = weak_odr dso_local dllexport global i32 1, comdat, align 4
 template<typename T> __declspec(dllexport) int VarTmplInit1 = 1;
 INSTVAR(VarTmplInit1<ExplicitInst_Exported>)
 
-// MSC-DAG: @"\01??$VarTmplInit2 at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z12VarTmplInit2I21ExplicitInst_ExportedE          = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmplInit2 at UExplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4
+// GNU-DAG: @_Z12VarTmplInit2I21ExplicitInst_ExportedE          = weak_odr dso_local dllexport global i32 1, comdat, align 4
 template<typename T> int __declspec(dllexport) VarTmplInit2 = 1;
 INSTVAR(VarTmplInit2<ExplicitInst_Exported>)
 
 // Declare, then export definition.
-// MSC-DAG: @"\01??$VarTmplDeclInit at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z15VarTmplDeclInitI21ExplicitInst_ExportedE          = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmplDeclInit at UExplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4
+// GNU-DAG: @_Z15VarTmplDeclInitI21ExplicitInst_ExportedE          = weak_odr dso_local dllexport global i32 1, comdat, align 4
 template<typename T> __declspec(dllexport) extern int VarTmplDeclInit;
 template<typename T>                              int VarTmplDeclInit = 1;
 INSTVAR(VarTmplDeclInit<ExplicitInst_Exported>)
 
 // Redeclarations
-// MSC-DAG: @"\01??$VarTmplRedecl1 at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z14VarTmplRedecl1I21ExplicitInst_ExportedE          = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmplRedecl1 at UExplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4
+// GNU-DAG: @_Z14VarTmplRedecl1I21ExplicitInst_ExportedE          = weak_odr dso_local dllexport global i32 1, comdat, align 4
 template<typename T> __declspec(dllexport) extern int VarTmplRedecl1;
 template<typename T> __declspec(dllexport)        int VarTmplRedecl1 = 1;
 INSTVAR(VarTmplRedecl1<ExplicitInst_Exported>)
 
-// MSC-DAG: @"\01??$VarTmplRedecl2 at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z14VarTmplRedecl2I21ExplicitInst_ExportedE          = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmplRedecl2 at UExplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4
+// GNU-DAG: @_Z14VarTmplRedecl2I21ExplicitInst_ExportedE          = weak_odr dso_local dllexport global i32 1, comdat, align 4
 template<typename T> __declspec(dllexport) extern int VarTmplRedecl2;
 template<typename T>                              int VarTmplRedecl2 = 1;
 INSTVAR(VarTmplRedecl2<ExplicitInst_Exported>)
 
-// MSC-DAG: @"\01??$ExternalVarTmpl at UExplicitInst_Exported@@@ns@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_ZN2ns15ExternalVarTmplI21ExplicitInst_ExportedEE        = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExternalVarTmpl at UExplicitInst_Exported@@@ns@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4
+// GNU-DAG: @_ZN2ns15ExternalVarTmplI21ExplicitInst_ExportedEE        = weak_odr dso_local dllexport global i32 1, comdat, align 4
 namespace ns { template<typename T> __declspec(dllexport) int ExternalVarTmpl = 1; }
 INSTVAR(ns::ExternalVarTmpl<ExplicitInst_Exported>)
 
-// MSC-DAG: @"\01??$ExternalAutoTypeVarTmpl at UExplicitInst_Exported@@@@3UExternal@@A" = weak_odr dllexport global %struct.External zeroinitializer, comdat, align 4
-// GNU-DAG: @_Z23ExternalAutoTypeVarTmplI21ExplicitInst_ExportedE                    = weak_odr dllexport global %struct.External zeroinitializer, comdat, align 4
+// MSC-DAG: @"\01??$ExternalAutoTypeVarTmpl at UExplicitInst_Exported@@@@3UExternal@@A" = weak_odr dso_local dllexport global %struct.External zeroinitializer, comdat, align 4
+// GNU-DAG: @_Z23ExternalAutoTypeVarTmplI21ExplicitInst_ExportedE                    = weak_odr dso_local dllexport global %struct.External zeroinitializer, comdat, align 4
 template<typename T> __declspec(dllexport) auto ExternalAutoTypeVarTmpl = External();
 template External ExternalAutoTypeVarTmpl<ExplicitInst_Exported>;
 
@@ -153,55 +153,55 @@ template<typename T> int VarTmpl = 1;
 template<typename T> __declspec(dllexport) int ExportedVarTmpl = 1;
 
 // Export implicit instantiation of an exported variable template.
-// MSC-DAG: @"\01??$ExportedVarTmpl at UImplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z15ExportedVarTmplI21ImplicitInst_ExportedE          = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExportedVarTmpl at UImplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4
+// GNU-DAG: @_Z15ExportedVarTmplI21ImplicitInst_ExportedE          = weak_odr dso_local dllexport global i32 1, comdat, align 4
 USEVAR(ExportedVarTmpl<ImplicitInst_Exported>)
 
 // Export explicit instantiation declaration of an exported variable template.
-// MSC-DAG: @"\01??$ExportedVarTmpl at UImplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitDecl_ExportedE          = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExportedVarTmpl at UImplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4
+// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitDecl_ExportedE          = weak_odr dso_local dllexport global i32 1, comdat, align 4
 extern template int ExportedVarTmpl<ExplicitDecl_Exported>;
        template int ExportedVarTmpl<ExplicitDecl_Exported>;
 
 // Export explicit instantiation definition of an exported variable template.
-// MSC-DAG: @"\01??$ExportedVarTmpl at UImplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitInst_ExportedE          = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$ExportedVarTmpl at UImplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4
+// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitInst_ExportedE          = weak_odr dso_local dllexport global i32 1, comdat, align 4
 template __declspec(dllexport) int ExportedVarTmpl<ExplicitInst_Exported>;
 
 // Export specialization of an exported variable template.
-// MSC-DAG: @"\01??$ExportedVarTmpl at UExplicitSpec_Exported@@@@3HA" = dllexport global i32 0, align 4
-// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitSpec_ExportedE          = dllexport global i32 0, align 4
+// MSC-DAG: @"\01??$ExportedVarTmpl at UExplicitSpec_Exported@@@@3HA" = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @_Z15ExportedVarTmplI21ExplicitSpec_ExportedE          = dso_local dllexport global i32 0, align 4
 template<> __declspec(dllexport) int ExportedVarTmpl<ExplicitSpec_Exported>;
 
-// MSC-DAG: @"\01??$ExportedVarTmpl at UExplicitSpec_Def_Exported@@@@3HA" = dllexport global i32 1, align 4
-// GNU-DAG: @_Z15ExportedVarTmplI25ExplicitSpec_Def_ExportedE          = dllexport global i32 1, align 4
+// MSC-DAG: @"\01??$ExportedVarTmpl at UExplicitSpec_Def_Exported@@@@3HA" = dso_local dllexport global i32 1, align 4
+// GNU-DAG: @_Z15ExportedVarTmplI25ExplicitSpec_Def_ExportedE          = dso_local dllexport global i32 1, align 4
 template<> __declspec(dllexport) int ExportedVarTmpl<ExplicitSpec_Def_Exported> = 1;
 
 // Not exporting specialization of an exported variable template without
 // explicit dllexport.
-// MSC-DAG: @"\01??$ExportedVarTmpl at UExplicitSpec_NotExported@@@@3HA" = global i32 0, align 4
-// GNU-DAG: @_Z15ExportedVarTmplI24ExplicitSpec_NotExportedE          = global i32 0, align 4
+// MSC-DAG: @"\01??$ExportedVarTmpl at UExplicitSpec_NotExported@@@@3HA" = dso_local global i32 0, align 4
+// GNU-DAG: @_Z15ExportedVarTmplI24ExplicitSpec_NotExportedE          = dso_local global i32 0, align 4
 template<> int ExportedVarTmpl<ExplicitSpec_NotExported>;
 
 
 // Export explicit instantiation declaration of a non-exported variable template.
-// MSC-DAG: @"\01??$VarTmpl at UExplicitDecl_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z7VarTmplI21ExplicitDecl_ExportedE           = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmpl at UExplicitDecl_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4
+// GNU-DAG: @_Z7VarTmplI21ExplicitDecl_ExportedE           = weak_odr dso_local dllexport global i32 1, comdat, align 4
 extern template __declspec(dllexport) int VarTmpl<ExplicitDecl_Exported>;
        template __declspec(dllexport) int VarTmpl<ExplicitDecl_Exported>;
 
 // Export explicit instantiation definition of a non-exported variable template.
-// MSC-DAG: @"\01??$VarTmpl at UExplicitInst_Exported@@@@3HA" = weak_odr dllexport global i32 1, comdat, align 4
-// GNU-DAG: @_Z7VarTmplI21ExplicitInst_ExportedE           = weak_odr dllexport global i32 1, comdat, align 4
+// MSC-DAG: @"\01??$VarTmpl at UExplicitInst_Exported@@@@3HA" = weak_odr dso_local dllexport global i32 1, comdat, align 4
+// GNU-DAG: @_Z7VarTmplI21ExplicitInst_ExportedE           = weak_odr dso_local dllexport global i32 1, comdat, align 4
 template __declspec(dllexport) int VarTmpl<ExplicitInst_Exported>;
 
 // Export specialization of a non-exported variable template.
-// MSC-DAG: @"\01??$VarTmpl at UExplicitSpec_Exported@@@@3HA" = dllexport global i32 0, align 4
-// GNU-DAG: @_Z7VarTmplI21ExplicitSpec_ExportedE           = dllexport global i32 0, align 4
+// MSC-DAG: @"\01??$VarTmpl at UExplicitSpec_Exported@@@@3HA" = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @_Z7VarTmplI21ExplicitSpec_ExportedE           = dso_local dllexport global i32 0, align 4
 template<> __declspec(dllexport) int VarTmpl<ExplicitSpec_Exported>;
 
-// MSC-DAG: @"\01??$VarTmpl at UExplicitSpec_Def_Exported@@@@3HA" = dllexport global i32 1, align 4
-// GNU-DAG: @_Z7VarTmplI25ExplicitSpec_Def_ExportedE           = dllexport global i32 1, align 4
+// MSC-DAG: @"\01??$VarTmpl at UExplicitSpec_Def_Exported@@@@3HA" = dso_local dllexport global i32 1, align 4
+// GNU-DAG: @_Z7VarTmplI25ExplicitSpec_Def_ExportedE           = dso_local dllexport global i32 1, align 4
 template<> __declspec(dllexport) int VarTmpl<ExplicitSpec_Def_Exported> = 1;
 
 
@@ -213,46 +213,46 @@ template<> __declspec(dllexport) int Var
 // Declarations are not exported.
 
 // Export function definition.
-// MSC-DAG: define dllexport void @"\01?def@@YAXXZ"()
-// GNU-DAG: define dllexport void @_Z3defv()
+// MSC-DAG: define dso_local dllexport void @"\01?def@@YAXXZ"()
+// GNU-DAG: define dso_local dllexport void @_Z3defv()
 __declspec(dllexport) void def() {}
 
 // extern "C"
-// MSC-DAG: define dllexport void @externC()
-// GNU-DAG: define dllexport void @externC()
+// MSC-DAG: define dso_local dllexport void @externC()
+// GNU-DAG: define dso_local dllexport void @externC()
 extern "C" __declspec(dllexport) void externC() {}
 
 // Export inline function.
-// MSC-DAG: define weak_odr dllexport void @"\01?inlineFunc@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z10inlineFuncv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01?inlineFunc@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z10inlineFuncv()
 __declspec(dllexport) inline void inlineFunc() {}
 
-// MSC-DAG: define weak_odr dllexport void @"\01?inlineDecl@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z10inlineDeclv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01?inlineDecl@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z10inlineDeclv()
 __declspec(dllexport) inline void inlineDecl();
                              void inlineDecl() {}
 
-// MSC-DAG: define weak_odr dllexport void @"\01?inlineDef@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z9inlineDefv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01?inlineDef@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z9inlineDefv()
 __declspec(dllexport) void inlineDef();
                inline void inlineDef() {}
 
 // Redeclarations
-// MSC-DAG: define dllexport void @"\01?redecl1@@YAXXZ"()
-// GNU-DAG: define dllexport void @_Z7redecl1v()
+// MSC-DAG: define dso_local dllexport void @"\01?redecl1@@YAXXZ"()
+// GNU-DAG: define dso_local dllexport void @_Z7redecl1v()
 __declspec(dllexport) void redecl1();
 __declspec(dllexport) void redecl1() {}
 
-// MSC-DAG: define dllexport void @"\01?redecl2@@YAXXZ"()
-// GNU-DAG: define dllexport void @_Z7redecl2v()
+// MSC-DAG: define dso_local dllexport void @"\01?redecl2@@YAXXZ"()
+// GNU-DAG: define dso_local dllexport void @_Z7redecl2v()
 __declspec(dllexport) void redecl2();
                       void redecl2() {}
 
 // Friend functions
-// MSC-DAG: define dllexport void @"\01?friend1@@YAXXZ"()
-// GNU-DAG: define dllexport void @_Z7friend1v()
-// MSC-DAG: define dllexport void @"\01?friend2@@YAXXZ"()
-// GNU-DAG: define dllexport void @_Z7friend2v()
+// MSC-DAG: define dso_local dllexport void @"\01?friend1@@YAXXZ"()
+// GNU-DAG: define dso_local dllexport void @_Z7friend1v()
+// MSC-DAG: define dso_local dllexport void @"\01?friend2@@YAXXZ"()
+// GNU-DAG: define dso_local dllexport void @_Z7friend2v()
 struct FuncFriend {
   friend __declspec(dllexport) void friend1();
   friend __declspec(dllexport) void friend2();
@@ -261,13 +261,13 @@ __declspec(dllexport) void friend1() {}
                       void friend2() {}
 
 // Implicit declarations can be redeclared with dllexport.
-// MSC-DAG: define dllexport noalias i8* @"\01??2@{{YAPAXI|YAPEAX_K}}@Z"(
-// GNU-DAG: define dllexport noalias i8* @_Znw{{[yj]}}(
+// MSC-DAG: define dso_local dllexport noalias i8* @"\01??2@{{YAPAXI|YAPEAX_K}}@Z"(
+// GNU-DAG: define dso_local dllexport noalias i8* @_Znw{{[yj]}}(
 void* alloc(__SIZE_TYPE__ n);
 __declspec(dllexport) void* operator new(__SIZE_TYPE__ n) { return alloc(n); }
 
-// MSC-DAG: define dllexport void @"\01?externalFunc at ns@@YAXXZ"()
-// GNU-DAG: define dllexport void @_ZN2ns12externalFuncEv()
+// MSC-DAG: define dso_local dllexport void @"\01?externalFunc at ns@@YAXXZ"()
+// GNU-DAG: define dso_local dllexport void @_ZN2ns12externalFuncEv()
 namespace ns { __declspec(dllexport) void externalFunc() {} }
 
 
@@ -277,60 +277,60 @@ namespace ns { __declspec(dllexport) voi
 //===----------------------------------------------------------------------===//
 
 // Export function template definition.
-// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmplDef at UExplicitInst_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z11funcTmplDefI21ExplicitInst_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$funcTmplDef at UExplicitInst_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z11funcTmplDefI21ExplicitInst_ExportedEvv()
 template<typename T> __declspec(dllexport) void funcTmplDef() {}
 INST(funcTmplDef<ExplicitInst_Exported>)
 
 // Export inline function template.
-// MSC-DAG: define weak_odr dllexport void @"\01??$inlineFuncTmpl1 at UExplicitInst_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z15inlineFuncTmpl1I21ExplicitInst_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$inlineFuncTmpl1 at UExplicitInst_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z15inlineFuncTmpl1I21ExplicitInst_ExportedEvv()
 template<typename T> __declspec(dllexport) inline void inlineFuncTmpl1() {}
 INST(inlineFuncTmpl1<ExplicitInst_Exported>)
 
-// MSC-DAG: define weak_odr dllexport void @"\01??$inlineFuncTmpl2 at UExplicitInst_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z15inlineFuncTmpl2I21ExplicitInst_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$inlineFuncTmpl2 at UExplicitInst_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z15inlineFuncTmpl2I21ExplicitInst_ExportedEvv()
 template<typename T> inline void __attribute__((dllexport)) inlineFuncTmpl2() {}
 INST(inlineFuncTmpl2<ExplicitInst_Exported>)
 
-// MSC-DAG: define weak_odr dllexport void @"\01??$inlineFuncTmplDecl at UExplicitInst_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z18inlineFuncTmplDeclI21ExplicitInst_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$inlineFuncTmplDecl at UExplicitInst_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z18inlineFuncTmplDeclI21ExplicitInst_ExportedEvv()
 template<typename T> __declspec(dllexport) inline void inlineFuncTmplDecl();
 template<typename T>                              void inlineFuncTmplDecl() {}
 INST(inlineFuncTmplDecl<ExplicitInst_Exported>)
 
-// MSC-DAG: define weak_odr dllexport void @"\01??$inlineFuncTmplDef at UExplicitInst_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z17inlineFuncTmplDefI21ExplicitInst_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$inlineFuncTmplDef at UExplicitInst_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z17inlineFuncTmplDefI21ExplicitInst_ExportedEvv()
 template<typename T> __declspec(dllexport) void inlineFuncTmplDef();
 template<typename T>                inline void inlineFuncTmplDef() {}
 INST(inlineFuncTmplDef<ExplicitInst_Exported>)
 
 
 // Redeclarations
-// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmplRedecl1 at UExplicitInst_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z15funcTmplRedecl1I21ExplicitInst_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$funcTmplRedecl1 at UExplicitInst_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z15funcTmplRedecl1I21ExplicitInst_ExportedEvv()
 template<typename T> __declspec(dllexport) void funcTmplRedecl1();
 template<typename T> __declspec(dllexport) void funcTmplRedecl1() {}
 INST(funcTmplRedecl1<ExplicitInst_Exported>)
 
-// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmplRedecl2 at UExplicitInst_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z15funcTmplRedecl2I21ExplicitInst_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$funcTmplRedecl2 at UExplicitInst_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z15funcTmplRedecl2I21ExplicitInst_ExportedEvv()
 template<typename T> __declspec(dllexport) void funcTmplRedecl2();
 template<typename T>                       void funcTmplRedecl2() {}
 INST(funcTmplRedecl2<ExplicitInst_Exported>)
 
-// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmplRedecl3 at UExplicitInst_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z15funcTmplRedecl3I21ExplicitInst_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$funcTmplRedecl3 at UExplicitInst_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z15funcTmplRedecl3I21ExplicitInst_ExportedEvv()
 template<typename T> __declspec(dllexport) void funcTmplRedecl3();
 template<typename T>                       void funcTmplRedecl3() {}
 INST(funcTmplRedecl3<ExplicitInst_Exported>)
 
 
 // Function template friends
-// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmplFriend1 at UExplicitInst_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z15funcTmplFriend1I21ExplicitInst_ExportedEvv()
-// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmplFriend2 at UExplicitInst_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z15funcTmplFriend2I21ExplicitInst_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$funcTmplFriend1 at UExplicitInst_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z15funcTmplFriend1I21ExplicitInst_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$funcTmplFriend2 at UExplicitInst_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z15funcTmplFriend2I21ExplicitInst_ExportedEvv()
 struct FuncTmplFriend {
   template<typename T> friend __declspec(dllexport) void funcTmplFriend1();
   template<typename T> friend __declspec(dllexport) void funcTmplFriend2();
@@ -340,8 +340,8 @@ template<typename T>
 INST(funcTmplFriend1<ExplicitInst_Exported>)
 INST(funcTmplFriend2<ExplicitInst_Exported>)
 
-// MSC-DAG: define weak_odr dllexport void @"\01??$externalFuncTmpl at UExplicitInst_Exported@@@ns@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_ZN2ns16externalFuncTmplI21ExplicitInst_ExportedEEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$externalFuncTmpl at UExplicitInst_Exported@@@ns@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_ZN2ns16externalFuncTmplI21ExplicitInst_ExportedEEvv()
 namespace ns { template<typename T> __declspec(dllexport) void externalFuncTmpl() {} }
 INST(ns::externalFuncTmpl<ExplicitInst_Exported>)
 
@@ -350,55 +350,55 @@ template<typename T> void funcTmpl() {}
 template<typename T> __declspec(dllexport) void exportedFuncTmpl() {}
 
 // Export implicit instantiation of an exported function template.
-// MSC-DAG: define weak_odr dllexport void @"\01??$exportedFuncTmpl at UImplicitInst_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z16exportedFuncTmplI21ImplicitInst_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$exportedFuncTmpl at UImplicitInst_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z16exportedFuncTmplI21ImplicitInst_ExportedEvv()
 USE(exportedFuncTmpl<ImplicitInst_Exported>)
 
 // Export explicit instantiation declaration of an exported function template.
-// MSC-DAG: define weak_odr dllexport void @"\01??$exportedFuncTmpl at UExplicitDecl_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z16exportedFuncTmplI21ExplicitDecl_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$exportedFuncTmpl at UExplicitDecl_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z16exportedFuncTmplI21ExplicitDecl_ExportedEvv()
 extern template void exportedFuncTmpl<ExplicitDecl_Exported>();
        template void exportedFuncTmpl<ExplicitDecl_Exported>();
 
 // Export explicit instantiation definition of an exported function template.
-// MSC-DAG: define weak_odr dllexport void @"\01??$exportedFuncTmpl at UExplicitInst_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z16exportedFuncTmplI21ExplicitInst_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$exportedFuncTmpl at UExplicitInst_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z16exportedFuncTmplI21ExplicitInst_ExportedEvv()
 template void exportedFuncTmpl<ExplicitInst_Exported>();
 
 // Export specialization of an exported function template.
-// MSC-DAG: define dllexport void @"\01??$exportedFuncTmpl at UExplicitSpec_Def_Exported@@@@YAXXZ"()
-// GNU-DAG: define dllexport void @_Z16exportedFuncTmplI25ExplicitSpec_Def_ExportedEvv()
+// MSC-DAG: define dso_local dllexport void @"\01??$exportedFuncTmpl at UExplicitSpec_Def_Exported@@@@YAXXZ"()
+// GNU-DAG: define dso_local dllexport void @_Z16exportedFuncTmplI25ExplicitSpec_Def_ExportedEvv()
 template<> __declspec(dllexport) void exportedFuncTmpl<ExplicitSpec_Def_Exported>() {}
 
-// MSC-DAG: define weak_odr dllexport void @"\01??$exportedFuncTmpl at UExplicitSpec_InlineDef_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z16exportedFuncTmplI31ExplicitSpec_InlineDef_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$exportedFuncTmpl at UExplicitSpec_InlineDef_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z16exportedFuncTmplI31ExplicitSpec_InlineDef_ExportedEvv()
 template<> __declspec(dllexport) inline void exportedFuncTmpl<ExplicitSpec_InlineDef_Exported>() {}
 
 // Not exporting specialization of an exported function template without
 // explicit dllexport.
-// MSC-DAG: define void @"\01??$exportedFuncTmpl at UExplicitSpec_NotExported@@@@YAXXZ"()
-// GNU-DAG: define void @_Z16exportedFuncTmplI24ExplicitSpec_NotExportedEvv()
+// MSC-DAG: define dso_local void @"\01??$exportedFuncTmpl at UExplicitSpec_NotExported@@@@YAXXZ"()
+// GNU-DAG: define dso_local void @_Z16exportedFuncTmplI24ExplicitSpec_NotExportedEvv()
 template<> void exportedFuncTmpl<ExplicitSpec_NotExported>() {}
 
 
 // Export explicit instantiation declaration of a non-exported function template.
-// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmpl at UExplicitDecl_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z8funcTmplI21ExplicitDecl_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$funcTmpl at UExplicitDecl_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z8funcTmplI21ExplicitDecl_ExportedEvv()
 extern template __declspec(dllexport) void funcTmpl<ExplicitDecl_Exported>();
        template __declspec(dllexport) void funcTmpl<ExplicitDecl_Exported>();
 
 // Export explicit instantiation definition of a non-exported function template.
-// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmpl at UExplicitInst_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z8funcTmplI21ExplicitInst_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$funcTmpl at UExplicitInst_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z8funcTmplI21ExplicitInst_ExportedEvv()
 template __declspec(dllexport) void funcTmpl<ExplicitInst_Exported>();
 
 // Export specialization of a non-exported function template.
-// MSC-DAG: define dllexport void @"\01??$funcTmpl at UExplicitSpec_Def_Exported@@@@YAXXZ"()
-// GNU-DAG: define dllexport void @_Z8funcTmplI25ExplicitSpec_Def_ExportedEvv()
+// MSC-DAG: define dso_local dllexport void @"\01??$funcTmpl at UExplicitSpec_Def_Exported@@@@YAXXZ"()
+// GNU-DAG: define dso_local dllexport void @_Z8funcTmplI25ExplicitSpec_Def_ExportedEvv()
 template<> __declspec(dllexport) void funcTmpl<ExplicitSpec_Def_Exported>() {}
 
-// MSC-DAG: define weak_odr dllexport void @"\01??$funcTmpl at UExplicitSpec_InlineDef_Exported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr dllexport void @_Z8funcTmplI31ExplicitSpec_InlineDef_ExportedEvv()
+// MSC-DAG: define weak_odr dso_local dllexport void @"\01??$funcTmpl at UExplicitSpec_InlineDef_Exported@@@@YAXXZ"()
+// GNU-DAG: define weak_odr dso_local dllexport void @_Z8funcTmplI31ExplicitSpec_InlineDef_ExportedEvv()
 template<> __declspec(dllexport) inline void funcTmpl<ExplicitSpec_InlineDef_Exported>() {}
 
 
@@ -408,61 +408,61 @@ template<> __declspec(dllexport) inline
 //===----------------------------------------------------------------------===//
 
 // dllexport takes precedence over the dllimport if both are specified.
-// MSC-DAG: @"\01?PrecedenceGlobal1A@@3HA" = dllexport global i32 0, align 4
-// MSC-DAG: @"\01?PrecedenceGlobal1B@@3HA" = dllexport global i32 0, align 4
-// GNU-DAG: @PrecedenceGlobal1A            = dllexport global i32 0, align 4
-// GNU-DAG: @PrecedenceGlobal1B            = dllexport global i32 0, align 4
+// MSC-DAG: @"\01?PrecedenceGlobal1A@@3HA" = dso_local dllexport global i32 0, align 4
+// MSC-DAG: @"\01?PrecedenceGlobal1B@@3HA" = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @PrecedenceGlobal1A            = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @PrecedenceGlobal1B            = dso_local dllexport global i32 0, align 4
 __attribute__((dllimport, dllexport))       int PrecedenceGlobal1A; // dllimport ignored
 __declspec(dllimport) __declspec(dllexport) int PrecedenceGlobal1B; // dllimport ignored
 
-// MSC-DAG: @"\01?PrecedenceGlobal2A@@3HA" = dllexport global i32 0, align 4
-// MSC-DAG: @"\01?PrecedenceGlobal2B@@3HA" = dllexport global i32 0, align 4
-// GNU-DAG: @PrecedenceGlobal2A            = dllexport global i32 0, align 4
-// GNU-DAG: @PrecedenceGlobal2B            = dllexport global i32 0, align 4
+// MSC-DAG: @"\01?PrecedenceGlobal2A@@3HA" = dso_local dllexport global i32 0, align 4
+// MSC-DAG: @"\01?PrecedenceGlobal2B@@3HA" = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @PrecedenceGlobal2A            = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @PrecedenceGlobal2B            = dso_local dllexport global i32 0, align 4
 __attribute__((dllexport, dllimport))       int PrecedenceGlobal2A; // dllimport ignored
 __declspec(dllexport) __declspec(dllimport) int PrecedenceGlobal2B; // dllimport ignored
 
-// MSC-DAG: @"\01?PrecedenceGlobalRedecl1@@3HA" = dllexport global i32 0, align 4
-// GNU-DAG: @PrecedenceGlobalRedecl1            = dllexport global i32 0, align 4
+// MSC-DAG: @"\01?PrecedenceGlobalRedecl1@@3HA" = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @PrecedenceGlobalRedecl1            = dso_local dllexport global i32 0, align 4
 __declspec(dllexport) extern int PrecedenceGlobalRedecl1;
 __declspec(dllimport)        int PrecedenceGlobalRedecl1 = 0;
 
-// MSC-DAG: @"\01?PrecedenceGlobalRedecl2@@3HA" = dllexport global i32 0, align 4
-// GNU-DAG: @PrecedenceGlobalRedecl2            = dllexport global i32 0, align 4
+// MSC-DAG: @"\01?PrecedenceGlobalRedecl2@@3HA" = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @PrecedenceGlobalRedecl2            = dso_local dllexport global i32 0, align 4
 __declspec(dllimport) extern int PrecedenceGlobalRedecl2;
 __declspec(dllexport)        int PrecedenceGlobalRedecl2;
 
-// MSC-DAG: @"\01?PrecedenceGlobalMixed1@@3HA" = dllexport global i32 0, align 4
-// GNU-DAG: @PrecedenceGlobalMixed1            = dllexport global i32 0, align 4
+// MSC-DAG: @"\01?PrecedenceGlobalMixed1@@3HA" = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @PrecedenceGlobalMixed1            = dso_local dllexport global i32 0, align 4
 __attribute__((dllexport)) extern int PrecedenceGlobalMixed1;
 __declspec(dllimport)             int PrecedenceGlobalMixed1 = 0;
 
-// MSC-DAG: @"\01?PrecedenceGlobalMixed2@@3HA" = dllexport global i32 0, align 4
-// GNU-DAG: @PrecedenceGlobalMixed2            = dllexport global i32 0, align 4
+// MSC-DAG: @"\01?PrecedenceGlobalMixed2@@3HA" = dso_local dllexport global i32 0, align 4
+// GNU-DAG: @PrecedenceGlobalMixed2            = dso_local dllexport global i32 0, align 4
 __attribute__((dllimport)) extern int PrecedenceGlobalMixed2;
 __declspec(dllexport)             int PrecedenceGlobalMixed2;
 
-// MSC-DAG: define dllexport void @"\01?precedence1A@@YAXXZ"
-// MSC-DAG: define dllexport void @"\01?precedence1B@@YAXXZ"
-// GNU-DAG: define dllexport void @_Z12precedence1Av()
-// GNU-DAG: define dllexport void @_Z12precedence1Bv()
+// MSC-DAG: define dso_local dllexport void @"\01?precedence1A@@YAXXZ"
+// MSC-DAG: define dso_local dllexport void @"\01?precedence1B@@YAXXZ"
+// GNU-DAG: define dso_local dllexport void @_Z12precedence1Av()
+// GNU-DAG: define dso_local dllexport void @_Z12precedence1Bv()
 void __attribute__((dllimport, dllexport))       precedence1A() {}
 void __declspec(dllimport) __declspec(dllexport) precedence1B() {}
 
-// MSC-DAG: define dllexport void @"\01?precedence2A@@YAXXZ"
-// MSC-DAG: define dllexport void @"\01?precedence2B@@YAXXZ"
-// GNU-DAG: define dllexport void @_Z12precedence2Av()
-// GNU-DAG: define dllexport void @_Z12precedence2Bv()
+// MSC-DAG: define dso_local dllexport void @"\01?precedence2A@@YAXXZ"
+// MSC-DAG: define dso_local dllexport void @"\01?precedence2B@@YAXXZ"
+// GNU-DAG: define dso_local dllexport void @_Z12precedence2Av()
+// GNU-DAG: define dso_local dllexport void @_Z12precedence2Bv()
 void __attribute__((dllexport, dllimport))       precedence2A() {}
 void __declspec(dllexport) __declspec(dllimport) precedence2B() {}
 
-// MSC-DAG: define dllexport void @"\01?precedenceRedecl1@@YAXXZ"
-// GNU-DAG: define dllexport void @_Z17precedenceRedecl1v()
+// MSC-DAG: define dso_local dllexport void @"\01?precedenceRedecl1@@YAXXZ"
+// GNU-DAG: define dso_local dllexport void @_Z17precedenceRedecl1v()
 void __declspec(dllimport) precedenceRedecl1();
 void __declspec(dllexport) precedenceRedecl1() {}
 
-// MSC-DAG: define dllexport void @"\01?precedenceRedecl2@@YAXXZ"
-// GNU-DAG: define dllexport void @_Z17precedenceRedecl2v()
+// MSC-DAG: define dso_local dllexport void @"\01?precedenceRedecl2@@YAXXZ"
+// GNU-DAG: define dso_local dllexport void @_Z17precedenceRedecl2v()
 void __declspec(dllexport) precedenceRedecl2();
 void __declspec(dllimport) precedenceRedecl2() {}
 
@@ -474,11 +474,11 @@ void __declspec(dllimport) precedenceRed
 
 struct S {
   void __declspec(dllexport) a() {}
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?a at S@@QAEXXZ"
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?a at S@@QAEXXZ"
 
   struct T {
     void __declspec(dllexport) a() {}
-    // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?a at T@S@@QAEXXZ"
+    // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?a at T@S@@QAEXXZ"
   };
 };
 
@@ -487,8 +487,8 @@ struct SomeTemplate {
   SomeTemplate(T o = T()) : o(o) {}
   T o;
 };
-// MSVC2015-DAG: define weak_odr dllexport {{.+}} @"\01??4?$SomeTemplate at H@@Q{{.+}}@$$Q{{.+}}@@Z"
-// MSVC2013-DAG: define weak_odr dllexport {{.+}} @"\01??4?$SomeTemplate at H@@Q{{.+}}0 at A{{.+}}0@@Z"
+// MSVC2015-DAG: define weak_odr dso_local dllexport {{.+}} @"\01??4?$SomeTemplate at H@@Q{{.+}}@$$Q{{.+}}@@Z"
+// MSVC2013-DAG: define weak_odr dso_local dllexport {{.+}} @"\01??4?$SomeTemplate at H@@Q{{.+}}0 at A{{.+}}0@@Z"
 struct __declspec(dllexport) InheritFromTemplate : SomeTemplate<int> {};
 
 // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??_F?$SomeTemplate at H@@QAEXXZ"({{.*}}) {{#[0-9]+}} comdat
@@ -512,28 +512,28 @@ struct __declspec(dllexport) B {
 
 struct __declspec(dllexport) T {
   // Copy assignment operator:
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"\01??4T@@QAEAAU0 at ABU0@@Z"
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"\01??4T@@QAEAAU0 at ABU0@@Z"
 
   // Explicitly defaulted copy constructur:
   T(const T&) = default;
-  // M32MSVC2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.T* @"\01??0T@@QAE at ABU0@@Z"
+  // M32MSVC2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.T* @"\01??0T@@QAE at ABU0@@Z"
 
   void a() {}
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?a at T@@QAEXXZ"
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?a at T@@QAEXXZ"
 
   static int b;
-  // M32-DAG: @"\01?b at T@@2HA" = external global i32
+  // M32-DAG: @"\01?b at T@@2HA" = external dso_local global i32
 
   static int c;
-  // M32-DAG: @"\01?c at T@@2HA" = dllexport global i32 0, align 4
+  // M32-DAG: @"\01?c at T@@2HA" = dso_local dllexport global i32 0, align 4
 };
 
 USEVAR(T::b)
 int T::c;
 
 // Export template class with static member variable
-// MSC-DAG: @"\01?StaticClassVarExpTmplClass@?$TmplClass at H@@2HA" = weak_odr dllexport global i32 0, comdat, align 4
-// GNU-DAG: @_ZN9TmplClassIiE26StaticClassVarExpTmplClassE = weak_odr dllexport global i32 0, comdat, align 4
+// MSC-DAG: @"\01?StaticClassVarExpTmplClass@?$TmplClass at H@@2HA" = weak_odr dso_local dllexport global i32 0, comdat, align 4
+// GNU-DAG: @_ZN9TmplClassIiE26StaticClassVarExpTmplClassE = weak_odr dso_local dllexport global i32 0, comdat, align 4
 template<typename T>
 struct __declspec(dllexport) TmplClass
 {
@@ -544,8 +544,8 @@ template<typename T>
 T TmplClass<T>::StaticClassVarExpTmplClass;
 
 // Export a definition of a template function.
-// MSC-DAG: define weak_odr dllexport i32 @"\01??$TypeFunTmpl at H@@YAHH at Z"
-// GNU-DAG: define weak_odr dllexport i32 @_Z11TypeFunTmplIiET_S0_
+// MSC-DAG: define weak_odr dso_local dllexport i32 @"\01??$TypeFunTmpl at H@@YAHH at Z"
+// GNU-DAG: define weak_odr dso_local dllexport i32 @_Z11TypeFunTmplIiET_S0_
 template<typename T>
 T __declspec(dllexport) TypeFunTmpl(T t) { return t + t; }
 
@@ -558,18 +558,18 @@ int useExportedTmplStaticAndFun()
 template <typename T> struct __declspec(dllexport) U { void foo() {} };
 struct __declspec(dllexport) V : public U<int> { };
 // U<int>'s assignment operator is emitted.
-// M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.U* @"\01??4?$U at H@@QAEAAU0 at ABU0@@Z"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.U* @"\01??4?$U at H@@QAEAAU0 at ABU0@@Z"
 
 struct __declspec(dllexport) W { virtual void foo(); };
 void W::foo() {}
 // Default ctor:
-// M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.W* @"\01??0W@@QAE at XZ"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.W* @"\01??0W@@QAE at XZ"
 // Copy ctor:
-// M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.W* @"\01??0W@@QAE at ABU0@@Z"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.W* @"\01??0W@@QAE at ABU0@@Z"
 // vftable:
 // M32-DAG: [[W_VTABLE:@.*]] = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"\01??_R4W@@6B@" to i8*), i8* bitcast (void (%struct.W*)* @"\01?foo at W@@UAEXXZ" to i8*)] }, comdat($"\01??_7W@@6B@")
 // M32-DAG: @"\01??_7W@@6B@" = dllexport unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[W_VTABLE]], i32 0, i32 0, i32 1)
-// G32-DAG: @_ZTV1W = dllexport unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI1W to i8*), i8* bitcast (void (%struct.W*)* @_ZN1W3fooEv to i8*)] }
+// G32-DAG: @_ZTV1W = dso_local dllexport unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI1W to i8*), i8* bitcast (void (%struct.W*)* @_ZN1W3fooEv to i8*)] }
 
 struct __declspec(dllexport) X : public virtual W {};
 // vbtable:
@@ -577,19 +577,19 @@ struct __declspec(dllexport) X : public
 
 struct __declspec(dllexport) Y {
   // Move assignment operator:
-  // MSVC2015-DAG: define weak_odr dllexport {{.+}} @"\01??4Y@@Q{{.+}}@$$Q{{.+}}@@Z"
-  // MSVC2013-DAG: define weak_odr dllexport {{.+}} @"\01??4Y@@Q{{.+}}0 at A{{.+}}0@@Z"
+  // MSVC2015-DAG: define weak_odr dso_local dllexport {{.+}} @"\01??4Y@@Q{{.+}}@$$Q{{.+}}@@Z"
+  // MSVC2013-DAG: define weak_odr dso_local dllexport {{.+}} @"\01??4Y@@Q{{.+}}0 at A{{.+}}0@@Z"
 
   int x;
 };
 
 struct __declspec(dllexport) Z { virtual ~Z() {} };
 // The scalar deleting dtor does not get exported:
-// M32-DAG: define linkonce_odr x86_thiscallcc i8* @"\01??_GZ@@UAEPAXI at Z"
+// M32-DAG: define linkonce_odr dso_local x86_thiscallcc i8* @"\01??_GZ@@UAEPAXI at Z"
 
 
 // The user-defined dtor does get exported:
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??1Z@@UAE at XZ"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??1Z@@UAE at XZ"
 
 namespace UseDtorAlias {
   struct __declspec(dllexport) A { ~A(); };
@@ -597,39 +597,39 @@ namespace UseDtorAlias {
   A::~A() { }
   B::~B() { }
   // Emit a alias definition of B's constructor.
-  // M32-DAG: @"\01??1B at UseDtorAlias@@QAE at XZ" = dllexport alias {{.*}} @"\01??1A at UseDtorAlias@@QAE at XZ"
+  // M32-DAG: @"\01??1B at UseDtorAlias@@QAE at XZ" = dso_local dllexport alias {{.*}} @"\01??1A at UseDtorAlias@@QAE at XZ"
 }
 
 struct __declspec(dllexport) DefaultedCtorsDtors {
   DefaultedCtorsDtors() = default;
-  // M32MSVC2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.DefaultedCtorsDtors* @"\01??0DefaultedCtorsDtors@@QAE at XZ"
+  // M32MSVC2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.DefaultedCtorsDtors* @"\01??0DefaultedCtorsDtors@@QAE at XZ"
   ~DefaultedCtorsDtors() = default;
-  // M32MSVC2013-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??1DefaultedCtorsDtors@@QAE at XZ"
+  // M32MSVC2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??1DefaultedCtorsDtors@@QAE at XZ"
 };
 
 // Export defaulted member function definitions declared inside class.
 struct __declspec(dllexport) ExportDefaultedInclassDefs {
   ExportDefaultedInclassDefs() = default;
-  // M32VS2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
-  // M64VS2013-DAG: define weak_odr dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
-  // M32VS2015-NOT: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
-  // M64VS2015-NOT: define weak_odr dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
+  // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
+  // M64VS2013-DAG: define weak_odr dso_local dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
+  // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
+  // M64VS2015-NOT: define weak_odr dso_local dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
 
   ~ExportDefaultedInclassDefs() = default;
-  // M32VS2013-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??1ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* %this)
-  // M64VS2013-DAG: define weak_odr dllexport                void @"\01??1ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* %this)
-  // M32VS2015-NOT: define weak_odr dllexport x86_thiscallcc void @"\01??1ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* %this)
-  // M64VS2015-NOT: define weak_odr dllexport                void @"\01??1ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* %this)
+  // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??1ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* %this)
+  // M64VS2013-DAG: define weak_odr dso_local dllexport                void @"\01??1ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* %this)
+  // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc void @"\01??1ExportDefaultedInclassDefs@@QAE at XZ"(%struct.ExportDefaultedInclassDefs* %this)
+  // M64VS2015-NOT: define weak_odr dso_local dllexport                void @"\01??1ExportDefaultedInclassDefs@@QEAA at XZ"(%struct.ExportDefaultedInclassDefs* %this)
 
   ExportDefaultedInclassDefs(const ExportDefaultedInclassDefs&) = default;
-  // M32VS2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
-  // M64VS2013-DAG: define weak_odr dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
-  // M32VS2015-NOT: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
-  // M64VS2015-NOT: define weak_odr dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+  // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+  // M64VS2013-DAG: define weak_odr dso_local dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+  // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE at ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+  // M64VS2015-NOT: define weak_odr dso_local dllexport                %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA at AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
 
   ExportDefaultedInclassDefs& operator=(const ExportDefaultedInclassDefs&) = default;
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"\01??4ExportDefaultedInclassDefs@@QAEAAU0 at ABU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
-  // M64-DAG: define weak_odr dllexport                dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"\01??4ExportDefaultedInclassDefs@@QEAAAEAU0 at AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"\01??4ExportDefaultedInclassDefs@@QAEAAU0 at ABU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+  // M64-DAG: define weak_odr dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"\01??4ExportDefaultedInclassDefs@@QEAAAEAU0 at AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
 };
 
 namespace ReferencedInlineMethodInNestedClass {
@@ -642,8 +642,8 @@ namespace ReferencedInlineMethodInNested
     };
     T *t;
   };
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?foo at S@ReferencedInlineMethodInNestedClass@@QAEXXZ"
-  // M32-DAG: define linkonce_odr x86_thiscallcc void @"\01?bar at T@S at ReferencedInlineMethodInNestedClass@@QAEXXZ"
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?foo at S@ReferencedInlineMethodInNestedClass@@QAEXXZ"
+  // M32-DAG: define linkonce_odr dso_local x86_thiscallcc void @"\01?bar at T@S at ReferencedInlineMethodInNestedClass@@QAEXXZ"
 }
 
 // MS ignores DLL attributes on partial specializations.
@@ -651,37 +651,37 @@ template <typename T> struct PartiallySp
 template <typename T> struct __declspec(dllexport) PartiallySpecializedClassTemplate<T*> { void f(); };
 template <typename T> void PartiallySpecializedClassTemplate<T*>::f() {}
 USEMEMFUNC(PartiallySpecializedClassTemplate<void*>, f);
-// M32-DAG: define linkonce_odr x86_thiscallcc void @"\01?f@?$PartiallySpecializedClassTemplate at PAX@@QAEXXZ"
-// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN33PartiallySpecializedClassTemplateIPvE1fEv
+// M32-DAG: define linkonce_odr dso_local x86_thiscallcc void @"\01?f@?$PartiallySpecializedClassTemplate at PAX@@QAEXXZ"
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN33PartiallySpecializedClassTemplateIPvE1fEv
 
 // Attributes on explicit specializations are honored.
 template <typename T> struct ExplicitlySpecializedClassTemplate {};
 template <> struct __declspec(dllexport) ExplicitlySpecializedClassTemplate<void*> { void f(); };
 void ExplicitlySpecializedClassTemplate<void*>::f() {}
 USEMEMFUNC(ExplicitlySpecializedClassTemplate<void*>, f);
-// M32-DAG: define dllexport x86_thiscallcc void @"\01?f@?$ExplicitlySpecializedClassTemplate at PAX@@QAEXXZ"
-// G32-DAG: define dllexport x86_thiscallcc void @_ZN34ExplicitlySpecializedClassTemplateIPvE1fEv
+// M32-DAG: define dso_local dllexport x86_thiscallcc void @"\01?f@?$ExplicitlySpecializedClassTemplate at PAX@@QAEXXZ"
+// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN34ExplicitlySpecializedClassTemplateIPvE1fEv
 
 // MS inherits DLL attributes to partial specializations.
 template <typename T> struct __declspec(dllexport) PartiallySpecializedExportedClassTemplate {};
 template <typename T> struct PartiallySpecializedExportedClassTemplate<T*> { void f() {} };
 USEMEMFUNC(PartiallySpecializedExportedClassTemplate<void*>, f);
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$PartiallySpecializedExportedClassTemplate at PAX@@QAEXXZ"
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN41PartiallySpecializedExportedClassTemplateIPvE1fEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?f@?$PartiallySpecializedExportedClassTemplate at PAX@@QAEXXZ"
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN41PartiallySpecializedExportedClassTemplateIPvE1fEv
 
 // MS ignores DLL attributes on partial specializations; inheritance still works though.
 template <typename T> struct __declspec(dllexport) PartiallySpecializedExportedClassTemplate2 {};
 template <typename T> struct __declspec(dllimport) PartiallySpecializedExportedClassTemplate2<T*> { void f(); };
 template <typename T> void PartiallySpecializedExportedClassTemplate2<T*>::f() {}
 USEMEMFUNC(PartiallySpecializedExportedClassTemplate2<void*>, f);
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$PartiallySpecializedExportedClassTemplate2 at PAX@@QAEXXZ"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?f@?$PartiallySpecializedExportedClassTemplate2 at PAX@@QAEXXZ"
 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN42PartiallySpecializedExportedClassTemplate2IPvE1fEv
 
 // Attributes on the instantiation take precedence over attributes on the template.
 template <typename T> struct __declspec(dllimport) ExplicitlyInstantiatedWithDifferentAttr { void f() {} };
 template struct __declspec(dllexport) ExplicitlyInstantiatedWithDifferentAttr<int>;
 USEMEMFUNC(ExplicitlyInstantiatedWithDifferentAttr<int>, f);
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ExplicitlyInstantiatedWithDifferentAttr at H@@QAEXXZ"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?f@?$ExplicitlyInstantiatedWithDifferentAttr at H@@QAEXXZ"
 
 // Don't create weak dllexport aliases. (PR21373)
 struct NonExportedBaseClass {
@@ -690,62 +690,62 @@ struct NonExportedBaseClass {
 NonExportedBaseClass::~NonExportedBaseClass() {}
 
 struct __declspec(dllexport) ExportedDerivedClass : NonExportedBaseClass {};
-// M32-DAG: weak_odr dllexport x86_thiscallcc void @"\01??1ExportedDerivedClass@@UAE at XZ"
+// M32-DAG: weak_odr dso_local dllexport x86_thiscallcc void @"\01??1ExportedDerivedClass@@UAE at XZ"
 
 // Do not assert about generating code for constexpr functions twice during explicit instantiation (PR21718).
 template <typename T> struct ExplicitInstConstexprMembers {
   // Copy assignment operator
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable(1) %struct.ExplicitInstConstexprMembers* @"\01??4?$ExplicitInstConstexprMembers at X@@QAEAAU0 at ABU0@@Z"
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable(1) %struct.ExplicitInstConstexprMembers* @"\01??4?$ExplicitInstConstexprMembers at X@@QAEAAU0 at ABU0@@Z"
 
   constexpr ExplicitInstConstexprMembers() {}
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExplicitInstConstexprMembers* @"\01??0?$ExplicitInstConstexprMembers at X@@QAE at XZ"
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExplicitInstConstexprMembers* @"\01??0?$ExplicitInstConstexprMembers at X@@QAE at XZ"
 
   ExplicitInstConstexprMembers(const ExplicitInstConstexprMembers&) = default;
-  // M32MSVC2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExplicitInstConstexprMembers* @"\01??0?$ExplicitInstConstexprMembers at X@@QAE at ABU0@@Z"
+  // M32MSVC2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExplicitInstConstexprMembers* @"\01??0?$ExplicitInstConstexprMembers at X@@QAE at ABU0@@Z"
 
   constexpr int f() const { return 42; }
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc i32 @"\01?f@?$ExplicitInstConstexprMembers at X@@QBEHXZ"
+  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc i32 @"\01?f@?$ExplicitInstConstexprMembers at X@@QBEHXZ"
 };
 template struct __declspec(dllexport) ExplicitInstConstexprMembers<void>;
 
 template <typename T> struct ExplicitInstantiationDeclTemplate { void f() {} };
 extern template struct __declspec(dllexport) ExplicitInstantiationDeclTemplate<int>;
 USEMEMFUNC(ExplicitInstantiationDeclTemplate<int>, f);
-// M32-DAG: {{declare|define available_externally}} x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclTemplate at H@@QAEXXZ"
+// M32-DAG: {{declare|define available_externally}} dso_local x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclTemplate at H@@QAEXXZ"
 
 template <typename T> struct __declspec(dllexport) ExplicitInstantiationDeclExportedTemplate { void f() {} };
 extern template struct ExplicitInstantiationDeclExportedTemplate<int>;
 USEMEMFUNC(ExplicitInstantiationDeclExportedTemplate<int>, f);
-// M32-DAG: {{declare|define available_externally}} x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclExportedTemplate at H@@QAEXXZ"
+// M32-DAG: {{declare|define available_externally}} dso_local x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclExportedTemplate at H@@QAEXXZ"
 
 template <typename T> struct ExplicitInstantiationDeclExportedDefTemplate { void f() {} ExplicitInstantiationDeclExportedDefTemplate() {} };
 extern template struct ExplicitInstantiationDeclExportedDefTemplate<int>;
 template struct __declspec(dllexport) ExplicitInstantiationDeclExportedDefTemplate<int>;
 USEMEMFUNC(ExplicitInstantiationDeclExportedDefTemplate<int>, f);
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclExportedDefTemplate at H@@QAEXXZ"
-// M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExplicitInstantiationDeclExportedDefTemplate* @"\01??0?$ExplicitInstantiationDeclExportedDefTemplate at H@@QAE at XZ"
-// G32-DAG: define weak_odr x86_thiscallcc void @_ZN44ExplicitInstantiationDeclExportedDefTemplateIiE1fEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclExportedDefTemplate at H@@QAEXXZ"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExplicitInstantiationDeclExportedDefTemplate* @"\01??0?$ExplicitInstantiationDeclExportedDefTemplate at H@@QAE at XZ"
+// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN44ExplicitInstantiationDeclExportedDefTemplateIiE1fEv
 
 template <typename T> struct ImplicitInstantiationExportedExplicitInstantiationDefTemplate { virtual void f() {} };
 ImplicitInstantiationExportedExplicitInstantiationDefTemplate<int> ImplicitInstantiationExportedExplicitInstantiationDefTemplateInstance;
 template struct __declspec(dllexport) ImplicitInstantiationExportedExplicitInstantiationDefTemplate<int>;
 USEMEMFUNC(ImplicitInstantiationExportedExplicitInstantiationDefTemplate<int>, f);
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ImplicitInstantiationExportedExplicitInstantiationDefTemplate at H@@UAEXXZ"
-// G32-DAG: define weak_odr x86_thiscallcc void @_ZN61ImplicitInstantiationExportedExplicitInstantiationDefTemplateIiE1fEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?f@?$ImplicitInstantiationExportedExplicitInstantiationDefTemplate at H@@UAEXXZ"
+// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN61ImplicitInstantiationExportedExplicitInstantiationDefTemplateIiE1fEv
 
 template <typename T> struct __declspec(dllexport) ImplicitInstantiationExplicitInstantiationDefExportedTemplate { virtual void f() {} };
 ImplicitInstantiationExplicitInstantiationDefExportedTemplate<int> ImplicitInstantiationExplicitInstantiationDefExportedTemplateInstance;
 template struct ImplicitInstantiationExplicitInstantiationDefExportedTemplate<int>;
 USEMEMFUNC(ImplicitInstantiationExplicitInstantiationDefExportedTemplate<int>, f);
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ImplicitInstantiationExplicitInstantiationDefExportedTemplate at H@@UAEXXZ"
-// G32-DAG: define weak_odr x86_thiscallcc void @_ZN61ImplicitInstantiationExplicitInstantiationDefExportedTemplateIiE1fEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?f@?$ImplicitInstantiationExplicitInstantiationDefExportedTemplate at H@@UAEXXZ"
+// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN61ImplicitInstantiationExplicitInstantiationDefExportedTemplateIiE1fEv
 
 template <typename T> struct __declspec(dllexport) ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplate { virtual void f() {} };
 ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplate<int> ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplateInstance;
 template struct __declspec(dllexport) ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplate<int>;
 USEMEMFUNC(ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplate<int>, f);
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplate at H@@UAEXXZ"
-// G32-DAG: define weak_odr x86_thiscallcc void @_ZN69ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplateIiE1fEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?f@?$ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplate at H@@UAEXXZ"
+// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN69ImplicitInstantiationExportedExplicitInstantiationDefExportedTemplateIiE1fEv
 
 namespace { struct InternalLinkageType {}; }
 struct __declspec(dllexport) PR23308 {
@@ -759,14 +759,14 @@ template <typename T> struct PR23770Base
 template <typename T> struct PR23770DerivedTemplate : PR23770BaseTemplate<int> {};
 extern template struct PR23770DerivedTemplate<int>;
 template struct __declspec(dllexport) PR23770DerivedTemplate<int>;
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$PR23770BaseTemplate at H@@QAEXXZ"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?f@?$PR23770BaseTemplate at H@@QAEXXZ"
 
 namespace InClassInits {
 
 struct __declspec(dllexport) S {
   int x = 42;
 };
-// M32-DAG: define weak_odr dllexport x86_thiscallcc %"struct.InClassInits::S"* @"\01??0S at InClassInits@@QAE at XZ"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %"struct.InClassInits::S"* @"\01??0S at InClassInits@@QAE at XZ"
 
 // dllexport an already instantiated class template.
 template <typename T> struct Base {
@@ -774,7 +774,7 @@ template <typename T> struct Base {
 };
 Base<int> base;
 struct __declspec(dllexport) T : Base<int> { };
-// M32-DAG: define weak_odr dllexport x86_thiscallcc %"struct.InClassInits::Base"* @"\01??0?$Base at H@InClassInits@@QAE at XZ"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %"struct.InClassInits::Base"* @"\01??0?$Base at H@InClassInits@@QAE at XZ"
 
 struct A { A(int); };
 struct __declspec(dllexport) U {
@@ -782,7 +782,7 @@ struct __declspec(dllexport) U {
   U(A = 0) {}
   int x = 0;
 };
-// M32-DAG: define weak_odr dllexport x86_thiscallcc %"struct.InClassInits::U"* @"\01??0U at InClassInits@@QAE at UA@1@@Z"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %"struct.InClassInits::U"* @"\01??0U at InClassInits@@QAE at UA@1@@Z"
 
 struct Evil {
   template <typename T> struct Base {
@@ -794,7 +794,7 @@ struct Evil {
   // the default ctor must still be delayed.
   struct __declspec(dllexport) T : Base<int> {};
 };
-// M32-DAG: define weak_odr dllexport x86_thiscallcc %"struct.InClassInits::Evil::Base"* @"\01??0?$Base at H@Evil at InClassInits@@QAE at XZ"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %"struct.InClassInits::Evil::Base"* @"\01??0?$Base at H@Evil at InClassInits@@QAE at XZ"
 
 template <typename T> struct Foo {};
 template <typename T> struct Bar {
@@ -806,7 +806,7 @@ struct __declspec(dllexport) Baz {
 // After parsing Baz, in ActOnFinishCXXNonNestedClass we would synthesize
 // Baz's operator=, causing instantiation of Foo<int> after which
 // ActOnFinishCXXNonNestedClass is called, and we would bite our own tail.
-// M32-DAG: define weak_odr dllexport x86_thiscallcc dereferenceable(1) %"struct.InClassInits::Baz"* @"\01??4Baz at InClassInits@@QAEAAU01 at ABU01@@Z"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable(1) %"struct.InClassInits::Baz"* @"\01??4Baz at InClassInits@@QAEAAU01 at ABU01@@Z"
 }
 
 // We had an issue where instantiating A would force emission of B's delayed
@@ -823,22 +823,22 @@ struct __declspec(dllexport) B {
 // dllexport trumps dllimport on an explicit instantiation.
 template <typename T> struct ExplicitInstantiationTwoAttributes { void f() {} };
 template struct __declspec(dllexport) __declspec(dllimport) ExplicitInstantiationTwoAttributes<int>;
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ExplicitInstantiationTwoAttributes at H@@QAEXXZ"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?f@?$ExplicitInstantiationTwoAttributes at H@@QAEXXZ"
 
 namespace pr34849 {
 // Specializations of exported class template member functions get exported.
 template <typename> struct __declspec(dllexport) ExportedClassTemplate { void foo(); };
 template<> void ExportedClassTemplate<int>::foo() {}
 template struct ExportedClassTemplate<int>;
-// M32-DAG: define dllexport x86_thiscallcc void @"\01?foo@?$ExportedClassTemplate at H@pr34849@@QAEXXZ"
+// M32-DAG: define dso_local dllexport x86_thiscallcc void @"\01?foo@?$ExportedClassTemplate at H@pr34849@@QAEXXZ"
 
 // Specializations of exported class member template functions do not get exported.
 struct __declspec(dllexport) ExportedClass { template <typename> void bar() ; };
 template<> void ExportedClass::bar<int>() {}
-// M32-DAG: define x86_thiscallcc void @"\01??$bar at H@ExportedClass at pr34849@@QAEXXZ"
+// M32-DAG: define dso_local x86_thiscallcc void @"\01??$bar at H@ExportedClass at pr34849@@QAEXXZ"
 template <typename> struct __declspec(dllexport) ExportedClassTemplate2 { template <typename> void baz(); };
 template<> template<> void ExportedClassTemplate2<int>::baz<int>() {}
-// M32-DAG: define x86_thiscallcc void @"\01??$baz at H@?$ExportedClassTemplate2 at H@pr34849@@QAEXXZ"
+// M32-DAG: define dso_local x86_thiscallcc void @"\01??$baz at H@?$ExportedClassTemplate2 at H@pr34849@@QAEXXZ"
 }
 
 //===----------------------------------------------------------------------===//
@@ -874,14 +874,14 @@ template struct __declspec(dllimport) Ex
 // MS: ClassTemplate<int> gets exported.
 struct __declspec(dllexport) DerivedFromTemplate : public ClassTemplate<int> {};
 USEMEMFUNC(DerivedFromTemplate, func)
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ClassTemplate at H@@QAEXXZ"
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ClassTemplateIiE4funcEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?func@?$ClassTemplate at H@@QAEXXZ"
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ClassTemplateIiE4funcEv
 
 // ExportedTemplate is explicitly exported.
 struct __declspec(dllexport) DerivedFromExportedTemplate : public ExportedClassTemplate<int> {};
 USEMEMFUNC(DerivedFromExportedTemplate, func)
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ExportedClassTemplate at H@@QAEXXZ"
-// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN21ExportedClassTemplateIiE4funcEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?func@?$ExportedClassTemplate at H@@QAEXXZ"
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN21ExportedClassTemplateIiE4funcEv
 
 // ImportedClassTemplate is explicitly imported.
 struct __declspec(dllexport) DerivedFromImportedTemplate : public ImportedClassTemplate<int> {};
@@ -893,27 +893,27 @@ USEMEMFUNC(DerivedFromImportedTemplate,
 struct DerivedFromTemplateD : public ClassTemplate<double> {};
 struct __declspec(dllexport) DerivedFromTemplateD2 : public ClassTemplate<double> {};
 USEMEMFUNC(DerivedFromTemplateD2, func)
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ClassTemplate at N@@QAEXXZ"
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ClassTemplateIdE4funcEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?func@?$ClassTemplate at N@@QAEXXZ"
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ClassTemplateIdE4funcEv
 
 // MS: Base class already instantiated with different dll attribute.
 struct __declspec(dllimport) DerivedFromTemplateB : public ClassTemplate<bool> {};
 struct __declspec(dllexport) DerivedFromTemplateB2 : public ClassTemplate<bool> {};
 USEMEMFUNC(DerivedFromTemplateB2, func)
 // M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?func@?$ClassTemplate at _N@@QAEXXZ"
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ClassTemplateIbE4funcEv
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ClassTemplateIbE4funcEv
 
 // Base class already specialized without dll attribute.
 struct __declspec(dllexport) DerivedFromExplicitlySpecializedTemplate : public ExplicitlySpecializedTemplate<int> {};
 USEMEMFUNC(DerivedFromExplicitlySpecializedTemplate, func)
-// M32-DAG: define x86_thiscallcc void @"\01?func@?$ExplicitlySpecializedTemplate at H@@QAEXXZ"
-// G32-DAG: define x86_thiscallcc void @_ZN29ExplicitlySpecializedTemplateIiE4funcEv
+// M32-DAG: define dso_local x86_thiscallcc void @"\01?func@?$ExplicitlySpecializedTemplate at H@@QAEXXZ"
+// G32-DAG: define dso_local x86_thiscallcc void @_ZN29ExplicitlySpecializedTemplateIiE4funcEv
 
 // Base class alredy specialized with export attribute.
 struct __declspec(dllexport) DerivedFromExplicitlyExportSpecializedTemplate : public ExplicitlyExportSpecializedTemplate<int> {};
 USEMEMFUNC(DerivedFromExplicitlyExportSpecializedTemplate, func)
-// M32-DAG: define dllexport x86_thiscallcc void @"\01?func@?$ExplicitlyExportSpecializedTemplate at H@@QAEXXZ"
-// G32-DAG: define dllexport x86_thiscallcc void @_ZN35ExplicitlyExportSpecializedTemplateIiE4funcEv
+// M32-DAG: define dso_local dllexport x86_thiscallcc void @"\01?func@?$ExplicitlyExportSpecializedTemplate at H@@QAEXXZ"
+// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN35ExplicitlyExportSpecializedTemplateIiE4funcEv
 
 // Base class already specialized with import attribute.
 struct __declspec(dllexport) DerivedFromExplicitlyImportSpecializedTemplate : public ExplicitlyImportSpecializedTemplate<int> {};
@@ -924,14 +924,14 @@ USEMEMFUNC(DerivedFromExplicitlyImportSp
 // Base class already instantiated without dll attribute.
 struct __declspec(dllexport) DerivedFromExplicitlyInstantiatedTemplate : public ExplicitlyInstantiatedTemplate<int> {};
 USEMEMFUNC(DerivedFromExplicitlyInstantiatedTemplate, func)
-// M32-DAG: define weak_odr x86_thiscallcc void @"\01?func@?$ExplicitlyInstantiatedTemplate at H@@QAEXXZ"
-// G32-DAG: define weak_odr x86_thiscallcc void @_ZN30ExplicitlyInstantiatedTemplateIiE4funcEv
+// M32-DAG: define weak_odr dso_local x86_thiscallcc void @"\01?func@?$ExplicitlyInstantiatedTemplate at H@@QAEXXZ"
+// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN30ExplicitlyInstantiatedTemplateIiE4funcEv
 
 // Base class already instantiated with export attribute.
 struct __declspec(dllexport) DerivedFromExplicitlyExportInstantiatedTemplate : public ExplicitlyExportInstantiatedTemplate<int> {};
 USEMEMFUNC(DerivedFromExplicitlyExportInstantiatedTemplate, func)
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ExplicitlyExportInstantiatedTemplate at H@@QAEXXZ"
-// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN36ExplicitlyExportInstantiatedTemplateIiE4funcEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?func@?$ExplicitlyExportInstantiatedTemplate at H@@QAEXXZ"
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN36ExplicitlyExportInstantiatedTemplateIiE4funcEv
 
 // Base class already instantiated with import attribute.
 struct __declspec(dllexport) DerivedFromExplicitlyImportInstantiatedTemplate : public ExplicitlyImportInstantiatedTemplate<int> {};
@@ -944,15 +944,15 @@ template <typename T> struct TopClass {
 template <typename T> struct MiddleClass : public TopClass<T> { };
 struct __declspec(dllexport) BottomClass : public MiddleClass<int> { };
 USEMEMFUNC(BottomClass, func)
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$TopClass at H@@QAEXXZ"
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN8TopClassIiE4funcEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?func@?$TopClass at H@@QAEXXZ"
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN8TopClassIiE4funcEv
 
 template <typename T> struct ExplicitInstantiationDeclTemplateBase { void func() {} };
 extern template struct ExplicitInstantiationDeclTemplateBase<int>;
 struct __declspec(dllexport) DerivedFromExplicitInstantiationDeclTemplateBase : public ExplicitInstantiationDeclTemplateBase<int> {};
 template struct ExplicitInstantiationDeclTemplateBase<int>;
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ExplicitInstantiationDeclTemplateBase at H@@QAEXXZ"
-// G32-DAG: define weak_odr x86_thiscallcc void @_ZN37ExplicitInstantiationDeclTemplateBaseIiE4funcEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?func@?$ExplicitInstantiationDeclTemplateBase at H@@QAEXXZ"
+// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN37ExplicitInstantiationDeclTemplateBaseIiE4funcEv
 
 // PR26076
 struct LayerSelectionBound;
@@ -965,8 +965,8 @@ struct __declspec(dllexport) LayerTreeIm
   };
   LayerSelection foo;
 };
-// M32-DAG: define weak_odr dllexport x86_thiscallcc %"struct.LayerTreeImpl::ElementLayers"* @"\01??0ElementLayers at LayerTreeImpl@@QAE at XZ"
-// M64-DAG: define weak_odr dllexport %"struct.LayerTreeImpl::ElementLayers"* @"\01??0ElementLayers at LayerTreeImpl@@QEAA at XZ"
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %"struct.LayerTreeImpl::ElementLayers"* @"\01??0ElementLayers at LayerTreeImpl@@QAE at XZ"
+// M64-DAG: define weak_odr dso_local dllexport %"struct.LayerTreeImpl::ElementLayers"* @"\01??0ElementLayers at LayerTreeImpl@@QEAA at XZ"
 
 class __declspec(dllexport) ACE_Shared_Object {
 public:
@@ -974,6 +974,6 @@ public:
 };
 class __declspec(dllexport) ACE_Service_Object : public ACE_Shared_Object {};
 // Implicit move constructor declaration.
-// MSVC2015-DAG: define weak_odr dllexport {{.+}}ACE_Service_Object@@Q{{.+}}@$$Q
+// MSVC2015-DAG: define weak_odr dso_local dllexport {{.+}}ACE_Service_Object@@Q{{.+}}@$$Q
 // The declarations should not be exported.
-// MSVC2013-NOT: define weak_odr dllexport {{.+}}ACE_Service_Object@@Q{{.+}}@$$Q
+// MSVC2013-NOT: define weak_odr dso_local dllexport {{.+}}ACE_Service_Object@@Q{{.+}}@$$Q

Modified: cfe/trunk/test/CodeGenCXX/dllimport-dtor-thunks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllimport-dtor-thunks.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllimport-dtor-thunks.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllimport-dtor-thunks.cpp Fri Feb 23 11:30:48 2018
@@ -39,11 +39,11 @@ extern "C" void testit() {
 
 // The destructors are called in reverse order of construction. Only the third
 // needs the complete destructor (_D).
-// CHECK-LABEL: define void @testit()
+// CHECK-LABEL: define dso_local void @testit()
 // CHECK:  call void @"\01??_DImportVBaseOverrideVDtor@@QEAAXXZ"(%struct.ImportVBaseOverrideVDtor* %{{.*}})
 // CHECK:  call void @"\01??1ImportOverrideVDtor@@UEAA at XZ"(%struct.ImportOverrideVDtor* %{{.*}})
 // CHECK:  call void @"\01??1ImportIntroVDtor@@UEAA at XZ"(%struct.ImportIntroVDtor* %{{.*}})
 
-// CHECK-LABEL: define linkonce_odr void @"\01??_DImportVBaseOverrideVDtor@@QEAAXXZ"
+// CHECK-LABEL: define linkonce_odr dso_local void @"\01??_DImportVBaseOverrideVDtor@@QEAAXXZ"
 // CHECK-LABEL: declare dllimport void @"\01??1ImportOverrideVDtor@@UEAA at XZ"
 // CHECK-LABEL: declare dllimport void @"\01??1ImportIntroVDtor@@UEAA at XZ"

Modified: cfe/trunk/test/CodeGenCXX/dllimport-members.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllimport-members.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllimport-members.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllimport-members.cpp Fri Feb 23 11:30:48 2018
@@ -63,86 +63,86 @@ struct __declspec(dllimport) ForceNonTri
 struct ImportMembers {
   struct Nested;
 
-  // M32-DAG: define  dllexport   x86_thiscallcc void @"\01?normalDef at ImportMembers@@QAEXXZ"(%struct.ImportMembers* %this)
-  // M64-DAG: define  dllexport                  void @"\01?normalDef at ImportMembers@@QEAAXXZ"(%struct.ImportMembers* %this)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?normalDecl at ImportMembers@@QAEXXZ"(%struct.ImportMembers*)
-  // M64-DAG: declare dllimport                  void @"\01?normalDecl at ImportMembers@@QEAAXXZ"(%struct.ImportMembers*)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?normalInclass at ImportMembers@@QAEXXZ"(%struct.ImportMembers*)
-  // M64-DAG: declare dllimport                  void @"\01?normalInclass at ImportMembers@@QEAAXXZ"(%struct.ImportMembers*)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?normalInlineDef at ImportMembers@@QAEXXZ"(%struct.ImportMembers*)
-  // M64-DAG: declare dllimport                  void @"\01?normalInlineDef at ImportMembers@@QEAAXXZ"(%struct.ImportMembers*)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?normalInlineDecl at ImportMembers@@QAEXXZ"(%struct.ImportMembers*)
-  // M64-DAG: declare dllimport                  void @"\01?normalInlineDecl at ImportMembers@@QEAAXXZ"(%struct.ImportMembers*)
-  // G32-DAG: define              x86_thiscallcc void @_ZN13ImportMembers9normalDefEv(%struct.ImportMembers* %this)
-  // G64-DAG: define                             void @_ZN13ImportMembers9normalDefEv(%struct.ImportMembers* %this)
-  // G32-DAG: declare dllimport   x86_thiscallcc void @_ZN13ImportMembers10normalDeclEv(%struct.ImportMembers*)
-  // G64-DAG: declare dllimport                  void @_ZN13ImportMembers10normalDeclEv(%struct.ImportMembers*)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers13normalInclassEv(%struct.ImportMembers* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN13ImportMembers13normalInclassEv(%struct.ImportMembers* %this)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers15normalInlineDefEv(%struct.ImportMembers* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN13ImportMembers15normalInlineDefEv(%struct.ImportMembers* %this)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers16normalInlineDeclEv(%struct.ImportMembers* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN13ImportMembers16normalInlineDeclEv(%struct.ImportMembers* %this)
+  // M32-DAG: define  dso_local dllexport   x86_thiscallcc void @"\01?normalDef at ImportMembers@@QAEXXZ"(%struct.ImportMembers* %this)
+  // M64-DAG: define  dso_local dllexport                  void @"\01?normalDef at ImportMembers@@QEAAXXZ"(%struct.ImportMembers* %this)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?normalDecl at ImportMembers@@QAEXXZ"(%struct.ImportMembers*)
+  // M64-DAG: declare           dllimport                  void @"\01?normalDecl at ImportMembers@@QEAAXXZ"(%struct.ImportMembers*)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?normalInclass at ImportMembers@@QAEXXZ"(%struct.ImportMembers*)
+  // M64-DAG: declare           dllimport                  void @"\01?normalInclass at ImportMembers@@QEAAXXZ"(%struct.ImportMembers*)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?normalInlineDef at ImportMembers@@QAEXXZ"(%struct.ImportMembers*)
+  // M64-DAG: declare           dllimport                  void @"\01?normalInlineDef at ImportMembers@@QEAAXXZ"(%struct.ImportMembers*)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?normalInlineDecl at ImportMembers@@QAEXXZ"(%struct.ImportMembers*)
+  // M64-DAG: declare           dllimport                  void @"\01?normalInlineDecl at ImportMembers@@QEAAXXZ"(%struct.ImportMembers*)
+  // G32-DAG: define  dso_local             x86_thiscallcc void @_ZN13ImportMembers9normalDefEv(%struct.ImportMembers* %this)
+  // G64-DAG: define  dso_local                            void @_ZN13ImportMembers9normalDefEv(%struct.ImportMembers* %this)
+  // G32-DAG: declare           dllimport   x86_thiscallcc void @_ZN13ImportMembers10normalDeclEv(%struct.ImportMembers*)
+  // G64-DAG: declare           dllimport                  void @_ZN13ImportMembers10normalDeclEv(%struct.ImportMembers*)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers13normalInclassEv(%struct.ImportMembers* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN13ImportMembers13normalInclassEv(%struct.ImportMembers* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers15normalInlineDefEv(%struct.ImportMembers* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN13ImportMembers15normalInlineDefEv(%struct.ImportMembers* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers16normalInlineDeclEv(%struct.ImportMembers* %this)
+  // G64-DAG: define linkonce_odr dso_local                 void @_ZN13ImportMembers16normalInlineDeclEv(%struct.ImportMembers* %this)
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?normalInclass at ImportMembers@@QAEXXZ"(
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?normalInlineDef at ImportMembers@@QAEXXZ"(
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?normalInlineDecl at ImportMembers@@QAEXXZ"(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers13normalInclassEv(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers15normalInlineDefEv(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers16normalInlineDeclEv(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers13normalInclassEv(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers15normalInlineDefEv(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers16normalInlineDeclEv(
   __declspec(dllimport)                void normalDef(); // dllimport ignored
   __declspec(dllimport)                void normalDecl();
   __declspec(dllimport)                void normalInclass() {}
   __declspec(dllimport)                void normalInlineDef();
   __declspec(dllimport)         inline void normalInlineDecl();
 
-  // M32-DAG: define  dllexport   x86_thiscallcc void @"\01?virtualDef at ImportMembers@@UAEXXZ"(%struct.ImportMembers* %this)
-  // M64-DAG: define  dllexport                  void @"\01?virtualDef at ImportMembers@@UEAAXXZ"(%struct.ImportMembers* %this)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?virtualDecl at ImportMembers@@UAEXXZ"(%struct.ImportMembers*)
-  // M64-DAG: declare dllimport                  void @"\01?virtualDecl at ImportMembers@@UEAAXXZ"(%struct.ImportMembers*)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?virtualInclass at ImportMembers@@UAEXXZ"(%struct.ImportMembers*)
-  // M64-DAG: declare dllimport                  void @"\01?virtualInclass at ImportMembers@@UEAAXXZ"(%struct.ImportMembers*)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?virtualInlineDef at ImportMembers@@UAEXXZ"(%struct.ImportMembers*)
-  // M64-DAG: declare dllimport                  void @"\01?virtualInlineDef at ImportMembers@@UEAAXXZ"(%struct.ImportMembers*)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?virtualInlineDecl at ImportMembers@@UAEXXZ"(%struct.ImportMembers*)
-  // M64-DAG: declare dllimport                  void @"\01?virtualInlineDecl at ImportMembers@@UEAAXXZ"(%struct.ImportMembers*)
-  // G32-DAG: define              x86_thiscallcc void @_ZN13ImportMembers10virtualDefEv(%struct.ImportMembers* %this)
-  // G64-DAG: define                             void @_ZN13ImportMembers10virtualDefEv(%struct.ImportMembers* %this)
+  // M32-DAG: define  dso_local dllexport   x86_thiscallcc void @"\01?virtualDef at ImportMembers@@UAEXXZ"(%struct.ImportMembers* %this)
+  // M64-DAG: define  dso_local dllexport                  void @"\01?virtualDef at ImportMembers@@UEAAXXZ"(%struct.ImportMembers* %this)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?virtualDecl at ImportMembers@@UAEXXZ"(%struct.ImportMembers*)
+  // M64-DAG: declare           dllimport                  void @"\01?virtualDecl at ImportMembers@@UEAAXXZ"(%struct.ImportMembers*)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?virtualInclass at ImportMembers@@UAEXXZ"(%struct.ImportMembers*)
+  // M64-DAG: declare           dllimport                  void @"\01?virtualInclass at ImportMembers@@UEAAXXZ"(%struct.ImportMembers*)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?virtualInlineDef at ImportMembers@@UAEXXZ"(%struct.ImportMembers*)
+  // M64-DAG: declare           dllimport                  void @"\01?virtualInlineDef at ImportMembers@@UEAAXXZ"(%struct.ImportMembers*)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?virtualInlineDecl at ImportMembers@@UAEXXZ"(%struct.ImportMembers*)
+  // M64-DAG: declare           dllimport                  void @"\01?virtualInlineDecl at ImportMembers@@UEAAXXZ"(%struct.ImportMembers*)
+  // G32-DAG: define  dso_local             x86_thiscallcc void @_ZN13ImportMembers10virtualDefEv(%struct.ImportMembers* %this)
+  // G64-DAG: define  dso_local                            void @_ZN13ImportMembers10virtualDefEv(%struct.ImportMembers* %this)
   // G32-DAG: declare dllimport   x86_thiscallcc void @_ZN13ImportMembers11virtualDeclEv(%struct.ImportMembers*)
   // G64-DAG: declare dllimport                  void @_ZN13ImportMembers11virtualDeclEv(%struct.ImportMembers*)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers14virtualInclassEv(%struct.ImportMembers* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN13ImportMembers14virtualInclassEv(%struct.ImportMembers* %this)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers16virtualInlineDefEv(%struct.ImportMembers* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN13ImportMembers16virtualInlineDefEv(%struct.ImportMembers* %this)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers17virtualInlineDeclEv(%struct.ImportMembers* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN13ImportMembers17virtualInlineDeclEv(%struct.ImportMembers* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers14virtualInclassEv(%struct.ImportMembers* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN13ImportMembers14virtualInclassEv(%struct.ImportMembers* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers16virtualInlineDefEv(%struct.ImportMembers* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN13ImportMembers16virtualInlineDefEv(%struct.ImportMembers* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers17virtualInlineDeclEv(%struct.ImportMembers* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN13ImportMembers17virtualInlineDeclEv(%struct.ImportMembers* %this)
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?virtualInclass at ImportMembers@@UAEXXZ"(
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?virtualInlineDef at ImportMembers@@UAEXXZ"(
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?virtualInlineDecl at ImportMembers@@UAEXXZ"(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers14virtualInclassEv(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers16virtualInlineDefEv(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers17virtualInlineDeclEv(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers14virtualInclassEv(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers16virtualInlineDefEv(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers17virtualInlineDeclEv(
   __declspec(dllimport) virtual        void virtualDef(); // dllimport ignored
   __declspec(dllimport) virtual        void virtualDecl();
   __declspec(dllimport) virtual        void virtualInclass() {}
   __declspec(dllimport) virtual        void virtualInlineDef();
   __declspec(dllimport) virtual inline void virtualInlineDecl();
 
-  // MSC-DAG: define  dllexport                void @"\01?staticDef at ImportMembers@@SAXXZ"()
-  // MSC-DAG: declare dllimport                void @"\01?staticDecl at ImportMembers@@SAXXZ"()
-  // MSC-DAG: declare dllimport                void @"\01?staticInclass at ImportMembers@@SAXXZ"()
-  // MSC-DAG: declare dllimport                void @"\01?staticInlineDef at ImportMembers@@SAXXZ"()
-  // MSC-DAG: declare dllimport                void @"\01?staticInlineDecl at ImportMembers@@SAXXZ"()
-  // GNU-DAG: define                           void @_ZN13ImportMembers9staticDefEv()
-  // GNU-DAG: declare dllimport                void @_ZN13ImportMembers10staticDeclEv()
-  // GNU-DAG: define linkonce_odr              void @_ZN13ImportMembers13staticInclassEv()
-  // GNU-DAG: define linkonce_odr              void @_ZN13ImportMembers15staticInlineDefEv()
-  // GNU-DAG: define linkonce_odr              void @_ZN13ImportMembers16staticInlineDeclEv()
+  // MSC-DAG: define  dso_local dllexport                void @"\01?staticDef at ImportMembers@@SAXXZ"()
+  // MSC-DAG: declare           dllimport                void @"\01?staticDecl at ImportMembers@@SAXXZ"()
+  // MSC-DAG: declare           dllimport                void @"\01?staticInclass at ImportMembers@@SAXXZ"()
+  // MSC-DAG: declare           dllimport                void @"\01?staticInlineDef at ImportMembers@@SAXXZ"()
+  // MSC-DAG: declare           dllimport                void @"\01?staticInlineDecl at ImportMembers@@SAXXZ"()
+  // GNU-DAG: define  dso_local                          void @_ZN13ImportMembers9staticDefEv()
+  // GNU-DAG: declare           dllimport                void @_ZN13ImportMembers10staticDeclEv()
+  // GNU-DAG: define linkonce_odr dso_local               void @_ZN13ImportMembers13staticInclassEv()
+  // GNU-DAG: define linkonce_odr dso_local              void @_ZN13ImportMembers15staticInlineDefEv()
+  // GNU-DAG: define linkonce_odr dso_local              void @_ZN13ImportMembers16staticInlineDeclEv()
   // MO1-DAG: define available_externally dllimport void @"\01?staticInclass at ImportMembers@@SAXXZ"()
   // MO1-DAG: define available_externally dllimport void @"\01?staticInlineDef at ImportMembers@@SAXXZ"()
   // MO1-DAG: define available_externally dllimport void @"\01?staticInlineDecl at ImportMembers@@SAXXZ"()
-  // GO1-DAG: define linkonce_odr              void @_ZN13ImportMembers13staticInclassEv()
-  // GO1-DAG: define linkonce_odr              void @_ZN13ImportMembers15staticInlineDefEv()
-  // GO1-DAG: define linkonce_odr              void @_ZN13ImportMembers16staticInlineDeclEv()
+  // GO1-DAG: define linkonce_odr dso_local              void @_ZN13ImportMembers13staticInclassEv()
+  // GO1-DAG: define linkonce_odr dso_local              void @_ZN13ImportMembers15staticInlineDefEv()
+  // GO1-DAG: define linkonce_odr dso_local              void @_ZN13ImportMembers16staticInlineDeclEv()
   __declspec(dllimport) static         void staticDef(); // dllimport ignored
   __declspec(dllimport) static         void staticDecl();
   __declspec(dllimport) static         void staticInclass() {}
@@ -169,10 +169,10 @@ private:
   __declspec(dllimport)                void privateNormalDecl();
   __declspec(dllimport) static         void privateStaticDecl();
 
-  // M32-DAG: declare           x86_thiscallcc void @"\01?ignored at ImportMembers@@QAEXXZ"(%struct.ImportMembers*)
-  // M64-DAG: declare                          void @"\01?ignored at ImportMembers@@QEAAXXZ"(%struct.ImportMembers*)
-  // G32-DAG: declare           x86_thiscallcc void @_ZN13ImportMembers7ignoredEv(%struct.ImportMembers*)
-  // G64-DAG: declare                          void @_ZN13ImportMembers7ignoredEv(%struct.ImportMembers*)
+  // M32-DAG: declare dso_local          x86_thiscallcc void @"\01?ignored at ImportMembers@@QAEXXZ"(%struct.ImportMembers*)
+  // M64-DAG: declare dso_local                         void @"\01?ignored at ImportMembers@@QEAAXXZ"(%struct.ImportMembers*)
+  // G32-DAG: declare dso_local          x86_thiscallcc void @_ZN13ImportMembers7ignoredEv(%struct.ImportMembers*)
+  // G64-DAG: declare dso_local                         void @_ZN13ImportMembers7ignoredEv(%struct.ImportMembers*)
 public:
   void ignored();
 
@@ -235,87 +235,87 @@ USEMV(ImportMembers, ConstexprField)
 
 // Import individual members of a nested class.
 struct ImportMembers::Nested {
-  // M32-DAG: define  dllexport   x86_thiscallcc void @"\01?normalDef at Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"* %this)
-  // M64-DAG: define  dllexport                  void @"\01?normalDef at Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"* %this)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?normalDecl at Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*)
-  // M64-DAG: declare dllimport                  void @"\01?normalDecl at Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?normalInclass at Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*)
-  // M64-DAG: declare dllimport                  void @"\01?normalInclass at Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?normalInlineDef at Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*)
-  // M64-DAG: declare dllimport                  void @"\01?normalInlineDef at Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?normalInlineDecl at Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*)
-  // M64-DAG: declare dllimport                  void @"\01?normalInlineDecl at Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*)
-  // G32-DAG: define              x86_thiscallcc void @_ZN13ImportMembers6Nested9normalDefEv(%"struct.ImportMembers::Nested"* %this)
-  // G64-DAG: define                             void @_ZN13ImportMembers6Nested9normalDefEv(%"struct.ImportMembers::Nested"* %this)
+  // M32-DAG: define  dso_local dllexport   x86_thiscallcc void @"\01?normalDef at Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"* %this)
+  // M64-DAG: define  dso_local dllexport                  void @"\01?normalDef at Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"* %this)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?normalDecl at Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*)
+  // M64-DAG: declare           dllimport                  void @"\01?normalDecl at Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?normalInclass at Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*)
+  // M64-DAG: declare           dllimport                  void @"\01?normalInclass at Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?normalInlineDef at Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*)
+  // M64-DAG: declare           dllimport                  void @"\01?normalInlineDef at Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?normalInlineDecl at Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*)
+  // M64-DAG: declare           dllimport                  void @"\01?normalInlineDecl at Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*)
+  // G32-DAG: define  dso_local             x86_thiscallcc void @_ZN13ImportMembers6Nested9normalDefEv(%"struct.ImportMembers::Nested"* %this)
+  // G64-DAG: define  dso_local                            void @_ZN13ImportMembers6Nested9normalDefEv(%"struct.ImportMembers::Nested"* %this)
   // G32-DAG: declare dllimport   x86_thiscallcc void @_ZN13ImportMembers6Nested10normalDeclEv(%"struct.ImportMembers::Nested"*)
   // G64-DAG: declare dllimport                  void @_ZN13ImportMembers6Nested10normalDeclEv(%"struct.ImportMembers::Nested"*)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested13normalInclassEv(%"struct.ImportMembers::Nested"* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN13ImportMembers6Nested13normalInclassEv(%"struct.ImportMembers::Nested"* %this)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested15normalInlineDefEv(%"struct.ImportMembers::Nested"* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN13ImportMembers6Nested15normalInlineDefEv(%"struct.ImportMembers::Nested"* %this)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested16normalInlineDeclEv(%"struct.ImportMembers::Nested"* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN13ImportMembers6Nested16normalInlineDeclEv(%"struct.ImportMembers::Nested"* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested13normalInclassEv(%"struct.ImportMembers::Nested"* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN13ImportMembers6Nested13normalInclassEv(%"struct.ImportMembers::Nested"* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested15normalInlineDefEv(%"struct.ImportMembers::Nested"* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN13ImportMembers6Nested15normalInlineDefEv(%"struct.ImportMembers::Nested"* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested16normalInlineDeclEv(%"struct.ImportMembers::Nested"* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN13ImportMembers6Nested16normalInlineDeclEv(%"struct.ImportMembers::Nested"* %this)
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?normalInclass at Nested@ImportMembers@@QAEXXZ"(
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?normalInlineDef at Nested@ImportMembers@@QAEXXZ"(
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?normalInlineDecl at Nested@ImportMembers@@QAEXXZ"(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested13normalInclassEv(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested15normalInlineDefEv(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested16normalInlineDeclEv(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested13normalInclassEv(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested15normalInlineDefEv(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested16normalInlineDeclEv(
   __declspec(dllimport)                void normalDef(); // dllimport ignored
   __declspec(dllimport)                void normalDecl();
   __declspec(dllimport)                void normalInclass() {}
   __declspec(dllimport)                void normalInlineDef();
   __declspec(dllimport)         inline void normalInlineDecl();
 
-  // M32-DAG: define  dllexport   x86_thiscallcc void @"\01?virtualDef at Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"* %this)
-  // M64-DAG: define  dllexport                  void @"\01?virtualDef at Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"* %this)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?virtualDecl at Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*)
-  // M64-DAG: declare dllimport                  void @"\01?virtualDecl at Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?virtualInclass at Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*)
-  // M64-DAG: declare dllimport                  void @"\01?virtualInclass at Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?virtualInlineDef at Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*)
-  // M64-DAG: declare dllimport                  void @"\01?virtualInlineDef at Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*)
-  // M32-DAG: declare dllimport   x86_thiscallcc void @"\01?virtualInlineDecl at Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*)
-  // M64-DAG: declare dllimport                  void @"\01?virtualInlineDecl at Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*)
-  // G32-DAG: define              x86_thiscallcc void @_ZN13ImportMembers6Nested10virtualDefEv(%"struct.ImportMembers::Nested"* %this)
-  // G64-DAG: define                             void @_ZN13ImportMembers6Nested10virtualDefEv(%"struct.ImportMembers::Nested"* %this)
+  // M32-DAG: define  dso_local dllexport   x86_thiscallcc void @"\01?virtualDef at Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"* %this)
+  // M64-DAG: define  dso_local dllexport                  void @"\01?virtualDef at Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"* %this)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?virtualDecl at Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*)
+  // M64-DAG: declare           dllimport                  void @"\01?virtualDecl at Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?virtualInclass at Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*)
+  // M64-DAG: declare           dllimport                  void @"\01?virtualInclass at Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?virtualInlineDef at Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*)
+  // M64-DAG: declare           dllimport                  void @"\01?virtualInlineDef at Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*)
+  // M32-DAG: declare           dllimport   x86_thiscallcc void @"\01?virtualInlineDecl at Nested@ImportMembers@@UAEXXZ"(%"struct.ImportMembers::Nested"*)
+  // M64-DAG: declare           dllimport                  void @"\01?virtualInlineDecl at Nested@ImportMembers@@UEAAXXZ"(%"struct.ImportMembers::Nested"*)
+  // G32-DAG: define  dso_local             x86_thiscallcc void @_ZN13ImportMembers6Nested10virtualDefEv(%"struct.ImportMembers::Nested"* %this)
+  // G64-DAG: define  dso_local                            void @_ZN13ImportMembers6Nested10virtualDefEv(%"struct.ImportMembers::Nested"* %this)
   // G32-DAG: declare dllimport   x86_thiscallcc void @_ZN13ImportMembers6Nested11virtualDeclEv(%"struct.ImportMembers::Nested"*)
   // G64-DAG: declare dllimport                  void @_ZN13ImportMembers6Nested11virtualDeclEv(%"struct.ImportMembers::Nested"*)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested14virtualInclassEv(%"struct.ImportMembers::Nested"* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN13ImportMembers6Nested14virtualInclassEv(%"struct.ImportMembers::Nested"* %this)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested16virtualInlineDefEv(%"struct.ImportMembers::Nested"* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN13ImportMembers6Nested16virtualInlineDefEv(%"struct.ImportMembers::Nested"* %this)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ImportMembers6Nested17virtualInlineDeclEv(%"struct.ImportMembers::Nested"* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN13ImportMembers6Nested17virtualInlineDeclEv(%"struct.ImportMembers::Nested"* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested14virtualInclassEv(%"struct.ImportMembers::Nested"* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN13ImportMembers6Nested14virtualInclassEv(%"struct.ImportMembers::Nested"* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested16virtualInlineDefEv(%"struct.ImportMembers::Nested"* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN13ImportMembers6Nested16virtualInlineDefEv(%"struct.ImportMembers::Nested"* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested17virtualInlineDeclEv(%"struct.ImportMembers::Nested"* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN13ImportMembers6Nested17virtualInlineDeclEv(%"struct.ImportMembers::Nested"* %this)
 
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?virtualInclass at Nested@ImportMembers@@UAEXXZ"(
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?virtualInlineDef at Nested@ImportMembers@@UAEXXZ"(
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?virtualInlineDecl at Nested@ImportMembers@@UAEXXZ"(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc                   void @_ZN13ImportMembers6Nested14virtualInclassEv(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc                   void @_ZN13ImportMembers6Nested16virtualInlineDefEv(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc                   void @_ZN13ImportMembers6Nested17virtualInlineDeclEv(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc                   void @_ZN13ImportMembers6Nested14virtualInclassEv(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc                   void @_ZN13ImportMembers6Nested16virtualInlineDefEv(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc                   void @_ZN13ImportMembers6Nested17virtualInlineDeclEv(
   __declspec(dllimport) virtual        void virtualDef(); // dllimport ignored
   __declspec(dllimport) virtual        void virtualDecl();
   __declspec(dllimport) virtual        void virtualInclass() {}
   __declspec(dllimport) virtual        void virtualInlineDef();
   __declspec(dllimport) virtual inline void virtualInlineDecl();
 
-  // MSC-DAG: define  dllexport                void @"\01?staticDef at Nested@ImportMembers@@SAXXZ"()
-  // MSC-DAG: declare dllimport                void @"\01?staticDecl at Nested@ImportMembers@@SAXXZ"()
-  // MSC-DAG: declare dllimport                void @"\01?staticInclass at Nested@ImportMembers@@SAXXZ"()
-  // MSC-DAG: declare dllimport                void @"\01?staticInlineDef at Nested@ImportMembers@@SAXXZ"()
-  // MSC-DAG: declare dllimport                void @"\01?staticInlineDecl at Nested@ImportMembers@@SAXXZ"()
-  // GNU-DAG: define                           void @_ZN13ImportMembers6Nested9staticDefEv()
-  // GNU-DAG: declare dllimport                void @_ZN13ImportMembers6Nested10staticDeclEv()
-  // GNU-DAG: define linkonce_odr              void @_ZN13ImportMembers6Nested13staticInclassEv()
-  // GNU-DAG: define linkonce_odr              void @_ZN13ImportMembers6Nested15staticInlineDefEv()
-  // GNU-DAG: define linkonce_odr              void @_ZN13ImportMembers6Nested16staticInlineDeclEv()
+  // MSC-DAG: define  dso_local dllexport                void @"\01?staticDef at Nested@ImportMembers@@SAXXZ"()
+  // MSC-DAG: declare           dllimport                void @"\01?staticDecl at Nested@ImportMembers@@SAXXZ"()
+  // MSC-DAG: declare           dllimport                void @"\01?staticInclass at Nested@ImportMembers@@SAXXZ"()
+  // MSC-DAG: declare           dllimport                void @"\01?staticInlineDef at Nested@ImportMembers@@SAXXZ"()
+  // MSC-DAG: declare           dllimport                void @"\01?staticInlineDecl at Nested@ImportMembers@@SAXXZ"()
+  // GNU-DAG: define  dso_local                          void @_ZN13ImportMembers6Nested9staticDefEv()
+  // GNU-DAG: declare           dllimport                void @_ZN13ImportMembers6Nested10staticDeclEv()
+  // GNU-DAG: define linkonce_odr dso_local               void @_ZN13ImportMembers6Nested13staticInclassEv()
+  // GNU-DAG: define linkonce_odr dso_local              void @_ZN13ImportMembers6Nested15staticInlineDefEv()
+  // GNU-DAG: define linkonce_odr dso_local              void @_ZN13ImportMembers6Nested16staticInlineDeclEv()
   // MO1-DAG: define available_externally dllimport void @"\01?staticInclass at Nested@ImportMembers@@SAXXZ"()
   // MO1-DAG: define available_externally dllimport void @"\01?staticInlineDef at Nested@ImportMembers@@SAXXZ"()
   // MO1-DAG: define available_externally dllimport void @"\01?staticInlineDecl at Nested@ImportMembers@@SAXXZ"()
-  // GO1-DAG: define linkonce_odr              void @_ZN13ImportMembers6Nested13staticInclassEv()
-  // GO1-DAG: define linkonce_odr              void @_ZN13ImportMembers6Nested15staticInlineDefEv()
-  // GO1-DAG: define linkonce_odr              void @_ZN13ImportMembers6Nested16staticInlineDeclEv()
+  // GO1-DAG: define linkonce_odr dso_local              void @_ZN13ImportMembers6Nested13staticInclassEv()
+  // GO1-DAG: define linkonce_odr dso_local              void @_ZN13ImportMembers6Nested15staticInlineDefEv()
+  // GO1-DAG: define linkonce_odr dso_local              void @_ZN13ImportMembers6Nested16staticInlineDeclEv()
   __declspec(dllimport) static         void staticDef(); // dllimport ignored
   __declspec(dllimport) static         void staticDecl();
   __declspec(dllimport) static         void staticInclass() {}
@@ -342,10 +342,10 @@ private:
   __declspec(dllimport)                void privateNormalDecl();
   __declspec(dllimport) static         void privateStaticDecl();
 
-  // M32-DAG: declare           x86_thiscallcc void @"\01?ignored at Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*)
-  // M64-DAG: declare                          void @"\01?ignored at Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*)
-  // G32-DAG: declare           x86_thiscallcc void @_ZN13ImportMembers6Nested7ignoredEv(%"struct.ImportMembers::Nested"*)
-  // G64-DAG: declare                          void @_ZN13ImportMembers6Nested7ignoredEv(%"struct.ImportMembers::Nested"*)
+  // M32-DAG: declare dso_local           x86_thiscallcc void @"\01?ignored at Nested@ImportMembers@@QAEXXZ"(%"struct.ImportMembers::Nested"*)
+  // M64-DAG: declare dso_local                          void @"\01?ignored at Nested@ImportMembers@@QEAAXXZ"(%"struct.ImportMembers::Nested"*)
+  // G32-DAG: declare dso_local           x86_thiscallcc void @_ZN13ImportMembers6Nested7ignoredEv(%"struct.ImportMembers::Nested"*)
+  // G64-DAG: declare dso_local                          void @_ZN13ImportMembers6Nested7ignoredEv(%"struct.ImportMembers::Nested"*)
 public:
   void ignored();
 
@@ -451,50 +451,50 @@ USESPECIALS(ImportSpecials)
 struct ImportInlineSpecials {
   // M32-DAG: declare dllimport   x86_thiscallcc %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QAE at XZ"(%struct.ImportInlineSpecials* returned)
   // M64-DAG: declare dllimport                  %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QEAA at XZ"(%struct.ImportInlineSpecials* returned)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsC1Ev(%struct.ImportInlineSpecials* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN20ImportInlineSpecialsC1Ev(%struct.ImportInlineSpecials* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1Ev(%struct.ImportInlineSpecials* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN20ImportInlineSpecialsC1Ev(%struct.ImportInlineSpecials* %this)
   // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QAE at XZ"(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsC1Ev(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1Ev(
   __declspec(dllimport) ImportInlineSpecials() {}
 
   // M32-DAG: declare dllimport   x86_thiscallcc void @"\01??1ImportInlineSpecials@@QAE at XZ"(%struct.ImportInlineSpecials*)
   // M64-DAG: declare dllimport                  void @"\01??1ImportInlineSpecials@@QEAA at XZ"(%struct.ImportInlineSpecials*)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsD1Ev(%struct.ImportInlineSpecials* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN20ImportInlineSpecialsD1Ev(%struct.ImportInlineSpecials* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsD1Ev(%struct.ImportInlineSpecials* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN20ImportInlineSpecialsD1Ev(%struct.ImportInlineSpecials* %this)
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01??1ImportInlineSpecials@@QAE at XZ"(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsD1Ev(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsD1Ev(
   __declspec(dllimport) ~ImportInlineSpecials() {}
 
   // M32-DAG: declare dllimport   x86_thiscallcc %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QAE at ABU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
   // M64-DAG: declare dllimport                  %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QEAA at AEBU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsC1ERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define linkonce_odr                void @_ZN20ImportInlineSpecialsC1ERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1ERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN20ImportInlineSpecialsC1ERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
   // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QAE at ABU0@@Z"(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsC1ERKS_(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1ERKS_(
   __declspec(dllimport) inline ImportInlineSpecials(const ImportInlineSpecials&);
 
   // M32-DAG: declare dllimport   x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"\01??4ImportInlineSpecials@@QAEAAU0 at ABU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
   // M64-DAG: declare dllimport                  dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"\01??4ImportInlineSpecials@@QEAAAEAU0 at AEBU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define linkonce_odr                dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define linkonce_odr dso_local                dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
   // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"\01??4ImportInlineSpecials@@QAEAAU0 at ABU0@@Z"(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(
   __declspec(dllimport) ImportInlineSpecials& operator=(const ImportInlineSpecials&);
 
   // M32-DAG: declare dllimport   x86_thiscallcc %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QAE@$$QAU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
   // M64-DAG: declare dllimport                  %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QEAA@$$QEAU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsC1EOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define linkonce_odr                void @_ZN20ImportInlineSpecialsC1EOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1EOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN20ImportInlineSpecialsC1EOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
   // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"\01??0ImportInlineSpecials@@QAE@$$QAU0@@Z"(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN20ImportInlineSpecialsC1EOS_(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1EOS_(
   __declspec(dllimport) ImportInlineSpecials(ImportInlineSpecials&&) {}
 
   // M32-DAG: declare dllimport   x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"\01??4ImportInlineSpecials@@QAEAAU0@$$QAU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
   // M64-DAG: declare dllimport                  dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"\01??4ImportInlineSpecials@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define linkonce_odr                dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define linkonce_odr dso_local                dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
   // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"\01??4ImportInlineSpecials@@QAEAAU0@$$QAU0@@Z"(
-  // GO1-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(
   __declspec(dllimport) ImportInlineSpecials& operator=(ImportInlineSpecials&&) { return *this; }
 };
 ImportInlineSpecials::ImportInlineSpecials(const ImportInlineSpecials&) {}
@@ -506,50 +506,50 @@ USESPECIALS(ImportInlineSpecials)
 struct ImportDefaulted {
   // M32-DAG: declare dllimport   x86_thiscallcc %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QAE at XZ"(%struct.ImportDefaulted* returned)
   // M64-DAG: declare dllimport                  %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QEAA at XZ"(%struct.ImportDefaulted* returned)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void                     @_ZN15ImportDefaultedC1Ev(%struct.ImportDefaulted* %this)
-  // G64-DAG: define linkonce_odr                void                     @_ZN15ImportDefaultedC1Ev(%struct.ImportDefaulted* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void                     @_ZN15ImportDefaultedC1Ev(%struct.ImportDefaulted* %this)
+  // G64-DAG: define linkonce_odr dso_local                void                     @_ZN15ImportDefaultedC1Ev(%struct.ImportDefaulted* %this)
   // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QAE at XZ"(%struct.ImportDefaulted* returned %this)
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN15ImportDefaultedC1Ev(%struct.ImportDefaulted* %this)
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1Ev(%struct.ImportDefaulted* %this)
   __declspec(dllimport) ImportDefaulted() = default;
 
   // M32-DAG: declare dllimport   x86_thiscallcc void @"\01??1ImportDefaulted@@QAE at XZ"(%struct.ImportDefaulted*)
   // M64-DAG: declare dllimport                  void @"\01??1ImportDefaulted@@QEAA at XZ"(%struct.ImportDefaulted*)
-  // G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN15ImportDefaultedD1Ev(%struct.ImportDefaulted* %this)
-  // G64-DAG: define linkonce_odr                void @_ZN15ImportDefaultedD1Ev(%struct.ImportDefaulted* %this)
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedD1Ev(%struct.ImportDefaulted* %this)
+  // G64-DAG: define linkonce_odr dso_local                void @_ZN15ImportDefaultedD1Ev(%struct.ImportDefaulted* %this)
   // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01??1ImportDefaulted@@QAE at XZ"(%struct.ImportDefaulted* %this)
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN15ImportDefaultedD1Ev(%struct.ImportDefaulted* %this)
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedD1Ev(%struct.ImportDefaulted* %this)
   __declspec(dllimport) ~ImportDefaulted() = default;
 
   // M32-DAG: declare dllimport   x86_thiscallcc %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QAE at ABU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
   // M64-DAG: declare dllimport                  %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QEAA at AEBU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define linkonce_odr x86_thiscallcc void                     @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define linkonce_odr                void                     @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void                     @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define linkonce_odr dso_local                void                     @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
   // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QAE at ABU0@@Z"(%struct.ImportDefaulted* returned %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
   __declspec(dllimport) ImportDefaulted(const ImportDefaulted&) = default;
 
   // M32-DAG: declare dllimport   x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"\01??4ImportDefaulted@@QAEAAU0 at ABU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
   // M64-DAG: declare dllimport                  dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"\01??4ImportDefaulted@@QEAAAEAU0 at AEBU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define linkonce_odr                dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define linkonce_odr dso_local                dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
   // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"\01??4ImportDefaulted@@QAEAAU0 at ABU0@@Z"(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
-  // GO1-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
   __declspec(dllimport) ImportDefaulted& operator=(const ImportDefaulted&) = default;
 
   // M32-DAG: declare dllimport   x86_thiscallcc %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QAE@$$QAU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
   // M64-DAG: declare dllimport                  %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QEAA@$$QEAU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define linkonce_odr x86_thiscallcc void                     @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define linkonce_odr                void                     @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void                     @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define linkonce_odr dso_local                void                     @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
   // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportDefaulted* @"\01??0ImportDefaulted@@QAE@$$QAU0@@Z"(%struct.ImportDefaulted* returned %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
-  // GO1-DAG: define linkonce_odr x86_thiscallcc void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
   __declspec(dllimport) ImportDefaulted(ImportDefaulted&&) = default;
 
   // M32-DAG: declare dllimport   x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"\01??4ImportDefaulted@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
   // M64-DAG: declare dllimport                  dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"\01??4ImportDefaulted@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
-  // G32-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
-  // G64-DAG: define linkonce_odr                dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+  // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+  // G64-DAG: define linkonce_odr dso_local                dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
   // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"\01??4ImportDefaulted@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
-  // GO1-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+  // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
   __declspec(dllimport) ImportDefaulted& operator=(ImportDefaulted&&) = default;
 
   ForceNonTrivial v; // ensure special members are non-trivial
@@ -585,28 +585,28 @@ __declspec(dllimport) ImportDefaultedDef
 
 // M32-DAG: declare dllimport   x86_thiscallcc %struct.ImportDefaultedDefs* @"\01??0ImportDefaultedDefs@@QAE at ABU0@@Z"(%struct.ImportDefaultedDefs* returned, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
 // M64-DAG: declare dllimport                  %struct.ImportDefaultedDefs* @"\01??0ImportDefaultedDefs@@QEAA at AEBU0@@Z"(%struct.ImportDefaultedDefs* returned, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN19ImportDefaultedDefsC1ERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define linkonce_odr                void @_ZN19ImportDefaultedDefsC1ERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC1ERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G64-DAG: define linkonce_odr dso_local                 void @_ZN19ImportDefaultedDefsC1ERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
 inline ImportDefaultedDefs::ImportDefaultedDefs(const ImportDefaultedDefs&) = default;
 
 // M32-DAG: declare dllimport   x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"\01??4ImportDefaultedDefs@@QAEAAU0 at ABU0@@Z"(%struct.ImportDefaultedDefs*, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
 // M64-DAG: declare dllimport                  dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"\01??4ImportDefaultedDefs@@QEAAAEAU0 at AEBU0@@Z"(%struct.ImportDefaultedDefs*, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define linkonce_odr                dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G64-DAG: define linkonce_odr dso_local                dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
 inline ImportDefaultedDefs& ImportDefaultedDefs::operator=(const ImportDefaultedDefs&) = default;
 
-// M32-DAG: define dllexport x86_thiscallcc %struct.ImportDefaultedDefs* @"\01??0ImportDefaultedDefs@@QAE@$$QAU0@@Z"(%struct.ImportDefaultedDefs* returned %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// M64-DAG: define dllexport                %struct.ImportDefaultedDefs* @"\01??0ImportDefaultedDefs@@QEAA@$$QEAU0@@Z"(%struct.ImportDefaultedDefs* returned %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define x86_thiscallcc void @_ZN19ImportDefaultedDefsC1EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define                void @_ZN19ImportDefaultedDefsC1EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define x86_thiscallcc void @_ZN19ImportDefaultedDefsC2EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define                void @_ZN19ImportDefaultedDefsC2EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ImportDefaultedDefs* @"\01??0ImportDefaultedDefs@@QAE@$$QAU0@@Z"(%struct.ImportDefaultedDefs* returned %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M64-DAG: define dso_local dllexport                %struct.ImportDefaultedDefs* @"\01??0ImportDefaultedDefs@@QEAA@$$QEAU0@@Z"(%struct.ImportDefaultedDefs* returned %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G32-DAG: define dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC1EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G64-DAG: define dso_local                void @_ZN19ImportDefaultedDefsC1EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G32-DAG: define dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC2EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G64-DAG: define dso_local                void @_ZN19ImportDefaultedDefsC2EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
 ImportDefaultedDefs::ImportDefaultedDefs(ImportDefaultedDefs&&) = default; // dllimport ignored
 
-// M32-DAG: define dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"\01??4ImportDefaultedDefs@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// M64-DAG: define dllexport                dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"\01??4ImportDefaultedDefs@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSEOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define                dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSEOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"\01??4ImportDefaultedDefs@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M64-DAG: define dso_local dllexport                dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"\01??4ImportDefaultedDefs@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G32-DAG: define dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSEOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G64-DAG: define dso_local                dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSEOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
 ImportDefaultedDefs& ImportDefaultedDefs::operator=(ImportDefaultedDefs&&) = default; // dllimport ignored
 
 USESPECIALS(ImportDefaultedDefs)
@@ -659,12 +659,12 @@ struct MemFunTmpl {
 // Import implicit instantiation of an imported member function template.
 // M32-DAG: declare dllimport   x86_thiscallcc void @"\01??$importedNormal at UImplicitInst_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*)
 // M64-DAG: declare dllimport                  void @"\01??$importedNormal at UImplicitInst_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*)
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI21ImplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define linkonce_odr                void @_ZN10MemFunTmpl14importedNormalI21ImplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this)
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI21ImplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define linkonce_odr dso_local                void @_ZN10MemFunTmpl14importedNormalI21ImplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this)
 USEMF(MemFunTmpl, importedNormal<ImplicitInst_Imported>)
 
 // MSC-DAG: declare dllimport                void @"\01??$importedStatic at UImplicitInst_Imported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define linkonce_odr              void @_ZN10MemFunTmpl14importedStaticI21ImplicitInst_ImportedEEvv()
+// GNU-DAG: define linkonce_odr dso_local              void @_ZN10MemFunTmpl14importedStaticI21ImplicitInst_ImportedEEvv()
 USE(MemFunTmpl::importedStatic<ImplicitInst_Imported>)
 
 
@@ -672,13 +672,13 @@ USE(MemFunTmpl::importedStatic<ImplicitI
 // template.
 // M32-DAG: declare dllimport x86_thiscallcc void @"\01??$importedNormal at UExplicitDecl_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*)
 // M64-DAG: declare dllimport                void @"\01??$importedNormal at UExplicitDecl_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*)
-// G32-DAG: declare x86_thiscallcc           void @_ZN10MemFunTmpl14importedNormalI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*)
-// G64-DAG: declare                          void @_ZN10MemFunTmpl14importedNormalI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*)
+// G32-DAG: declare dso_local x86_thiscallcc           void @_ZN10MemFunTmpl14importedNormalI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*)
+// G64-DAG: declare dso_local                          void @_ZN10MemFunTmpl14importedNormalI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*)
 extern template void MemFunTmpl::importedNormal<ExplicitDecl_Imported>();
 USEMF(MemFunTmpl, importedNormal<ExplicitDecl_Imported>)
 
 // MSC-DAG: declare dllimport                void @"\01??$importedStatic at UExplicitDecl_Imported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: declare                          void @_ZN10MemFunTmpl14importedStaticI21ExplicitDecl_ImportedEEvv()
+// GNU-DAG: declare dso_local                void @_ZN10MemFunTmpl14importedStaticI21ExplicitDecl_ImportedEEvv()
 extern template void MemFunTmpl::importedStatic<ExplicitDecl_Imported>();
 USE(MemFunTmpl::importedStatic<ExplicitDecl_Imported>)
 
@@ -687,13 +687,13 @@ USE(MemFunTmpl::importedStatic<ExplicitD
 // template.
 // M32-DAG: declare dllimport x86_thiscallcc void @"\01??$importedNormal at UExplicitInst_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*)
 // M64-DAG: declare dllimport                void @"\01??$importedNormal at UExplicitInst_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*)
-// G32-DAG: define weak_odr x86_thiscallcc   void @_ZN10MemFunTmpl14importedNormalI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define weak_odr                  void @_ZN10MemFunTmpl14importedNormalI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this)
+// G32-DAG: define weak_odr dso_local x86_thiscallcc   void @_ZN10MemFunTmpl14importedNormalI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define weak_odr dso_local                  void @_ZN10MemFunTmpl14importedNormalI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this)
 template void MemFunTmpl::importedNormal<ExplicitInst_Imported>();
 USEMF(MemFunTmpl, importedNormal<ExplicitInst_Imported>)
 
 // MSC-DAG: declare dllimport                void @"\01??$importedStatic at UExplicitInst_Imported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define weak_odr                  void @_ZN10MemFunTmpl14importedStaticI21ExplicitInst_ImportedEEvv()
+// GNU-DAG: define weak_odr dso_local        void @_ZN10MemFunTmpl14importedStaticI21ExplicitInst_ImportedEEvv()
 template void MemFunTmpl::importedStatic<ExplicitInst_Imported>();
 USE(MemFunTmpl::importedStatic<ExplicitInst_Imported>)
 
@@ -715,8 +715,8 @@ USEMF(MemFunTmpl, importedNormal<Explici
 
 // M32-DAG: declare dllimport   x86_thiscallcc void @"\01??$importedNormal at UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*)
 // M64-DAG: declare dllimport                  void @"\01??$importedNormal at UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*)
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define linkonce_odr                void @_ZN10MemFunTmpl14importedNormalI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this)
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define linkonce_odr dso_local                void @_ZN10MemFunTmpl14importedNormalI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this)
 template<> __declspec(dllimport) inline void MemFunTmpl::importedNormal<ExplicitSpec_InlineDef_Imported>() {}
 USEMF(MemFunTmpl, importedNormal<ExplicitSpec_InlineDef_Imported>)
 
@@ -733,22 +733,22 @@ USE(MemFunTmpl::importedStatic<ExplicitS
 #endif
 
 // MSC-DAG: declare dllimport                void @"\01??$importedStatic at UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define linkonce_odr              void @_ZN10MemFunTmpl14importedStaticI31ExplicitSpec_InlineDef_ImportedEEvv()
+// GNU-DAG: define linkonce_odr dso_local    void @_ZN10MemFunTmpl14importedStaticI31ExplicitSpec_InlineDef_ImportedEEvv()
 template<> __declspec(dllimport) inline void MemFunTmpl::importedStatic<ExplicitSpec_InlineDef_Imported>() {}
 USE(MemFunTmpl::importedStatic<ExplicitSpec_InlineDef_Imported>)
 
 
 // Not importing specialization of an imported member function template without
 // explicit dllimport.
-// M32-DAG: define x86_thiscallcc void @"\01??$importedNormal at UExplicitSpec_NotImported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
-// M64-DAG: define                void @"\01??$importedNormal at UExplicitSpec_NotImported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
-// G32-DAG: define x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI24ExplicitSpec_NotImportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define                void @_ZN10MemFunTmpl14importedNormalI24ExplicitSpec_NotImportedEEvv(%struct.MemFunTmpl* %this)
+// M32-DAG: define dso_local x86_thiscallcc void @"\01??$importedNormal at UExplicitSpec_NotImported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl* %this)
+// M64-DAG: define dso_local                void @"\01??$importedNormal at UExplicitSpec_NotImported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl* %this)
+// G32-DAG: define dso_local x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI24ExplicitSpec_NotImportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define dso_local                void @_ZN10MemFunTmpl14importedNormalI24ExplicitSpec_NotImportedEEvv(%struct.MemFunTmpl* %this)
 template<> void MemFunTmpl::importedNormal<ExplicitSpec_NotImported>() {}
 USEMF(MemFunTmpl, importedNormal<ExplicitSpec_NotImported>)
 
-// MSC-DAG: define                void @"\01??$importedStatic at UExplicitSpec_NotImported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define                void @_ZN10MemFunTmpl14importedStaticI24ExplicitSpec_NotImportedEEvv()
+// MSC-DAG: define dso_local                void @"\01??$importedStatic at UExplicitSpec_NotImported@@@MemFunTmpl@@SAXXZ"()
+// GNU-DAG: define dso_local                void @_ZN10MemFunTmpl14importedStaticI24ExplicitSpec_NotImportedEEvv()
 template<> void MemFunTmpl::importedStatic<ExplicitSpec_NotImported>() {}
 USE(MemFunTmpl::importedStatic<ExplicitSpec_NotImported>)
 
@@ -757,13 +757,13 @@ USE(MemFunTmpl::importedStatic<ExplicitS
 // template.
 // M32-DAG: declare dllimport x86_thiscallcc void @"\01??$normalDef at UExplicitDecl_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*)
 // M64-DAG: declare dllimport                void @"\01??$normalDef at UExplicitDecl_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*)
-// G32-DAG: declare x86_thiscallcc           void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*)
-// G64-DAG: declare                          void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*)
+// G32-DAG: declare dso_local x86_thiscallcc           void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*)
+// G64-DAG: declare dso_local                          void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ImportedEEvv(%struct.MemFunTmpl*)
 extern template __declspec(dllimport) void MemFunTmpl::normalDef<ExplicitDecl_Imported>();
 USEMF(MemFunTmpl, normalDef<ExplicitDecl_Imported>)
 
 // MSC-DAG: declare dllimport                void @"\01??$staticDef at UExplicitDecl_Imported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: declare                          void @_ZN10MemFunTmpl9staticDefI21ExplicitDecl_ImportedEEvv()
+// GNU-DAG: declare dso_local                void @_ZN10MemFunTmpl9staticDefI21ExplicitDecl_ImportedEEvv()
 extern template __declspec(dllimport) void MemFunTmpl::staticDef<ExplicitDecl_Imported>();
 USE(MemFunTmpl::staticDef<ExplicitDecl_Imported>)
 
@@ -772,13 +772,13 @@ USE(MemFunTmpl::staticDef<ExplicitDecl_I
 // template.
 // M32-DAG: declare dllimport x86_thiscallcc void @"\01??$normalDef at UExplicitInst_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*)
 // M64-DAG: declare dllimport                void @"\01??$normalDef at UExplicitInst_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*)
-// G32-DAG: define weak_odr x86_thiscallcc   void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define weak_odr                  void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this)
+// G32-DAG: define weak_odr dso_local x86_thiscallcc   void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define weak_odr dso_local                  void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ImportedEEvv(%struct.MemFunTmpl* %this)
 template __declspec(dllimport) void MemFunTmpl::normalDef<ExplicitInst_Imported>();
 USEMF(MemFunTmpl, normalDef<ExplicitInst_Imported>)
 
 // MSC-DAG: declare dllimport                void @"\01??$staticDef at UExplicitInst_Imported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define weak_odr                  void @_ZN10MemFunTmpl9staticDefI21ExplicitInst_ImportedEEvv()
+// GNU-DAG: define weak_odr dso_local                  void @_ZN10MemFunTmpl9staticDefI21ExplicitInst_ImportedEEvv()
 template __declspec(dllimport) void MemFunTmpl::staticDef<ExplicitInst_Imported>();
 USE(MemFunTmpl::staticDef<ExplicitInst_Imported>)
 
@@ -800,8 +800,8 @@ USEMF(MemFunTmpl, normalDef<ExplicitSpec
 
 // M32-DAG: declare dllimport   x86_thiscallcc void @"\01??$normalDef at UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QAEXXZ"(%struct.MemFunTmpl*)
 // M64-DAG: declare dllimport                  void @"\01??$normalDef at UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QEAAXXZ"(%struct.MemFunTmpl*)
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this)
-// G64-DAG: define linkonce_odr                void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this)
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this)
+// G64-DAG: define linkonce_odr dso_local                void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ImportedEEvv(%struct.MemFunTmpl* %this)
 template<> __declspec(dllimport) inline void MemFunTmpl::normalDef<ExplicitSpec_InlineDef_Imported>() {}
 USEMF(MemFunTmpl, normalDef<ExplicitSpec_InlineDef_Imported>)
 
@@ -818,7 +818,7 @@ USE(MemFunTmpl::staticDef<ExplicitSpec_I
 #endif
 
 // MSC-DAG: declare dllimport void @"\01??$staticDef at UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@SAXXZ"()
-// GNU-DAG: define linkonce_odr void @_ZN10MemFunTmpl9staticDefI31ExplicitSpec_InlineDef_ImportedEEvv()
+// GNU-DAG: define linkonce_odr dso_local void @_ZN10MemFunTmpl9staticDefI31ExplicitSpec_InlineDef_ImportedEEvv()
 template<> __declspec(dllimport) inline void MemFunTmpl::staticDef<ExplicitSpec_InlineDef_Imported>() {}
 USE(MemFunTmpl::staticDef<ExplicitSpec_InlineDef_Imported>)
 
@@ -853,8 +853,8 @@ USEMV(MemVarTmpl, ImportedStaticVar<Expl
 
 // Not importing specialization of a member variable template without explicit
 // dllimport.
-// MSC-DAG: @"\01??$ImportedStaticVar at UExplicitSpec_NotImported@@@MemVarTmpl@@2HB" = external constant i32
-// GNU-DAG: @_ZN10MemVarTmpl17ImportedStaticVarI24ExplicitSpec_NotImportedEE       = external constant i32
+// MSC-DAG: @"\01??$ImportedStaticVar at UExplicitSpec_NotImported@@@MemVarTmpl@@2HB" = external dso_local constant i32
+// GNU-DAG: @_ZN10MemVarTmpl17ImportedStaticVarI24ExplicitSpec_NotImportedEE       = external dso_local constant i32
 template<> const int MemVarTmpl::ImportedStaticVar<ExplicitSpec_NotImported>;
 USEMV(MemVarTmpl, ImportedStaticVar<ExplicitSpec_NotImported>)
 

Modified: cfe/trunk/test/CodeGenCXX/dllimport-memptr-global.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllimport-memptr-global.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllimport-memptr-global.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllimport-memptr-global.cpp Fri Feb 23 11:30:48 2018
@@ -40,15 +40,15 @@ auto mp_general_v = &General::virt;
 
 // All of the non-virtual globals need dynamic initializers.
 
-// CHECK: @"\01?mp_single_nv@@3P8Single@@AEXXZQ1@" = global i8* null, align 4
-// CHECK: @"\01?mp_multi_nv@@3P8Multi@@AEXXZQ1@" = global { i8*, i32 } zeroinitializer, align 4
-// CHECK: @"\01?mp_virtual_nv@@3P8Virtual@@AEXXZQ1@" = global { i8*, i32, i32 } zeroinitializer, align 4
-// CHECK: @"\01?mp_general_nv@@3P8General@@AEXXZQ1@" = global { i8*, i32, i32, i32 } zeroinitializer, align 4
+// CHECK: @"\01?mp_single_nv@@3P8Single@@AEXXZQ1@" = dso_local global i8* null, align 4
+// CHECK: @"\01?mp_multi_nv@@3P8Multi@@AEXXZQ1@" = dso_local global { i8*, i32 } zeroinitializer, align 4
+// CHECK: @"\01?mp_virtual_nv@@3P8Virtual@@AEXXZQ1@" = dso_local global { i8*, i32, i32 } zeroinitializer, align 4
+// CHECK: @"\01?mp_general_nv@@3P8General@@AEXXZQ1@" = dso_local global { i8*, i32, i32, i32 } zeroinitializer, align 4
 
-// CHECK: @"\01?mp_single_v@@3P8Single@@AEXXZQ1@" = global i8* bitcast (void (%struct.Single*, ...)* @"\01??_9Single@@$BA at AE" to i8*), align 4
-// CHECK: @"\01?mp_multi_v@@3P8Multi@@AEXXZQ1@" = global { i8*, i32 } { i8* bitcast (void (%struct.Multi*, ...)* @"\01??_9Multi@@$BA at AE" to i8*), i32 0 }, align 4
-// CHECK: @"\01?mp_virtual_v@@3P8Virtual@@AEXXZQ1@" = global { i8*, i32, i32 } { i8* bitcast (void (%struct.Virtual*, ...)* @"\01??_9Virtual@@$BA at AE" to i8*), i32 0, i32 0 }, align 4
-// CHECK: @"\01?mp_general_v@@3P8General@@AEXXZQ1@" = global { i8*, i32, i32, i32 } { i8* bitcast (void (%struct.General*, ...)* @"\01??_9General@@$BA at AE" to i8*), i32 0, i32 0, i32 0 }, align 4
+// CHECK: @"\01?mp_single_v@@3P8Single@@AEXXZQ1@" = dso_local global i8* bitcast (void (%struct.Single*, ...)* @"\01??_9Single@@$BA at AE" to i8*), align 4
+// CHECK: @"\01?mp_multi_v@@3P8Multi@@AEXXZQ1@" = dso_local global { i8*, i32 } { i8* bitcast (void (%struct.Multi*, ...)* @"\01??_9Multi@@$BA at AE" to i8*), i32 0 }, align 4
+// CHECK: @"\01?mp_virtual_v@@3P8Virtual@@AEXXZQ1@" = dso_local global { i8*, i32, i32 } { i8* bitcast (void (%struct.Virtual*, ...)* @"\01??_9Virtual@@$BA at AE" to i8*), i32 0, i32 0 }, align 4
+// CHECK: @"\01?mp_general_v@@3P8General@@AEXXZQ1@" = dso_local global { i8*, i32, i32, i32 } { i8* bitcast (void (%struct.General*, ...)* @"\01??_9General@@$BA at AE" to i8*), i32 0, i32 0, i32 0 }, align 4
 
 // CHECK: define internal void @_GLOBAL__sub_I{{.*}}() {{.*}} {
 // CHECK:   call void @"\01??__Emp_single_nv@@YAXXZ"()

Modified: cfe/trunk/test/CodeGenCXX/dllimport-rtti.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllimport-rtti.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllimport-rtti.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllimport-rtti.cpp Fri Feb 23 11:30:48 2018
@@ -12,7 +12,7 @@ struct __declspec(dllimport) S {
 // MSVC-DAG: @"\01??_R3S@@8" = linkonce_odr
 
 // GNU-DAG: @_ZTV1S = available_externally dllimport
-// GNU-DAG: @_ZTI1S = linkonce_odr
+// GNU-DAG: @_ZTI1S = linkonce_odr dso_local
 
 struct U : S {
 } u;
@@ -21,13 +21,13 @@ struct __declspec(dllimport) V {
   virtual void f();
 } v;
 // GNU-DAG: @_ZTV1V = available_externally dllimport
-// GNU-DAG: @_ZTS1V = linkonce_odr
-// GNU-DAG: @_ZTI1V = linkonce_odr
+// GNU-DAG: @_ZTS1V = linkonce_odr dso_local
+// GNU-DAG: @_ZTI1V = linkonce_odr dso_local
 
 struct W {
   __declspec(dllimport) virtual void f();
   virtual void g();
 } w;
-// GNU-DAG: @_ZTV1W = linkonce_odr
-// GNU-DAG: @_ZTS1W = linkonce_odr
-// GNU-DAG: @_ZTI1W = linkonce_odr
+// GNU-DAG: @_ZTV1W = linkonce_odr dso_local
+// GNU-DAG: @_ZTS1W = linkonce_odr dso_local
+// GNU-DAG: @_ZTI1W = linkonce_odr dso_local

Modified: cfe/trunk/test/CodeGenCXX/dllimport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllimport.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dllimport.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/dllimport.cpp Fri Feb 23 11:30:48 2018
@@ -77,8 +77,8 @@ USEVAR(GlobalRedecl2c)
 
 // NB: MSC issues a warning and makes GlobalRedecl3 dllexport. We follow GCC
 // and drop the dllimport with a warning.
-// MSC-DAG: @"\01?GlobalRedecl3@@3HA" = external global i32
-// GNU-DAG: @GlobalRedecl3            = external global i32
+// MSC-DAG: @"\01?GlobalRedecl3@@3HA" = external dso_local global i32
+// GNU-DAG: @GlobalRedecl3            = external dso_local global i32
 __declspec(dllimport) extern int GlobalRedecl3;
                       extern int GlobalRedecl3; // dllimport ignored
 USEVAR(GlobalRedecl3)
@@ -136,8 +136,8 @@ template<typename T> __declspec(dllimpor
 template<typename T> __declspec(dllimport) int VarTmplRedecl2;
 USEVAR(VarTmplRedecl2<ImplicitInst_Imported>)
 
-// MSC-DAG: @"\01??$VarTmplRedecl3 at UImplicitInst_Imported@@@@3HA" = external global i32
-// GNU-DAG: @_Z14VarTmplRedecl3I21ImplicitInst_ImportedE          = external global i32
+// MSC-DAG: @"\01??$VarTmplRedecl3 at UImplicitInst_Imported@@@@3HA" = external dso_local global i32
+// GNU-DAG: @_Z14VarTmplRedecl3I21ImplicitInst_ImportedE          = external dso_local global i32
 template<typename T> __declspec(dllimport) extern int VarTmplRedecl3;
 template<typename T>                       extern int VarTmplRedecl3; // dllimport ignored
 USEVAR(VarTmplRedecl3<ImplicitInst_Imported>)
@@ -174,8 +174,8 @@ USEVAR(ImportedVarTmpl<ExplicitSpec_Impo
 
 // Not importing specialization of an imported variable template without
 // explicit dllimport.
-// MSC-DAG: @"\01??$ImportedVarTmpl at UExplicitSpec_NotImported@@@@3HA" = global i32 0, align 4
-// GNU-DAG: @_Z15ImportedVarTmplI24ExplicitSpec_NotImportedE          = global i32 0, align 4
+// MSC-DAG: @"\01??$ImportedVarTmpl at UExplicitSpec_NotImported@@@@3HA" = dso_local global i32 0, align 4
+// GNU-DAG: @_Z15ImportedVarTmplI24ExplicitSpec_NotImportedE          = dso_local global i32 0, align 4
 template<> int ImportedVarTmpl<ExplicitSpec_NotImported>;
 USEVAR(ImportedVarTmpl<ExplicitSpec_NotImported>)
 
@@ -217,31 +217,31 @@ USE(externC)
 
 // Import inline function.
 // MSC-DAG: declare dllimport void @"\01?inlineFunc@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z10inlineFuncv()
+// GNU-DAG: define linkonce_odr dso_local void @_Z10inlineFuncv()
 // MO1-DAG: define available_externally dllimport void @"\01?inlineFunc@@YAXXZ"()
-// GO1-DAG: define linkonce_odr void @_Z10inlineFuncv()
+// GO1-DAG: define linkonce_odr dso_local void @_Z10inlineFuncv()
 __declspec(dllimport) inline void inlineFunc() {}
 USE(inlineFunc)
 
 // MSC-DAG: declare dllimport void @"\01?inlineDecl@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z10inlineDeclv()
+// GNU-DAG: define linkonce_odr dso_local void @_Z10inlineDeclv()
 // MO1-DAG: define available_externally dllimport void @"\01?inlineDecl@@YAXXZ"()
-// GO1-DAG: define linkonce_odr void @_Z10inlineDeclv()
+// GO1-DAG: define linkonce_odr dso_local void @_Z10inlineDeclv()
 __declspec(dllimport) inline void inlineDecl();
                              void inlineDecl() {}
 USE(inlineDecl)
 
 // MSC-DAG: declare dllimport void @"\01?inlineDef@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z9inlineDefv()
+// GNU-DAG: define linkonce_odr dso_local void @_Z9inlineDefv()
 // MO1-DAG: define available_externally dllimport void @"\01?inlineDef@@YAXXZ"()
-// GO1-DAG: define linkonce_odr void @_Z9inlineDefv()
+// GO1-DAG: define linkonce_odr dso_local void @_Z9inlineDefv()
 __declspec(dllimport) void inlineDef();
                inline void inlineDef() {}
 USE(inlineDef)
 
 // inline attributes
 // MSC-DAG: declare dllimport void @"\01?noinline@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z8noinlinev()
+// GNU-DAG: define linkonce_odr dso_local void @_Z8noinlinev()
 __declspec(dllimport) __attribute__((noinline)) inline void noinline() {}
 USE(noinline)
 
@@ -259,30 +259,30 @@ USE(redecl1)
 
 // NB: MSC issues a warning and makes redecl2/redecl3 dllexport. We follow GCC
 // and drop the dllimport with a warning.
-// MSC-DAG: declare void @"\01?redecl2@@YAXXZ"()
-// GNU-DAG: declare void @_Z7redecl2v()
+// MSC-DAG: declare dso_local void @"\01?redecl2@@YAXXZ"()
+// GNU-DAG: declare dso_local void @_Z7redecl2v()
 __declspec(dllimport) void redecl2();
                       void redecl2();
 USE(redecl2)
 
-// MSC-DAG: define dllexport void @"\01?redecl3@@YAXXZ"()
-// GNU-DAG: define void @_Z7redecl3v()
+// MSC-DAG: define dso_local dllexport void @"\01?redecl3@@YAXXZ"()
+// GNU-DAG: define dso_local void @_Z7redecl3v()
 __declspec(dllimport) void redecl3();
                       void redecl3() {} // dllimport ignored
 USE(redecl3)
 
 
 // Friend functions
-// MSC-DAG: declare dllimport void @"\01?friend1@@YAXXZ"()
-// GNU-DAG: declare dllimport void @_Z7friend1v()
-// MSC-DAG: declare           void @"\01?friend2@@YAXXZ"()
-// GNU-DAG: declare           void @_Z7friend2v()
-// MSC-DAG: define  dllexport void @"\01?friend3@@YAXXZ"()
-// GNU-DAG: define            void @_Z7friend3v()
-// MSC-DAG: declare           void @"\01?friend4@@YAXXZ"()
-// GNU-DAG: declare           void @_Z7friend4v()
-// MSC-DAG: declare dllimport void @"\01?friend5@@YAXXZ"()
-// GNU-DAG: declare dllimport void @_Z7friend5v()
+// MSC-DAG: declare           dllimport void @"\01?friend1@@YAXXZ"()
+// GNU-DAG: declare           dllimport void @_Z7friend1v()
+// MSC-DAG: declare dso_local           void @"\01?friend2@@YAXXZ"()
+// GNU-DAG: declare dso_local           void @_Z7friend2v()
+// MSC-DAG: define  dso_local dllexport void @"\01?friend3@@YAXXZ"()
+// GNU-DAG: define  dso_local           void @_Z7friend3v()
+// MSC-DAG: declare dso_local           void @"\01?friend4@@YAXXZ"()
+// GNU-DAG: declare dso_local           void @_Z7friend4v()
+// MSC-DAG: declare           dllimport void @"\01?friend5@@YAXXZ"()
+// GNU-DAG: declare           dllimport void @_Z7friend5v()
 
 struct FuncFriend {
   friend __declspec(dllimport) void friend1();
@@ -399,31 +399,31 @@ USE(funcTmplDecl<ImplicitInst_Imported>)
 
 // Import inline function template.
 // MSC-DAG: declare dllimport void @"\01??$inlineFuncTmpl1 at UImplicitInst_Imported@@@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z15inlineFuncTmpl1I21ImplicitInst_ImportedEvv()
+// GNU-DAG: define linkonce_odr dso_local void @_Z15inlineFuncTmpl1I21ImplicitInst_ImportedEvv()
 // MO1-DAG: define available_externally dllimport void @"\01??$inlineFuncTmpl1 at UImplicitInst_Imported@@@@YAXXZ"()
-// GO1-DAG: define linkonce_odr void @_Z15inlineFuncTmpl1I21ImplicitInst_ImportedEvv()
+// GO1-DAG: define linkonce_odr dso_local void @_Z15inlineFuncTmpl1I21ImplicitInst_ImportedEvv()
 template<typename T> __declspec(dllimport) inline void inlineFuncTmpl1() {}
 USE(inlineFuncTmpl1<ImplicitInst_Imported>)
 
 // MSC-DAG: declare dllimport void @"\01??$inlineFuncTmpl2 at UImplicitInst_Imported@@@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z15inlineFuncTmpl2I21ImplicitInst_ImportedEvv()
+// GNU-DAG: define linkonce_odr dso_local void @_Z15inlineFuncTmpl2I21ImplicitInst_ImportedEvv()
 // MO1-DAG: define available_externally dllimport void @"\01??$inlineFuncTmpl2 at UImplicitInst_Imported@@@@YAXXZ"()
-// GO1-DAG: define linkonce_odr void @_Z15inlineFuncTmpl2I21ImplicitInst_ImportedEvv()
+// GO1-DAG: define linkonce_odr dso_local void @_Z15inlineFuncTmpl2I21ImplicitInst_ImportedEvv()
 template<typename T> inline void __attribute__((dllimport)) inlineFuncTmpl2() {}
 USE(inlineFuncTmpl2<ImplicitInst_Imported>)
 
-// MSC-DAG: define linkonce_odr void @"\01??$inlineFuncTmplDecl at UImplicitInst_Imported@@@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z18inlineFuncTmplDeclI21ImplicitInst_ImportedEvv()
-// MO1-DAG: define linkonce_odr void @"\01??$inlineFuncTmplDecl at UImplicitInst_Imported@@@@YAXXZ"()
-// GO1-DAG: define linkonce_odr void @_Z18inlineFuncTmplDeclI21ImplicitInst_ImportedEvv()
+// MSC-DAG: define linkonce_odr dso_local void @"\01??$inlineFuncTmplDecl at UImplicitInst_Imported@@@@YAXXZ"()
+// GNU-DAG: define linkonce_odr dso_local void @_Z18inlineFuncTmplDeclI21ImplicitInst_ImportedEvv()
+// MO1-DAG: define linkonce_odr dso_local void @"\01??$inlineFuncTmplDecl at UImplicitInst_Imported@@@@YAXXZ"()
+// GO1-DAG: define linkonce_odr dso_local void @_Z18inlineFuncTmplDeclI21ImplicitInst_ImportedEvv()
 template<typename T> __declspec(dllimport) inline void inlineFuncTmplDecl();
 template<typename T>                              void inlineFuncTmplDecl() {}
 USE(inlineFuncTmplDecl<ImplicitInst_Imported>)
 
-// MSC-DAG: define linkonce_odr void @"\01??$inlineFuncTmplDef at UImplicitInst_Imported@@@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z17inlineFuncTmplDefI21ImplicitInst_ImportedEvv()
-// MO1-DAG: define linkonce_odr void @"\01??$inlineFuncTmplDef at UImplicitInst_Imported@@@@YAXXZ"()
-// GO1-DAG: define linkonce_odr void @_Z17inlineFuncTmplDefI21ImplicitInst_ImportedEvv()
+// MSC-DAG: define linkonce_odr dso_local void @"\01??$inlineFuncTmplDef at UImplicitInst_Imported@@@@YAXXZ"()
+// GNU-DAG: define linkonce_odr dso_local void @_Z17inlineFuncTmplDefI21ImplicitInst_ImportedEvv()
+// MO1-DAG: define linkonce_odr dso_local void @"\01??$inlineFuncTmplDef at UImplicitInst_Imported@@@@YAXXZ"()
+// GO1-DAG: define linkonce_odr dso_local void @_Z17inlineFuncTmplDefI21ImplicitInst_ImportedEvv()
 template<typename T> __declspec(dllimport) void inlineFuncTmplDef();
 template<typename T>                inline void inlineFuncTmplDef() {}
 USE(inlineFuncTmplDef<ImplicitInst_Imported>)
@@ -436,14 +436,14 @@ template<typename T> __declspec(dllimpor
 template<typename T> __declspec(dllimport) void funcTmplRedecl1();
 USE(funcTmplRedecl1<ImplicitInst_Imported>)
 
-// MSC-DAG: declare void @"\01??$funcTmplRedecl2 at UImplicitInst_NotImported@@@@YAXXZ"()
-// GNU-DAG: declare void @_Z15funcTmplRedecl2I24ImplicitInst_NotImportedEvv()
+// MSC-DAG: declare dso_local void @"\01??$funcTmplRedecl2 at UImplicitInst_NotImported@@@@YAXXZ"()
+// GNU-DAG: declare dso_local void @_Z15funcTmplRedecl2I24ImplicitInst_NotImportedEvv()
 template<typename T> __declspec(dllimport) void funcTmplRedecl2();
 template<typename T>                       void funcTmplRedecl2(); // dllimport ignored
 USE(funcTmplRedecl2<ImplicitInst_NotImported>)
 
-// MSC-DAG: define linkonce_odr void @"\01??$funcTmplRedecl3 at UImplicitInst_NotImported@@@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z15funcTmplRedecl3I24ImplicitInst_NotImportedEvv()
+// MSC-DAG: define linkonce_odr dso_local void @"\01??$funcTmplRedecl3 at UImplicitInst_NotImported@@@@YAXXZ"()
+// GNU-DAG: define linkonce_odr dso_local void @_Z15funcTmplRedecl3I24ImplicitInst_NotImportedEvv()
 template<typename T> __declspec(dllimport) void funcTmplRedecl3();
 template<typename T>                       void funcTmplRedecl3() {} // dllimport ignored
 USE(funcTmplRedecl3<ImplicitInst_NotImported>)
@@ -452,12 +452,12 @@ USE(funcTmplRedecl3<ImplicitInst_NotImpo
 // Function template friends
 // MSC-DAG: declare dllimport   void @"\01??$funcTmplFriend1 at UImplicitInst_Imported@@@@YAXXZ"()
 // GNU-DAG: declare dllimport   void @_Z15funcTmplFriend1I21ImplicitInst_ImportedEvv()
-// MSC-DAG: declare             void @"\01??$funcTmplFriend2 at UImplicitInst_NotImported@@@@YAXXZ"()
-// GNU-DAG: declare             void @_Z15funcTmplFriend2I24ImplicitInst_NotImportedEvv()
-// MSC-DAG: define linkonce_odr void @"\01??$funcTmplFriend3 at UImplicitInst_NotImported@@@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z15funcTmplFriend3I24ImplicitInst_NotImportedEvv()
-// MSC-DAG: define linkonce_odr void @"\01??$funcTmplFriend4 at UImplicitInst_Imported@@@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z15funcTmplFriend4I21ImplicitInst_ImportedEvv()
+// MSC-DAG: declare             dso_local void @"\01??$funcTmplFriend2 at UImplicitInst_NotImported@@@@YAXXZ"()
+// GNU-DAG: declare             dso_local void @_Z15funcTmplFriend2I24ImplicitInst_NotImportedEvv()
+// MSC-DAG: define linkonce_odr dso_local void @"\01??$funcTmplFriend3 at UImplicitInst_NotImported@@@@YAXXZ"()
+// GNU-DAG: define linkonce_odr dso_local void @_Z15funcTmplFriend3I24ImplicitInst_NotImportedEvv()
+// MSC-DAG: define linkonce_odr dso_local void @"\01??$funcTmplFriend4 at UImplicitInst_Imported@@@@YAXXZ"()
+// GNU-DAG: define linkonce_odr dso_local void @_Z15funcTmplFriend4I21ImplicitInst_ImportedEvv()
 struct FuncTmplFriend {
   template<typename T> friend __declspec(dllimport) void funcTmplFriend1();
   template<typename T> friend __declspec(dllimport) void funcTmplFriend2();
@@ -490,24 +490,24 @@ template<typename T> __declspec(dllimpor
 USE(importedFuncTmplDecl<ImplicitInst_Imported>)
 
 // MSC-DAG: declare dllimport void @"\01??$importedFuncTmpl at UImplicitInst_Imported@@@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z16importedFuncTmplI21ImplicitInst_ImportedEvv()
+// GNU-DAG: define linkonce_odr dso_local void @_Z16importedFuncTmplI21ImplicitInst_ImportedEvv()
 // MO1-DAG: define available_externally dllimport void @"\01??$importedFuncTmpl at UImplicitInst_Imported@@@@YAXXZ"()
-// GO1-DAG: define linkonce_odr void @_Z16importedFuncTmplI21ImplicitInst_ImportedEvv()
+// GO1-DAG: define linkonce_odr dso_local void @_Z16importedFuncTmplI21ImplicitInst_ImportedEvv()
 USE(importedFuncTmpl<ImplicitInst_Imported>)
 
 // Import explicit instantiation declaration of an imported function template.
 // MSC-DAG: declare dllimport void @"\01??$importedFuncTmpl at UExplicitDecl_Imported@@@@YAXXZ"()
-// GNU-DAG: declare void @_Z16importedFuncTmplI21ExplicitDecl_ImportedEvv()
+// GNU-DAG: declare dso_local void @_Z16importedFuncTmplI21ExplicitDecl_ImportedEvv()
 // MO1-DAG: define available_externally dllimport void @"\01??$importedFuncTmpl at UExplicitDecl_Imported@@@@YAXXZ"()
-// GO1-DAG: define available_externally void @_Z16importedFuncTmplI21ExplicitDecl_ImportedEvv()
+// GO1-DAG: define available_externally dso_local void @_Z16importedFuncTmplI21ExplicitDecl_ImportedEvv()
 extern template void importedFuncTmpl<ExplicitDecl_Imported>();
 USE(importedFuncTmpl<ExplicitDecl_Imported>)
 
 // Import explicit instantiation definition of an imported function template.
 // MSC-DAG: declare dllimport void @"\01??$importedFuncTmpl at UExplicitInst_Imported@@@@YAXXZ"()
-// GNU-DAG: define weak_odr void @_Z16importedFuncTmplI21ExplicitInst_ImportedEvv()
+// GNU-DAG: define weak_odr dso_local void @_Z16importedFuncTmplI21ExplicitInst_ImportedEvv()
 // MO1-DAG: define available_externally dllimport void @"\01??$importedFuncTmpl at UExplicitInst_Imported@@@@YAXXZ"()
-// GO1-DAG: define weak_odr void @_Z16importedFuncTmplI21ExplicitInst_ImportedEvv()
+// GO1-DAG: define weak_odr dso_local void @_Z16importedFuncTmplI21ExplicitInst_ImportedEvv()
 template void importedFuncTmpl<ExplicitInst_Imported>();
 USE(importedFuncTmpl<ExplicitInst_Imported>)
 
@@ -526,9 +526,9 @@ USE(importedFuncTmplDecl<ExplicitSpec_Im
 #endif
 
 // MSC-DAG: declare dllimport void @"\01??$importedFuncTmplDecl at UExplicitSpec_InlineDef_Imported@@@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z20importedFuncTmplDeclI31ExplicitSpec_InlineDef_ImportedEvv()
+// GNU-DAG: define linkonce_odr dso_local void @_Z20importedFuncTmplDeclI31ExplicitSpec_InlineDef_ImportedEvv()
 // MO1-DAG: define available_externally dllimport void @"\01??$importedFuncTmplDecl at UExplicitSpec_InlineDef_Imported@@@@YAXXZ"()
-// GO1-DAG: define linkonce_odr void @_Z20importedFuncTmplDeclI31ExplicitSpec_InlineDef_ImportedEvv()
+// GO1-DAG: define linkonce_odr dso_local void @_Z20importedFuncTmplDeclI31ExplicitSpec_InlineDef_ImportedEvv()
 template<> __declspec(dllimport) inline void importedFuncTmplDecl<ExplicitSpec_InlineDef_Imported>() {}
 USE(importedFuncTmplDecl<ExplicitSpec_InlineDef_Imported>)
 
@@ -546,17 +546,17 @@ USE(importedFuncTmpl<ExplicitSpec_Import
 #endif
 
 // MSC-DAG: declare dllimport void @"\01??$importedFuncTmpl at UExplicitSpec_InlineDef_Imported@@@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z16importedFuncTmplI31ExplicitSpec_InlineDef_ImportedEvv()
+// GNU-DAG: define linkonce_odr dso_local void @_Z16importedFuncTmplI31ExplicitSpec_InlineDef_ImportedEvv()
 // MO1-DAG: define available_externally dllimport void @"\01??$importedFuncTmpl at UExplicitSpec_InlineDef_Imported@@@@YAXXZ"()
-// GO1-DAG: define linkonce_odr void @_Z16importedFuncTmplI31ExplicitSpec_InlineDef_ImportedEvv()
+// GO1-DAG: define linkonce_odr dso_local void @_Z16importedFuncTmplI31ExplicitSpec_InlineDef_ImportedEvv()
 template<> __declspec(dllimport) inline void importedFuncTmpl<ExplicitSpec_InlineDef_Imported>() {}
 USE(importedFuncTmpl<ExplicitSpec_InlineDef_Imported>)
 
 
 // Not importing specialization of an imported function template without
 // explicit dllimport.
-// MSC-DAG: define void @"\01??$importedFuncTmpl at UExplicitSpec_NotImported@@@@YAXXZ"()
-// GNU-DAG: define void @_Z16importedFuncTmplI24ExplicitSpec_NotImportedEvv()
+// MSC-DAG: define dso_local void @"\01??$importedFuncTmpl at UExplicitSpec_NotImported@@@@YAXXZ"()
+// GNU-DAG: define dso_local void @_Z16importedFuncTmplI24ExplicitSpec_NotImportedEvv()
 template<> void importedFuncTmpl<ExplicitSpec_NotImported>() {}
 USE(importedFuncTmpl<ExplicitSpec_NotImported>)
 
@@ -565,9 +565,9 @@ USE(importedFuncTmpl<ExplicitSpec_NotImp
 // MSC-DAG: declare dllimport void @"\01??$funcTmpl at UExplicitDecl_Imported@@@@YAXXZ"()
 // MSC-DAG: declare dllimport void @"\01??$inlineFuncTmpl at UExplicitDecl_Imported@@@@YAXXZ"()
 // GNU-DAG: declare dllimport void @_Z8funcTmplI21ExplicitDecl_ImportedEvv()
-// GNU-DAG: declare void @_Z14inlineFuncTmplI21ExplicitDecl_ImportedEvv()
+// GNU-DAG: declare dso_local void @_Z14inlineFuncTmplI21ExplicitDecl_ImportedEvv()
 // MO1-DAG: define available_externally dllimport void @"\01??$inlineFuncTmpl at UExplicitDecl_Imported@@@@YAXXZ"()
-// GO1-DAG: define available_externally void @_Z14inlineFuncTmplI21ExplicitDecl_ImportedEvv()
+// GO1-DAG: define available_externally dso_local void @_Z14inlineFuncTmplI21ExplicitDecl_ImportedEvv()
 extern template __declspec(dllimport) void funcTmpl<ExplicitDecl_Imported>();
 extern template __declspec(dllimport) void inlineFuncTmpl<ExplicitDecl_Imported>();
 USE(funcTmpl<ExplicitDecl_Imported>)
@@ -578,11 +578,11 @@ USE(inlineFuncTmpl<ExplicitDecl_Imported
 // MSC-DAG: declare dllimport void @"\01??$funcTmpl at UExplicitInst_Imported@@@@YAXXZ"()
 // MSC-DAG: declare dllimport void @"\01??$inlineFuncTmpl at UExplicitInst_Imported@@@@YAXXZ"()
 // GNU-DAG: declare dllimport void @_Z8funcTmplI21ExplicitInst_ImportedEvv()
-// GNU-DAG: define weak_odr void @_Z14inlineFuncTmplI21ExplicitInst_ImportedEvv()
+// GNU-DAG: define weak_odr dso_local void @_Z14inlineFuncTmplI21ExplicitInst_ImportedEvv()
 // MO1-DAG: declare dllimport void @"\01??$funcTmpl at UExplicitInst_Imported@@@@YAXXZ"()
 // MO1-DAG: define available_externally dllimport void @"\01??$inlineFuncTmpl at UExplicitInst_Imported@@@@YAXXZ"()
 // GO1-DAG: define available_externally dllimport void @_Z8funcTmplI21ExplicitInst_ImportedEvv()
-// GO1-DAG: define weak_odr void @_Z14inlineFuncTmplI21ExplicitInst_ImportedEvv()
+// GO1-DAG: define weak_odr dso_local void @_Z14inlineFuncTmplI21ExplicitInst_ImportedEvv()
 template __declspec(dllimport) void funcTmpl<ExplicitInst_Imported>();
 template __declspec(dllimport) void inlineFuncTmpl<ExplicitInst_Imported>();
 USE(funcTmpl<ExplicitInst_Imported>)
@@ -603,9 +603,9 @@ USE(funcTmpl<ExplicitSpec_Imported>)
 #endif
 
 // MSC-DAG: declare dllimport void @"\01??$funcTmpl at UExplicitSpec_InlineDef_Imported@@@@YAXXZ"()
-// GNU-DAG: define linkonce_odr void @_Z8funcTmplI31ExplicitSpec_InlineDef_ImportedEvv()
+// GNU-DAG: define linkonce_odr dso_local void @_Z8funcTmplI31ExplicitSpec_InlineDef_ImportedEvv()
 // MO1-DAG: define available_externally dllimport void @"\01??$funcTmpl at UExplicitSpec_InlineDef_Imported@@@@YAXXZ"()
-// GO1-DAG: define linkonce_odr void @_Z8funcTmplI31ExplicitSpec_InlineDef_ImportedEvv()
+// GO1-DAG: define linkonce_odr dso_local void @_Z8funcTmplI31ExplicitSpec_InlineDef_ImportedEvv()
 template<> __declspec(dllimport) inline void funcTmpl<ExplicitSpec_InlineDef_Imported>() {}
 USE(funcTmpl<ExplicitSpec_InlineDef_Imported>)
 
@@ -640,7 +640,7 @@ struct __declspec(dllimport) T {
 
   T& operator=(T&&) = default;
   // Note: Don't mark inline move operators dllimport because current MSVC versions don't export them.
-  // M18-DAG: define linkonce_odr x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"\01??4T@@QAEAAU0@$$QAU0@@Z"
+  // M18-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"\01??4T@@QAEAAU0@$$QAU0@@Z"
   // M19-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"\01??4T@@QAEAAU0@$$QAU0@@Z"
 };
 USEMEMFUNC(T, a)
@@ -693,7 +693,7 @@ namespace DontUseDtorAlias {
 
 namespace Vtordisp {
   // Don't dllimport the vtordisp.
-  // MO1-DAG: define linkonce_odr x86_thiscallcc void @"\01?f@?$C at H@Vtordisp@@$4PPPPPPPM at A@AEXXZ"
+  // MO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @"\01?f@?$C at H@Vtordisp@@$4PPPPPPPM at A@AEXXZ"
 
   class __declspec(dllimport) Base {
     virtual void f() {}
@@ -800,7 +800,7 @@ namespace PR27319 {
 template <typename T> struct PartiallySpecializedClassTemplate {};
 template <typename T> struct __declspec(dllimport) PartiallySpecializedClassTemplate<T*> { void f(); };
 USEMEMFUNC(PartiallySpecializedClassTemplate<void*>, f);
-// M32-DAG: declare x86_thiscallcc void @"\01?f@?$PartiallySpecializedClassTemplate at PAX@@QAEXXZ"
+// M32-DAG: declare dso_local x86_thiscallcc void @"\01?f@?$PartiallySpecializedClassTemplate at PAX@@QAEXXZ"
 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN33PartiallySpecializedClassTemplateIPvE1fEv
 
 // Attributes on explicit specializations are honored.
@@ -815,7 +815,7 @@ template <typename T> struct __declspec(
 template <typename T> struct PartiallySpecializedImportedClassTemplate<T*> { void f() {} };
 USEMEMFUNC(PartiallySpecializedImportedClassTemplate<void*>, f);
 // M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?f@?$PartiallySpecializedImportedClassTemplate at PAX@@QAEXXZ"
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN41PartiallySpecializedImportedClassTemplateIPvE1fEv
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN41PartiallySpecializedImportedClassTemplateIPvE1fEv
 
 // Attributes on the instantiation take precedence over attributes on the template.
 template <typename T> struct __declspec(dllexport) ExplicitlyInstantiatedWithDifferentAttr { void f() {} };
@@ -830,7 +830,7 @@ USECLASS(ExplicitInstantiationDeclImport
 USEMEMFUNC(ExplicitInstantiationDeclImportedDefTemplate<int>, f);
 // M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclImportedDefTemplate at H@@QAEXXZ"
 // M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc %struct.ExplicitInstantiationDeclImportedDefTemplate* @"\01??0?$ExplicitInstantiationDeclImportedDefTemplate at H@@QAE at XZ"
-// G32-DAG: define weak_odr x86_thiscallcc void @_ZN44ExplicitInstantiationDeclImportedDefTemplateIiE1fEv
+// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN44ExplicitInstantiationDeclImportedDefTemplateIiE1fEv
 
 template <typename T> struct __declspec(dllimport) ExplicitInstantiationDeclExportedDefImportedTemplate { void f() {} ExplicitInstantiationDeclExportedDefImportedTemplate() {} };
 extern template struct __declspec(dllimport) ExplicitInstantiationDeclExportedDefImportedTemplate <int>;
@@ -861,7 +861,7 @@ namespace PR27810 {
   // functions are emitted unless they are used.
 
   USEMEMFUNC(basic_ostream<char>::sentry, foo);
-  // M32-DAG: define linkonce_odr x86_thiscallcc void @"\01?foo at sentry@?$basic_ostream at D@PR27810@@QAEXXZ"
+  // M32-DAG: define linkonce_odr dso_local x86_thiscallcc void @"\01?foo at sentry@?$basic_ostream at D@PR27810@@QAEXXZ"
   // M32-NOT: ??0sentry@?$basic_ostream at D@PR27810@@QAE at XZ
 }
 
@@ -907,7 +907,7 @@ template struct __declspec(dllimport) Ex
 struct __declspec(dllimport) DerivedFromTemplate : public ClassTemplate<int> {};
 USEMEMFUNC(ClassTemplate<int>, func)
 // M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?func@?$ClassTemplate at H@@QAEXXZ"
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ClassTemplateIiE4funcEv
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ClassTemplateIiE4funcEv
 
 // ImportedTemplate is explicitly imported.
 struct __declspec(dllimport) DerivedFromImportedTemplate : public ImportedClassTemplate<int> {};
@@ -918,34 +918,34 @@ USEMEMFUNC(ImportedClassTemplate<int>, f
 // ExportedTemplate is explicitly exported.
 struct __declspec(dllimport) DerivedFromExportedTemplate : public ExportedClassTemplate<int> {};
 USEMEMFUNC(ExportedClassTemplate<int>, func)
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ExportedClassTemplate at H@@QAEXXZ"
-// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN21ExportedClassTemplateIiE4funcEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?func@?$ExportedClassTemplate at H@@QAEXXZ"
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN21ExportedClassTemplateIiE4funcEv
 
 // Base class already implicitly instantiated without attribute.
 struct DerivedFromTemplateD : public ClassTemplate<double> {};
 struct __declspec(dllimport) DerivedFromTemplateD2 : public ClassTemplate<double> {};
 USEMEMFUNC(ClassTemplate<double>, func)
 // M32-DAG: declare dllimport x86_thiscallcc void @"\01?func@?$ClassTemplate at N@@QAEXXZ"
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ClassTemplateIdE4funcEv
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ClassTemplateIdE4funcEv
 
 // MS: Base class already instantiated with dfferent attribute.
 struct __declspec(dllexport) DerivedFromTemplateB : public ClassTemplate<bool> {};
 struct __declspec(dllimport) DerivedFromTemplateB2 : public ClassTemplate<bool> {};
 USEMEMFUNC(ClassTemplate<bool>, func)
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ClassTemplate at _N@@QAEXXZ"
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN13ClassTemplateIbE4funcEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?func@?$ClassTemplate at _N@@QAEXXZ"
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ClassTemplateIbE4funcEv
 
 // Base class already specialized without dll attribute.
 struct __declspec(dllimport) DerivedFromExplicitlySpecializedTemplate : public ExplicitlySpecializedTemplate<int> {};
 USEMEMFUNC(ExplicitlySpecializedTemplate<int>, func)
-// M32-DAG: define linkonce_odr x86_thiscallcc void @"\01?func@?$ExplicitlySpecializedTemplate at H@@QAEXXZ"
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN29ExplicitlySpecializedTemplateIiE4funcEv
+// M32-DAG: define linkonce_odr dso_local x86_thiscallcc void @"\01?func@?$ExplicitlySpecializedTemplate at H@@QAEXXZ"
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN29ExplicitlySpecializedTemplateIiE4funcEv
 
 // Base class alredy specialized with export attribute.
 struct __declspec(dllimport) DerivedFromExplicitlyExportSpecializedTemplate : public ExplicitlyExportSpecializedTemplate<int> {};
 USEMEMFUNC(ExplicitlyExportSpecializedTemplate<int>, func)
-// M32-DAG: define dllexport x86_thiscallcc void @"\01?func@?$ExplicitlyExportSpecializedTemplate at H@@QAEXXZ"
-// G32-DAG: define dllexport x86_thiscallcc void @_ZN35ExplicitlyExportSpecializedTemplateIiE4funcEv
+// M32-DAG: define dso_local dllexport x86_thiscallcc void @"\01?func@?$ExplicitlyExportSpecializedTemplate at H@@QAEXXZ"
+// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN35ExplicitlyExportSpecializedTemplateIiE4funcEv
 
 // Base class already specialized with import attribute.
 struct __declspec(dllimport) DerivedFromExplicitlyImportSpecializedTemplate : public ExplicitlyImportSpecializedTemplate<int> {};
@@ -956,14 +956,14 @@ USEMEMFUNC(ExplicitlyImportSpecializedTe
 // Base class already instantiated without dll attribute.
 struct __declspec(dllimport) DerivedFromExplicitlyInstantiatedTemplate : public ExplicitlyInstantiatedTemplate<int> {};
 USEMEMFUNC(ExplicitlyInstantiatedTemplate<int>, func)
-// M32-DAG: define weak_odr x86_thiscallcc void @"\01?func@?$ExplicitlyInstantiatedTemplate at H@@QAEXXZ"
-// G32-DAG: define weak_odr x86_thiscallcc void @_ZN30ExplicitlyInstantiatedTemplateIiE4funcEv
+// M32-DAG: define weak_odr dso_local x86_thiscallcc void @"\01?func@?$ExplicitlyInstantiatedTemplate at H@@QAEXXZ"
+// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN30ExplicitlyInstantiatedTemplateIiE4funcEv
 
 // Base class already instantiated with export attribute.
 struct __declspec(dllimport) DerivedFromExplicitlyExportInstantiatedTemplate : public ExplicitlyExportInstantiatedTemplate<int> {};
 USEMEMFUNC(ExplicitlyExportInstantiatedTemplate<int>, func)
-// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ExplicitlyExportInstantiatedTemplate at H@@QAEXXZ"
-// G32-DAG: define weak_odr dllexport x86_thiscallcc void @_ZN36ExplicitlyExportInstantiatedTemplateIiE4funcEv
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @"\01?func@?$ExplicitlyExportInstantiatedTemplate at H@@QAEXXZ"
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN36ExplicitlyExportInstantiatedTemplateIiE4funcEv
 
 // Base class already instantiated with import attribute.
 struct __declspec(dllimport) DerivedFromExplicitlyImportInstantiatedTemplate : public ExplicitlyImportInstantiatedTemplate<int> {};
@@ -977,7 +977,7 @@ template <typename T> struct MiddleClass
 struct __declspec(dllimport) BottomClass : public MiddleClass<int> { };
 USEMEMFUNC(TopClass<int>, func)
 // M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?func@?$TopClass at H@@QAEXXZ"
-// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN8TopClassIiE4funcEv
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN8TopClassIiE4funcEv
 
 template <typename T> struct ExplicitInstantiationDeclTemplateBase { void func() {} };
 extern template struct ExplicitInstantiationDeclTemplateBase<int>;
@@ -985,7 +985,7 @@ struct __declspec(dllimport) DerivedFrom
 template struct ExplicitInstantiationDeclTemplateBase<int>;
 USEMEMFUNC(ExplicitInstantiationDeclTemplateBase<int>, func)
 // M32-DAG: declare dllimport x86_thiscallcc void @"\01?func@?$ExplicitInstantiationDeclTemplateBase at H@@QAEXXZ"
-// G32-DAG: define weak_odr x86_thiscallcc void @_ZN37ExplicitInstantiationDeclTemplateBaseIiE4funcEv
+// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN37ExplicitInstantiationDeclTemplateBaseIiE4funcEv
 
 template <typename T> struct ExplicitInstantiationDeclTemplateBase2 { void func() {} };
 extern template struct ExplicitInstantiationDeclTemplateBase2<int>;
@@ -993,4 +993,4 @@ struct __declspec(dllimport) DerivedFrom
 template struct __declspec(dllexport) ExplicitInstantiationDeclTemplateBase2<int>;
 USEMEMFUNC(ExplicitInstantiationDeclTemplateBase2<int>, func)
 // M32-DAG: declare dllimport x86_thiscallcc void @"\01?func@?$ExplicitInstantiationDeclTemplateBase2 at H@@QAEXXZ"
-// G32-DAG: define weak_odr x86_thiscallcc void @_ZN38ExplicitInstantiationDeclTemplateBase2IiE4funcEv
+// G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN38ExplicitInstantiationDeclTemplateBase2IiE4funcEv

Modified: cfe/trunk/test/CodeGenCXX/duplicate-mangled-name.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/duplicate-mangled-name.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/duplicate-mangled-name.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/duplicate-mangled-name.cpp Fri Feb 23 11:30:48 2018
@@ -34,7 +34,7 @@ extern "C" {
 namespace nm {
   float abc = 2;
 }
-// CHECK: @_ZN2nm3abcE = global float
+// CHECK: @_ZN2nm3abcE = {{(dso_local )?}}global float
 
 float foo() {
   _ZN1TD1Ev();

Modified: cfe/trunk/test/CodeGenCXX/exceptions-cxx-ehsc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/exceptions-cxx-ehsc.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/exceptions-cxx-ehsc.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/exceptions-cxx-ehsc.cpp Fri Feb 23 11:30:48 2018
@@ -11,7 +11,7 @@ void caller() {
   may_throw();
 }
 }
-// CHECK-LABEL: define void @"\01?caller at test1@@YAXXZ"(
+// CHECK-LABEL: define dso_local void @"\01?caller at test1@@YAXXZ"(
 // CHECK: call void @never_throws(
 // CHECK: invoke void @"\01?may_throw at test1@@YAXXZ"(
 
@@ -26,6 +26,6 @@ void caller() {
   may_throw();
 }
 }
-// CHECK-LABEL: define void @"\01?caller at test2@@YAXXZ"(
+// CHECK-LABEL: define dso_local void @"\01?caller at test2@@YAXXZ"(
 // CHECK: invoke void @throws_int(
 // CHECK: invoke void @"\01?may_throw at test2@@YAXXZ"(

Modified: cfe/trunk/test/CodeGenCXX/exceptions-cxx-new.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/exceptions-cxx-new.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/exceptions-cxx-new.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/exceptions-cxx-new.cpp Fri Feb 23 11:30:48 2018
@@ -12,7 +12,7 @@ void test_catch() {
   }
 }
 
-// CHECK-LABEL: define void @"\01?test_catch@@YAXXZ"(
+// CHECK-LABEL: define dso_local void @"\01?test_catch@@YAXXZ"(
 // CHECK:   invoke i32 @"\01?f@@YAHH at Z"(i32 1)
 // CHECK:         to label %[[NORMAL:.*]] unwind label %[[CATCHSWITCH:.*]]
 
@@ -50,7 +50,7 @@ void test_cleanup() {
   f(1);
 }
 
-// CHECK-LABEL: define {{.*}} @"\01?test_cleanup@@YAXXZ"(
+// CHECK-LABEL: define dso_local {{.*}} @"\01?test_cleanup@@YAXXZ"(
 // CHECK:   invoke i32 @"\01?f@@YAHH at Z"(i32 1)
 // CHECK:           to label %[[LEAVE_FUNC:.*]] unwind label %[[CLEANUP:.*]]
 

Modified: cfe/trunk/test/CodeGenCXX/exceptions-seh-filter-captures.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/exceptions-seh-filter-captures.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/exceptions-seh-filter-captures.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/exceptions-seh-filter-captures.cpp Fri Feb 23 11:30:48 2018
@@ -14,7 +14,7 @@ extern "C" void test_freefunc(int p1) {
   }
 }
 
-// CHECK-LABEL: define void @test_freefunc(i32 %p1)
+// CHECK-LABEL: define dso_local void @test_freefunc(i32 %p1)
 // CHECK: @llvm.localescape(i32* %[[p1_ptr:[^, ]*]], i32* %[[l1_ptr:[^, ]*]])
 // CHECK: store i32 %p1, i32* %[[p1_ptr]], align 4
 // CHECK: store i32 13, i32* %[[l1_ptr]], align 4
@@ -45,7 +45,7 @@ void S::test_method() {
   }
 }
 
-// CHECK-LABEL: define void @"\01?test_method at S@@QEAAXXZ"(%struct.S* %this)
+// CHECK-LABEL: define dso_local void @"\01?test_method at S@@QEAAXXZ"(%struct.S* %this)
 // CHECK: @llvm.localescape(i32* %[[l1_addr:[^, ]*]])
 // CHECK: store i32 13, i32* %[[l1_addr]], align 4
 // CHECK: invoke void @might_crash()

Modified: cfe/trunk/test/CodeGenCXX/exceptions-seh.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/exceptions-seh.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/exceptions-seh.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/exceptions-seh.cpp Fri Feb 23 11:30:48 2018
@@ -21,7 +21,7 @@ extern "C" void use_cxx() {
 
 // Make sure we use __CxxFrameHandler3 for C++ EH.
 
-// CXXEH-LABEL: define void @use_cxx()
+// CXXEH-LABEL: define dso_local void @use_cxx()
 // CXXEH-SAME:  personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
 // CXXEH: call %struct.HasCleanup* @"\01??0HasCleanup@@QEAA at XZ"(%struct.HasCleanup* %{{.*}})
 // CXXEH: invoke void @might_throw()
@@ -36,7 +36,7 @@ extern "C" void use_cxx() {
 // CXXEH: call void @"\01??1HasCleanup@@QEAA at XZ"(%struct.HasCleanup* %{{.*}})
 // CXXEH: cleanupret
 
-// NOCXX-LABEL: define void @use_cxx()
+// NOCXX-LABEL: define dso_local void @use_cxx()
 // NOCXX-NOT: invoke
 // NOCXX: call %struct.HasCleanup* @"\01??0HasCleanup@@QEAA at XZ"(%struct.HasCleanup* %{{.*}})
 // NOCXX-NOT: invoke
@@ -55,7 +55,7 @@ extern "C" void use_seh() {
 
 // Make sure we use __C_specific_handler for SEH.
 
-// CHECK-LABEL: define void @use_seh()
+// CHECK-LABEL: define dso_local void @use_seh()
 // CHECK-SAME:  personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
 // CHECK: invoke void @might_throw() #[[NOINLINE:[0-9]+]]
 // CHECK:       to label %[[cont:[^ ]*]] unwind label %[[lpad:[^ ]*]]
@@ -87,7 +87,7 @@ extern "C" void nested_finally() {
   }
 }
 
-// CHECK-LABEL: define void @nested_finally() #{{[0-9]+}}
+// CHECK-LABEL: define dso_local void @nested_finally() #{{[0-9]+}}
 // CHECK-SAME:  personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
 // CHECK: invoke void @might_throw()
 // CHECK: call void @"\01?fin$0 at 0@nested_finally@@"(i8 1, i8* {{.*}})
@@ -108,11 +108,11 @@ void use_seh_in_lambda() {
   might_throw();
 }
 
-// CXXEH-LABEL: define void @"\01?use_seh_in_lambda@@YAXXZ"()
+// CXXEH-LABEL: define dso_local void @"\01?use_seh_in_lambda@@YAXXZ"()
 // CXXEH-SAME:  personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
 // CXXEH: cleanuppad
 
-// NOCXX-LABEL: define void @"\01?use_seh_in_lambda@@YAXXZ"()
+// NOCXX-LABEL: define dso_local void @"\01?use_seh_in_lambda@@YAXXZ"()
 // NOCXX-NOT: invoke
 // NOCXX: ret void
 
@@ -139,7 +139,7 @@ void use_inline() {
   use_seh_in_inline_func();
 }
 
-// CHECK-LABEL: define linkonce_odr void @use_seh_in_inline_func() #{{[0-9]+}}
+// CHECK-LABEL: define linkonce_odr dso_local void @use_seh_in_inline_func() #{{[0-9]+}}
 // CHECK-SAME:  personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
 // CHECK: invoke void @might_throw()
 //

Modified: cfe/trunk/test/CodeGenCXX/explicit-instantiation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/explicit-instantiation.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/explicit-instantiation.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/explicit-instantiation.cpp Fri Feb 23 11:30:48 2018
@@ -119,14 +119,14 @@ namespace NestedClasses {
   // definition of Inner.
   template struct Outer<int>;
   // CHECK: define weak_odr void @_ZN13NestedClasses5OuterIiE5Inner1fEv
-  // CHECK-MS: define weak_odr x86_thiscallcc void @"\01?f at Inner@?$Outer at H@NestedClasses@@QAEXXZ"
+  // CHECK-MS: define weak_odr dso_local x86_thiscallcc void @"\01?f at Inner@?$Outer at H@NestedClasses@@QAEXXZ"
 
   // Explicit instantiation declaration of Outer causes explicit instantiation
   // declaration of Inner, but not in MSVC mode.
   extern template struct Outer<char>;
   auto use = &Outer<char>::Inner::f;
   // CHECK: {{declare|define available_externally}} void @_ZN13NestedClasses5OuterIcE5Inner1fEv
-  // CHECK-MS: define linkonce_odr x86_thiscallcc void @"\01?f at Inner@?$Outer at D@NestedClasses@@QAEXXZ"
+  // CHECK-MS: define linkonce_odr dso_local x86_thiscallcc void @"\01?f at Inner@?$Outer at D@NestedClasses@@QAEXXZ"
 }
 
 // Check that we emit definitions from explicit instantiations even when they

Modified: cfe/trunk/test/CodeGenCXX/extern-c.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/extern-c.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/extern-c.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/extern-c.cpp Fri Feb 23 11:30:48 2018
@@ -7,7 +7,7 @@ extern "C" int a;
 // CHECK-NOT: @_ZN3foo1bE = global
 extern int b;
 
-// CHECK: @_ZN3foo1cE = global
+// CHECK: @_ZN3foo1cE = {{(dso_local )?}}global
 int c = 5;
 
 // CHECK-NOT: @_ZN3foo1dE
@@ -16,21 +16,21 @@ extern "C" struct d;
 // CHECK-NOT: should_not_appear
 extern "C++" int should_not_appear;
 
-// CHECK: @_ZN3foo10extern_cxxE = global
+// CHECK: @_ZN3foo10extern_cxxE = {{(dso_local )?}}global
 extern "C++" int extern_cxx = 0;
 
 }
 
-// CHECK-NOT: @global_a = global
+// CHECK-NOT: @global_a = {{(dso_local )?}}global
 extern "C" int global_a;
 
-// CHECK: @global_b = global
+// CHECK: @global_b = {{(dso_local )?}}global
 extern "C" int global_b = 0;
 
 // CHECK-NOT: should_not_appear
 extern "C++" int should_not_appear;
 
-// CHECK: @extern_cxx = global
+// CHECK: @extern_cxx = {{(dso_local )?}}global
 extern "C++" int extern_cxx = 0;
 
 namespace test1 {
@@ -38,11 +38,11 @@ namespace test1 {
     struct X {};
   }
   extern "C" {
-    // CHECK: @test1_b = global
+    // CHECK: @test1_b = {{(dso_local )?}}global
     X test1_b = X();
   }
   void *use = &test1_b;
-  // CHECK: @_ZN5test13useE = global
+  // CHECK: @_ZN5test13useE = {{(dso_local )?}}global
 }
 
 namespace test2 {
@@ -50,7 +50,7 @@ namespace test2 {
     struct X {};
   }
 
-  // CHECK: @test2_b = global
+  // CHECK: @test2_b = {{(dso_local )?}}global
   extern "C" X test2_b;
   X test2_b;
 }

Modified: cfe/trunk/test/CodeGenCXX/global-llvm-constant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/global-llvm-constant.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/global-llvm-constant.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/global-llvm-constant.cpp Fri Feb 23 11:30:48 2018
@@ -15,7 +15,7 @@ struct X {
 
 int add(int x, int y) { return x + y; }
 
-// CHECK: @x2 = constant
+// CHECK: @x2 = {{(dso_local )?}}constant
 extern const X x2;
 const X x2 = { &add };
 
@@ -27,6 +27,6 @@ struct X2 {
   X1 array[3];
 };
 
-// CHECK: @x2b = global
+// CHECK: @x2b = {{(dso_local )?}}global
 extern const X2 x2b;
 const X2 x2b = { { { 1 }, { 2 }, { 3 } } };

Modified: cfe/trunk/test/CodeGenCXX/homogeneous-aggregates.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/homogeneous-aggregates.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/homogeneous-aggregates.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/homogeneous-aggregates.cpp Fri Feb 23 11:30:48 2018
@@ -41,13 +41,13 @@ struct D5 : I1, I2, I3 {}; // homogeneou
 // PPC: define void @_Z7func_D12D1(%struct.D1* noalias sret %agg.result, [3 x i64] %x.coerce)
 // ARM32: define arm_aapcs_vfpcc void @_Z7func_D12D1(%struct.D1* noalias sret %agg.result, [3 x i64] %x.coerce)
 // ARM64: define void @_Z7func_D12D1(%struct.D1* noalias sret %agg.result, %struct.D1* %x)
-// X64: define x86_vectorcallcc void @"\01_Z7func_D12D1@@24"(%struct.D1* noalias sret %agg.result, %struct.D1* %x)
+// X64: define dso_local x86_vectorcallcc void @"\01_Z7func_D12D1@@24"(%struct.D1* noalias sret %agg.result, %struct.D1* %x)
 D1 CC func_D1(D1 x) { return x; }
 
 // PPC: define [3 x double] @_Z7func_D22D2([3 x double] %x.coerce)
 // ARM32: define arm_aapcs_vfpcc %struct.D2 @_Z7func_D22D2(%struct.D2 %x.coerce)
 // ARM64: define %struct.D2 @_Z7func_D22D2([3 x double] %x.coerce)
-// X64: define x86_vectorcallcc %struct.D2 @"\01_Z7func_D22D2@@24"(%struct.D2 inreg %x.coerce)
+// X64: define dso_local x86_vectorcallcc %struct.D2 @"\01_Z7func_D22D2@@24"(%struct.D2 inreg %x.coerce)
 D2 CC func_D2(D2 x) { return x; }
 
 // PPC: define void @_Z7func_D32D3(%struct.D3* noalias sret %agg.result, [4 x i64] %x.coerce)
@@ -92,7 +92,7 @@ struct HVAWithEmptyBase : Float1, Empty,
 void CC with_empty_base(HVAWithEmptyBase a) {}
 
 // FIXME: MSVC doesn't consider this an HVA because of the empty base.
-// X64: define x86_vectorcallcc void @"\01_Z15with_empty_base16HVAWithEmptyBase@@16"(%struct.HVAWithEmptyBase inreg %a.coerce)
+// X64: define dso_local x86_vectorcallcc void @"\01_Z15with_empty_base16HVAWithEmptyBase@@16"(%struct.HVAWithEmptyBase inreg %a.coerce)
 
 struct HVAWithEmptyBitField : Float1, Float2 {
   int : 0; // Takes no space.
@@ -102,5 +102,5 @@ struct HVAWithEmptyBitField : Float1, Fl
 // PPC: define void @_Z19with_empty_bitfield20HVAWithEmptyBitField([3 x float] %a.coerce)
 // ARM64: define void @_Z19with_empty_bitfield20HVAWithEmptyBitField([3 x float] %a.coerce)
 // ARM32: define arm_aapcs_vfpcc void @_Z19with_empty_bitfield20HVAWithEmptyBitField(%struct.HVAWithEmptyBitField %a.coerce)
-// X64: define x86_vectorcallcc void @"\01_Z19with_empty_bitfield20HVAWithEmptyBitField@@16"(%struct.HVAWithEmptyBitField inreg %a.coerce)
+// X64: define dso_local x86_vectorcallcc void @"\01_Z19with_empty_bitfield20HVAWithEmptyBitField@@16"(%struct.HVAWithEmptyBitField inreg %a.coerce)
 void CC with_empty_bitfield(HVAWithEmptyBitField a) {}

Modified: cfe/trunk/test/CodeGenCXX/initializer-list-ctor-order.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/initializer-list-ctor-order.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/initializer-list-ctor-order.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/initializer-list-ctor-order.cpp Fri Feb 23 11:30:48 2018
@@ -15,7 +15,7 @@ void foo() {
   A a{f(), g()};
 }
 // CHECK-ITANIUM-LABEL: define void @_Z3foov
-// CHECK-MS-LABEL: define void @"\01?foo@@YAXXZ"
+// CHECK-MS-LABEL: define dso_local void @"\01?foo@@YAXXZ"
 // CHECK: call i32 @f()
 // CHECK: call i32 @g()
 
@@ -24,6 +24,6 @@ struct B : A {
 };
 B::B() : A{f(), g()} {}
 // CHECK-ITANIUM-LABEL: define void @_ZN1BC2Ev
-// CHECK-MS-LABEL: define x86_thiscallcc %struct.B* @"\01??0B@@QAE at XZ"
+// CHECK-MS-LABEL: define dso_local x86_thiscallcc %struct.B* @"\01??0B@@QAE at XZ"
 // CHECK: call i32 @f()
 // CHECK: call i32 @g()

Modified: cfe/trunk/test/CodeGenCXX/inline-dllexport-member.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/inline-dllexport-member.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/inline-dllexport-member.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/inline-dllexport-member.cpp Fri Feb 23 11:30:48 2018
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple i686-windows-win32 -fms-extensions -debug-info-kind=limited -emit-llvm %s -o - \
 // RUN:    | FileCheck %s
 
-// CHECK: @"\01?ui at s@@2IB" = weak_odr dllexport constant i32 0, comdat, align 4, !dbg [[UI:![0-9]+]]
+// CHECK: @"\01?ui at s@@2IB" = weak_odr dso_local dllexport constant i32 0, comdat, align 4, !dbg [[UI:![0-9]+]]
 
 struct __declspec(dllexport) s {
   static const unsigned int ui = 0;

Modified: cfe/trunk/test/CodeGenCXX/inline-functions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/inline-functions.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/inline-functions.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/inline-functions.cpp Fri Feb 23 11:30:48 2018
@@ -23,14 +23,14 @@ void B<char>::f() { }
 // We need a final CHECK line here.
 
 // NORMAL-LABEL: define void @_Z1fv
-// MSVCCOMPAT-LABEL: define void @"\01?f@@YAXXZ"
+// MSVCCOMPAT-LABEL: define dso_local void @"\01?f@@YAXXZ"
 void f() { }
 
 // <rdar://problem/8740363>
 inline void f1(int);
 
 // NORMAL-LABEL: define linkonce_odr void @_Z2f1i
-// MSVCCOMPAT-LABEL: define linkonce_odr void @"\01?f1@@YAXH at Z"
+// MSVCCOMPAT-LABEL: define linkonce_odr dso_local void @"\01?f1@@YAXH at Z"
 void f1(int) { }
 
 void test_f1() { f1(17); }
@@ -44,7 +44,7 @@ namespace test1 {
   };
 
   // NORMAL-LABEL: define linkonce_odr void @_ZN5test11C4funcEv(
-  // MSVCCOMPAT-LABEL: define linkonce_odr void @"\01?func at C@test1@@QEAAXXZ"(
+  // MSVCCOMPAT-LABEL: define linkonce_odr dso_local void @"\01?func at C@test1@@QEAAXXZ"(
 
   class C {
   public:
@@ -72,36 +72,36 @@ namespace test2 {
     f(a);
   }
   // NORMAL-LABEL: define linkonce_odr void @_ZN5test21fERKNS_1AE
-  // MSVCCOMPAT-LABEL: define linkonce_odr void @"\01?f at test2@@YAXAEBUA at 1@@Z"
+  // MSVCCOMPAT-LABEL: define linkonce_odr dso_local void @"\01?f at test2@@YAXAEBUA at 1@@Z"
 }
 
 // NORMAL-NOT: _Z17ExternAndInlineFnv
-// MSVCCOMPAT-LABEL: define weak_odr void @"\01?ExternAndInlineFn@@YAXXZ"
+// MSVCCOMPAT-LABEL: define weak_odr dso_local void @"\01?ExternAndInlineFn@@YAXXZ"
 extern inline void ExternAndInlineFn() {}
 
 // NORMAL-NOT: _Z18InlineThenExternFnv
-// MSVCCOMPAT-LABEL: define weak_odr void @"\01?InlineThenExternFn@@YAXXZ"
+// MSVCCOMPAT-LABEL: define weak_odr dso_local void @"\01?InlineThenExternFn@@YAXXZ"
 inline void InlineThenExternFn() {}
 extern void InlineThenExternFn();
 
 // NORMAL-LABEL: define void @_Z18ExternThenInlineFnv
-// MSVCCOMPAT-LABEL: define void @"\01?ExternThenInlineFn@@YAXXZ"
+// MSVCCOMPAT-LABEL: define dso_local void @"\01?ExternThenInlineFn@@YAXXZ"
 extern void ExternThenInlineFn() {}
 
 // NORMAL-NOT: _Z25ExternThenInlineThenDefFnv
-// MSVCCOMPAT-LABEL: define weak_odr void @"\01?ExternThenInlineThenDefFn@@YAXXZ"
+// MSVCCOMPAT-LABEL: define weak_odr dso_local void @"\01?ExternThenInlineThenDefFn@@YAXXZ"
 extern void ExternThenInlineThenDefFn();
 inline void ExternThenInlineThenDefFn();
 void ExternThenInlineThenDefFn() {}
 
 // NORMAL-NOT: _Z25InlineThenExternThenDefFnv
-// MSVCCOMPAT-LABEL: define weak_odr void @"\01?InlineThenExternThenDefFn@@YAXXZ"
+// MSVCCOMPAT-LABEL: define weak_odr dso_local void @"\01?InlineThenExternThenDefFn@@YAXXZ"
 inline void InlineThenExternThenDefFn();
 extern void InlineThenExternThenDefFn();
 void InlineThenExternThenDefFn() {}
 
 // NORMAL-NOT: _Z17ExternAndConstexprFnv
-// MSVCCOMPAT-LABEL: define weak_odr i32 @"\01?ExternAndConstexprFn@@YAHXZ"
+// MSVCCOMPAT-LABEL: define weak_odr dso_local i32 @"\01?ExternAndConstexprFn@@YAHXZ"
 extern constexpr int ExternAndConstexprFn() { return 0; }
 
 // NORMAL-NOT: _Z11ConstexprFnv
@@ -112,7 +112,7 @@ template <typename T>
 extern inline void ExternInlineOnPrimaryTemplate(T);
 
 // NORMAL-LABEL: define void @_Z29ExternInlineOnPrimaryTemplateIiEvT_
-// MSVCCOMPAT-LABEL: define void @"\01??$ExternInlineOnPrimaryTemplate at H@@YAXH at Z"
+// MSVCCOMPAT-LABEL: define dso_local void @"\01??$ExternInlineOnPrimaryTemplate at H@@YAXH at Z"
 template <>
 void ExternInlineOnPrimaryTemplate(int) {}
 
@@ -120,7 +120,7 @@ template <typename T>
 extern inline void ExternInlineOnPrimaryTemplateAndSpecialization(T);
 
 // NORMAL-NOT: _Z46ExternInlineOnPrimaryTemplateAndSpecializationIiEvT_
-// MSVCCOMPAT-LABEL: define weak_odr void @"\01??$ExternInlineOnPrimaryTemplateAndSpecialization at H@@YAXH at Z"
+// MSVCCOMPAT-LABEL: define weak_odr dso_local void @"\01??$ExternInlineOnPrimaryTemplateAndSpecialization at H@@YAXH at Z"
 template <>
 extern inline void ExternInlineOnPrimaryTemplateAndSpecialization(int) {}
 
@@ -146,5 +146,5 @@ struct S {
 
 __attribute__((used)) inline S<int> Foo() { return S<int>(); }
 // NORMAL-LABEL: define linkonce_odr void @_ZN7PR229593FooEv(
-// MSVCCOMPAT-LABEL: define linkonce_odr i8 @"\01?Foo at PR22959@@YA?AU?$S at H@1 at XZ"(
+// MSVCCOMPAT-LABEL: define linkonce_odr dso_local i8 @"\01?Foo at PR22959@@YA?AU?$S at H@1 at XZ"(
 }

Modified: cfe/trunk/test/CodeGenCXX/internal-linkage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/internal-linkage.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/internal-linkage.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/internal-linkage.cpp Fri Feb 23 11:30:48 2018
@@ -51,7 +51,7 @@ extern char const * extern_nonconst_xyzz
 
 char const * *test4()
 {
-    // CHECK: @extern_nonconst_xyzzy = global
+    // CHECK: @extern_nonconst_xyzzy = {{(dso_local )?}}global
     return &extern_nonconst_xyzzy;
 }
 

Modified: cfe/trunk/test/CodeGenCXX/mangle-abi-tag.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-abi-tag.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-abi-tag.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-abi-tag.cpp Fri Feb 23 11:30:48 2018
@@ -145,7 +145,7 @@ void f13_test() {
   f13();
 }
 // f13()::L::foo[abi:C][abi:D]()
-// CHECK-DAG: define linkonce_odr %struct.E* @_ZZ3f13vEN1L3fooB1CB1DEv(
+// CHECK-DAG: define linkonce_odr {{(dso_local )?}}%struct.E* @_ZZ3f13vEN1L3fooB1CB1DEv(
 
 // f13()::L::foo[abi:C][abi:D]()::a[abi:A][abi:B]
 // CHECK-DAG: @_ZZZ3f13vEN1L3fooB1CB1DEvE1aB1AB1B =
@@ -218,7 +218,7 @@ namespace N19 {
 void f19_test(N19::C<N19::A,  &N19::foo>, N19::F, N19::D) {
 }
 // f19_test(N19::C<N19::A, &N19::foo[abi:B]>, N19::F, N19::D)
-// CHECK-DAG: define void @_Z8f19_testN3N191CINS_1AEXadL_ZNS_3fooB1BES1_NS_1DEEEEENS_1FES2_(
+// CHECK-DAG: define {{(dso_local )?}}void @_Z8f19_testN3N191CINS_1AEXadL_ZNS_3fooB1BES1_NS_1DEEEEENS_1FES2_(
 
 namespace pr30440 {
 

Modified: cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp Fri Feb 23 11:30:48 2018
@@ -322,13 +322,13 @@ void unaligned_foo8_S::unaligned_foo8()
 
 namespace PR31197 {
 struct A {
-  // CHECK-DAG: define linkonce_odr x86_thiscallcc i32* @"\01??R<lambda_1>@x at A@PR31197@@QBE at XZ"(
+  // CHECK-DAG: define linkonce_odr dso_local x86_thiscallcc i32* @"\01??R<lambda_1>@x at A@PR31197@@QBE at XZ"(
   int *x = []() {
     static int white;
     // CHECK-DAG: @"\01?white@?1???R<lambda_1>@x at A@PR31197@@QBE at XZ@4HA"
     return &white;
   }();
-  // CHECK-DAG: define linkonce_odr x86_thiscallcc i32* @"\01??R<lambda_1>@y at A@PR31197@@QBE at XZ"(
+  // CHECK-DAG: define linkonce_odr dso_local x86_thiscallcc i32* @"\01??R<lambda_1>@y at A@PR31197@@QBE at XZ"(
   int *y = []() {
     static int black;
     // CHECK-DAG: @"\01?black@?1???R<lambda_1>@y at A@PR31197@@QBE at XZ@4HA"

Modified: cfe/trunk/test/CodeGenCXX/mangle-ms-md5.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms-md5.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms-md5.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms-md5.cpp Fri Feb 23 11:30:48 2018
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -emit-llvm -o - -triple i686-pc-win32 %s | FileCheck %s
 int xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;
-// CHECK-DAG: @"\01??@bf7ea7b95f260b0b24e7f1e8fc8370ab@" = global i32 0, align 4
+// CHECK-DAG: @"\01??@bf7ea7b95f260b0b24e7f1e8fc8370ab@" = dso_local global i32 0, align 4
 
 struct yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy {
   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy();

Modified: cfe/trunk/test/CodeGenCXX/mangle-ms-templates-memptrs-2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms-templates-memptrs-2.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms-templates-memptrs-2.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms-templates-memptrs-2.cpp Fri Feb 23 11:30:48 2018
@@ -57,4 +57,4 @@ template struct ClassTemplate<&MostGener
 
 // Test that we mangle in the vbptr offset, which is 12 here.
 //
-// CHECK: define weak_odr x86_thiscallcc %struct.ClassTemplate* @"\01??0?$ClassTemplate@$J??_9MostGeneral@@$BA at AEA@M at 3@@QAE at XZ"
+// CHECK: define weak_odr dso_local x86_thiscallcc %struct.ClassTemplate* @"\01??0?$ClassTemplate@$J??_9MostGeneral@@$BA at AEA@M at 3@@QAE at XZ"

Modified: cfe/trunk/test/CodeGenCXX/mangle-ms-vector-types.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms-vector-types.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms-vector-types.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms-vector-types.cpp Fri Feb 23 11:30:48 2018
@@ -5,33 +5,33 @@
 #include <immintrin.h>
 
 void foo64(__m64) {}
-// CHECK: define void @"\01?foo64@@YAXT__m64@@@Z"
+// CHECK: define dso_local void @"\01?foo64@@YAXT__m64@@@Z"
 
 void foo128(__m128) {}
-// CHECK: define void @"\01?foo128@@YAXT__m128@@@Z"
+// CHECK: define dso_local void @"\01?foo128@@YAXT__m128@@@Z"
 
 void foo128d(__m128d) {}
-// CHECK: define void @"\01?foo128d@@YAXU__m128d@@@Z"
+// CHECK: define dso_local void @"\01?foo128d@@YAXU__m128d@@@Z"
 
 void foo128i(__m128i) {}
-// CHECK: define void @"\01?foo128i@@YAXT__m128i@@@Z"
+// CHECK: define dso_local void @"\01?foo128i@@YAXT__m128i@@@Z"
 
 void foo256(__m256) {}
-// CHECK: define void @"\01?foo256@@YAXT__m256@@@Z"
+// CHECK: define dso_local void @"\01?foo256@@YAXT__m256@@@Z"
 
 void foo256d(__m256d) {}
-// CHECK: define void @"\01?foo256d@@YAXU__m256d@@@Z"
+// CHECK: define dso_local void @"\01?foo256d@@YAXU__m256d@@@Z"
 
 void foo256i(__m256i) {}
-// CHECK: define void @"\01?foo256i@@YAXT__m256i@@@Z"
+// CHECK: define dso_local void @"\01?foo256i@@YAXT__m256i@@@Z"
 
 // We have a custom mangling for vector types not standardized by Intel.
 void foov8hi(__v8hi) {}
-// CHECK: define void @"\01?foov8hi@@YAXT?$__vector at F$07 at __clang@@@Z"
+// CHECK: define dso_local void @"\01?foov8hi@@YAXT?$__vector at F$07 at __clang@@@Z"
 
 typedef __attribute__((ext_vector_type(4))) int vi4b;
 void foovi4b(vi4b) {}
-// CHECK: define void @"\01?foovi4b@@YAXT?$__vector at H$03 at __clang@@@Z"
+// CHECK: define dso_local void @"\01?foovi4b@@YAXT?$__vector at H$03 at __clang@@@Z"
 
 // Clang does not support vectors of complex types, so we can't test the
 // mangling of them.

Modified: cfe/trunk/test/CodeGenCXX/mangle-ms.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms.cpp Fri Feb 23 11:30:48 2018
@@ -27,8 +27,8 @@ int _c(void) {return N::anonymous + c;}
 // X64-DAG:   @"\01?_c@@YAHXZ"
 
 const int &NeedsReferenceTemporary = 2;
-// CHECK-DAG: @"\01?NeedsReferenceTemporary@@3ABHB" = constant i32* @"\01?$RT1 at NeedsReferenceTemporary@@3ABHB"
-// X64-DAG: @"\01?NeedsReferenceTemporary@@3AEBHEB" = constant i32* @"\01?$RT1 at NeedsReferenceTemporary@@3AEBHEB"
+// CHECK-DAG: @"\01?NeedsReferenceTemporary@@3ABHB" = dso_local constant i32* @"\01?$RT1 at NeedsReferenceTemporary@@3ABHB"
+// X64-DAG: @"\01?NeedsReferenceTemporary@@3AEBHEB" = dso_local constant i32* @"\01?$RT1 at NeedsReferenceTemporary@@3AEBHEB"
 
 class foo {
   static const short d;
@@ -448,22 +448,22 @@ namespace PassObjectSize {
 //   void foo(void *const, __clang::__pass_object_size0);
 // where __clang is a top-level namespace.
 
-// CHECK-DAG: define i32 @"\01?foo at PassObjectSize@@YAHQAHW4__pass_object_size0 at __clang@@@Z"
+// CHECK-DAG: define dso_local i32 @"\01?foo at PassObjectSize@@YAHQAHW4__pass_object_size0 at __clang@@@Z"
 int foo(int *const i __attribute__((pass_object_size(0)))) { return 0; }
-// CHECK-DAG: define i32 @"\01?bar at PassObjectSize@@YAHQAHW4__pass_object_size1 at __clang@@@Z"
+// CHECK-DAG: define dso_local i32 @"\01?bar at PassObjectSize@@YAHQAHW4__pass_object_size1 at __clang@@@Z"
 int bar(int *const i __attribute__((pass_object_size(1)))) { return 0; }
-// CHECK-DAG: define i32 @"\01?qux at PassObjectSize@@YAHQAHW4__pass_object_size1 at __clang@@0W4__pass_object_size0 at 3@@Z"
+// CHECK-DAG: define dso_local i32 @"\01?qux at PassObjectSize@@YAHQAHW4__pass_object_size1 at __clang@@0W4__pass_object_size0 at 3@@Z"
 int qux(int *const i __attribute__((pass_object_size(1))), int *const j __attribute__((pass_object_size(0)))) { return 0; }
-// CHECK-DAG: define i32 @"\01?zot at PassObjectSize@@YAHQAHW4__pass_object_size1 at __clang@@01 at Z"
+// CHECK-DAG: define dso_local i32 @"\01?zot at PassObjectSize@@YAHQAHW4__pass_object_size1 at __clang@@01 at Z"
 int zot(int *const i __attribute__((pass_object_size(1))), int *const j __attribute__((pass_object_size(1)))) { return 0; }
 }
 
 namespace Atomic {
-// CHECK-DAG: define void @"\01?f at Atomic@@YAXU?$_Atomic at H@__clang@@@Z"(
+// CHECK-DAG: define dso_local void @"\01?f at Atomic@@YAXU?$_Atomic at H@__clang@@@Z"(
 void f(_Atomic(int)) {}
 }
 namespace Complex {
-// CHECK-DAG: define void @"\01?f at Complex@@YAXU?$_Complex at H@__clang@@@Z"(
+// CHECK-DAG: define dso_local void @"\01?f at Complex@@YAXU?$_Complex at H@__clang@@@Z"(
 void f(_Complex int) {}
 }
 

Modified: cfe/trunk/test/CodeGenCXX/mangle-windows.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-windows.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-windows.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-windows.cpp Fri Feb 23 11:30:48 2018
@@ -5,20 +5,20 @@
 // RUN:     FileCheck --check-prefix=ITANIUM %s
 
 void __stdcall f1(void) {}
-// WIN: define x86_stdcallcc void @"\01?f1@@YGXXZ"
-// ITANIUM: define x86_stdcallcc void @"\01__Z2f1v at 0"
+// WIN: define dso_local x86_stdcallcc void @"\01?f1@@YGXXZ"
+// ITANIUM: define dso_local x86_stdcallcc void @"\01__Z2f1v at 0"
 
 void __fastcall f2(void) {}
-// WIN: define x86_fastcallcc void @"\01?f2@@YIXXZ"
-// ITANIUM: define x86_fastcallcc void @"\01 at _Z2f2v@0"
+// WIN: define dso_local x86_fastcallcc void @"\01?f2@@YIXXZ"
+// ITANIUM: define dso_local x86_fastcallcc void @"\01 at _Z2f2v@0"
 
 extern "C" void __stdcall f3(void) {}
-// WIN: define x86_stdcallcc void @"\01_f3 at 0"
-// ITANIUM: define x86_stdcallcc void @"\01_f3 at 0"
+// WIN: define dso_local x86_stdcallcc void @"\01_f3 at 0"
+// ITANIUM: define dso_local x86_stdcallcc void @"\01_f3 at 0"
 
 extern "C" void __fastcall f4(void) {}
-// WIN: define x86_fastcallcc void @"\01 at f4@0"
-// ITANIUM: define x86_fastcallcc void @"\01 at f4@0"
+// WIN: define dso_local x86_fastcallcc void @"\01 at f4@0"
+// ITANIUM: define dso_local x86_fastcallcc void @"\01 at f4@0"
 
 struct Foo {
   void __stdcall foo();
@@ -26,17 +26,17 @@ struct Foo {
 };
 
 void Foo::foo() {}
-// WIN: define x86_stdcallcc void @"\01?foo at Foo@@QAGXXZ"
-// ITANIUM: define x86_stdcallcc void @"\01__ZN3Foo3fooEv at 4"
+// WIN: define dso_local x86_stdcallcc void @"\01?foo at Foo@@QAGXXZ"
+// ITANIUM: define dso_local x86_stdcallcc void @"\01__ZN3Foo3fooEv at 4"
 
 void Foo::bar() {}
-// WIN: define x86_stdcallcc void @"\01?bar at Foo@@SGXXZ"
-// ITANIUM: define x86_stdcallcc void @"\01__ZN3Foo3barEv at 0"
+// WIN: define dso_local x86_stdcallcc void @"\01?bar at Foo@@SGXXZ"
+// ITANIUM: define dso_local x86_stdcallcc void @"\01__ZN3Foo3barEv at 0"
 
 // Mostly a test that we don't crash and that the names start with a \01.
 // gcc on mingw produces __Zpp at 4
 // cl produces _++ at 4
 extern "C" void __stdcall operator++(Foo &x) {
 }
-// WIN: define x86_stdcallcc void @"\01??E at YGXAAUFoo@@@Z"
-// ITANIUM: define x86_stdcallcc void @"\01__ZppR3Foo at 4"
+// WIN: define dso_local x86_stdcallcc void @"\01??E at YGXAAUFoo@@@Z"
+// ITANIUM: define dso_local x86_stdcallcc void @"\01__ZppR3Foo at 4"

Modified: cfe/trunk/test/CodeGenCXX/member-function-pointer-calls.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/member-function-pointer-calls.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/member-function-pointer-calls.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/member-function-pointer-calls.cpp Fri Feb 23 11:30:48 2018
@@ -11,7 +11,7 @@ int f(A* a, int (A::*fp)()) {
 
 // CHECK-LABEL: define i32 @_Z2g1v()
 // CHECK: ret i32 1
-// MINGW64-LABEL: define i32 @_Z2g1v()
+// MINGW64-LABEL: define dso_local i32 @_Z2g1v()
 // MINGW64: call i32 @_Z1fP1AMS_FivE(%struct.A* %{{.*}}, { i64, i64 }* %{{.*}})
 int g1() {
   A a;
@@ -20,7 +20,7 @@ int g1() {
 
 // CHECK-LABEL: define i32 @_Z2g2v()
 // CHECK: ret i32 2
-// MINGW64-LABEL: define i32 @_Z2g2v()
+// MINGW64-LABEL: define dso_local i32 @_Z2g2v()
 // MINGW64: call i32 @_Z1fP1AMS_FivE(%struct.A* %{{.*}}, { i64, i64 }* %{{.*}})
 int g2() {
   A a;

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-arg-order.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-arg-order.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-arg-order.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-arg-order.cpp Fri Feb 23 11:30:48 2018
@@ -13,7 +13,7 @@ void foo(A a, A b, A c) {
 
 // Order of destruction should be left to right.
 //
-// X86-LABEL: define void @"\01?foo@@YAXUA@@00 at Z"
+// X86-LABEL: define dso_local void @"\01?foo@@YAXUA@@00 at Z"
 // X86:          ([[argmem_ty:<{ %struct.A, %struct.A, %struct.A }>]]* inalloca)
 // X86: %[[a:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %0, i32 0, i32 0
 // X86: %[[b:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %0, i32 0, i32 1
@@ -23,7 +23,7 @@ void foo(A a, A b, A c) {
 // X86: call x86_thiscallcc void @"\01??1A@@QAE at XZ"(%struct.A* %[[c]])
 // X86: ret void
 
-// X64-LABEL: define void @"\01?foo@@YAXUA@@00 at Z"
+// X64-LABEL: define dso_local void @"\01?foo@@YAXUA@@00 at Z"
 // X64:         (%struct.A* %[[a:[^,]*]], %struct.A* %[[b:[^,]*]], %struct.A* %[[c:[^)]*]])
 // X64: call void @"\01??1A@@QEAA at XZ"(%struct.A* %[[a]])
 // X64: call void @"\01??1A@@QEAA at XZ"(%struct.A* %[[b]])
@@ -38,7 +38,7 @@ void call_foo() {
 // Order of evaluation should be right to left, and we should clean up the right
 // things as we unwind.
 //
-// X86-LABEL: define void @"\01?call_foo@@YAXXZ"()
+// X86-LABEL: define dso_local void @"\01?call_foo@@YAXXZ"()
 // X86: call i8* @llvm.stacksave()
 // X86: %[[argmem:[^ ]*]] = alloca inalloca [[argmem_ty]]
 // X86: %[[arg3:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %[[argmem]], i32 0, i32 2
@@ -59,7 +59,7 @@ void call_foo() {
 //   ehcleanup:
 // X86: call x86_thiscallcc void @"\01??1A@@QAE at XZ"(%struct.A* %[[arg3]])
 
-// X64-LABEL: define void @"\01?call_foo@@YAXXZ"()
+// X64-LABEL: define dso_local void @"\01?call_foo@@YAXXZ"()
 // X64: call %struct.A* @"\01??0A@@QEAA at H@Z"(%struct.A* %[[arg3:[^,]*]], i32 3)
 // X64: invoke %struct.A* @"\01??0A@@QEAA at H@Z"(%struct.A* %[[arg2:[^,]*]], i32 2)
 // X64: invoke %struct.A* @"\01??0A@@QEAA at H@Z"(%struct.A* %[[arg1:[^,]*]], i32 1)

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-array-cookies.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-array-cookies.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-array-cookies.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-array-cookies.cpp Fri Feb 23 11:30:48 2018
@@ -5,7 +5,7 @@ struct ClassWithoutDtor {
 };
 
 void check_array_no_cookies() {
-// CHECK: define void @"\01?check_array_no_cookies@@YAXXZ"() [[NUW:#[0-9]+]]
+// CHECK: define dso_local void @"\01?check_array_no_cookies@@YAXXZ"() [[NUW:#[0-9]+]]
 
 // CHECK: call i8* @"\01??_U at YAPAXI@Z"(i32 42)
   ClassWithoutDtor *array = new ClassWithoutDtor[42];
@@ -62,7 +62,7 @@ namespace PR23990 {
 struct S {
   char x[42];
   void operator delete[](void *p, __SIZE_TYPE__);
-  // CHECK-LABEL: define void @"\01?delete_s at PR23990@@YAXPAUS at 1@@Z"(
+  // CHECK-LABEL: define dso_local void @"\01?delete_s at PR23990@@YAXPAUS at 1@@Z"(
   // CHECK: call void @"\01??_VS at PR23990@@SAXPAXI at Z"(i8* {{.*}}, i32 42)
 };
 void delete_s(S *s) { delete[] s; }

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-sret.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-sret.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-sret.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-sret.cpp Fri Feb 23 11:30:48 2018
@@ -18,7 +18,7 @@ A B::foo(A x) {
   return x;
 }
 
-// CHECK-LABEL: define x86_thiscallcc %struct.A* @"\01?foo at B@@QAE?AUA@@U2@@Z"
+// CHECK-LABEL: define dso_local x86_thiscallcc %struct.A* @"\01?foo at B@@QAE?AUA@@U2@@Z"
 // CHECK:       (%struct.B* %this, <{ %struct.A*, %struct.A }>* inalloca)
 // CHECK:   getelementptr inbounds <{ %struct.A*, %struct.A }>, <{ %struct.A*, %struct.A }>* %{{.*}}, i32 0, i32 0
 // CHECK:   load %struct.A*, %struct.A**
@@ -28,7 +28,7 @@ A B::bar(A x) {
   return x;
 }
 
-// CHECK-LABEL: define %struct.A* @"\01?bar at B@@QAA?AUA@@U2@@Z"
+// CHECK-LABEL: define dso_local %struct.A* @"\01?bar at B@@QAA?AUA@@U2@@Z"
 // CHECK:       (<{ %struct.B*, %struct.A*, %struct.A }>* inalloca)
 // CHECK:   getelementptr inbounds <{ %struct.B*, %struct.A*, %struct.A }>, <{ %struct.B*, %struct.A*, %struct.A }>* %{{.*}}, i32 0, i32 1
 // CHECK:   load %struct.A*, %struct.A**
@@ -38,7 +38,7 @@ A B::baz(A x) {
   return x;
 }
 
-// CHECK-LABEL: define x86_stdcallcc %struct.A* @"\01?baz at B@@QAG?AUA@@U2@@Z"
+// CHECK-LABEL: define dso_local x86_stdcallcc %struct.A* @"\01?baz at B@@QAG?AUA@@U2@@Z"
 // CHECK:       (<{ %struct.B*, %struct.A*, %struct.A }>* inalloca)
 // CHECK:   getelementptr inbounds <{ %struct.B*, %struct.A*, %struct.A }>, <{ %struct.B*, %struct.A*, %struct.A }>* %{{.*}}, i32 0, i32 1
 // CHECK:   load %struct.A*, %struct.A**
@@ -48,7 +48,7 @@ A B::qux(A x) {
   return x;
 }
 
-// CHECK-LABEL: define x86_fastcallcc void @"\01?qux at B@@QAI?AUA@@U2@@Z"
+// CHECK-LABEL: define dso_local x86_fastcallcc void @"\01?qux at B@@QAI?AUA@@U2@@Z"
 // CHECK:       (%struct.B* inreg %this, %struct.A* inreg noalias sret %agg.result, <{ %struct.A }>* inalloca)
 // CHECK:   ret void
 

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp Fri Feb 23 11:30:48 2018
@@ -14,14 +14,14 @@ struct B { virtual void foo(Agg x); };
 struct C : A, B { C(); virtual void foo(Agg x); };
 C::C() {} // force emission
 
-// CHECK32-LABEL: define linkonce_odr x86_thiscallcc void @"\01?foo at C@byval_thunk@@W3AEXUAgg at 2@@Z"
+// CHECK32-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"\01?foo at C@byval_thunk@@W3AEXUAgg at 2@@Z"
 // CHECK32:             (%"struct.byval_thunk::C"* %this, <{ %"struct.byval_thunk::Agg" }>* inalloca)
 // CHECK32:   getelementptr i8, i8* %{{.*}}, i32 -4
 // CHECK32:   musttail call x86_thiscallcc void @"\01?foo at C@byval_thunk@@UAEXUAgg at 2@@Z"
 // CHECK32:       (%"struct.byval_thunk::C"* %{{.*}}, <{ %"struct.byval_thunk::Agg" }>* inalloca %0)
 // CHECK32-NEXT: ret void
 
-// CHECK64-LABEL: define linkonce_odr void @"\01?foo at C@byval_thunk@@W7EAAXUAgg at 2@@Z"
+// CHECK64-LABEL: define linkonce_odr dso_local void @"\01?foo at C@byval_thunk@@W7EAAXUAgg at 2@@Z"
 // CHECK64:             (%"struct.byval_thunk::C"* %this, %"struct.byval_thunk::Agg"* %x)
 // CHECK64:   getelementptr i8, i8* %{{.*}}, i32 -8
 // CHECK64:   call void @"\01?foo at C@byval_thunk@@UEAAXUAgg at 2@@Z"
@@ -43,7 +43,7 @@ struct B { virtual void __stdcall foo(Ag
 struct C : A, B { C(); virtual void __stdcall foo(Agg x); };
 C::C() {} // force emission
 
-// CHECK32-LABEL: define linkonce_odr x86_stdcallcc void @"\01?foo at C@stdcall_thunk@@W3AGXUAgg at 2@@Z"
+// CHECK32-LABEL: define linkonce_odr dso_local x86_stdcallcc void @"\01?foo at C@stdcall_thunk@@W3AGXUAgg at 2@@Z"
 // CHECK32:             (<{ %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::Agg" }>* inalloca)
 // CHECK32:   %[[this_slot:[^ ]*]] = getelementptr inbounds <{ %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::Agg" }>, <{ %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::Agg" }>* %0, i32 0, i32 0
 // CHECK32:   load %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::C"** %[[this_slot]]
@@ -53,7 +53,7 @@ C::C() {} // force emission
 // CHECK32:       (<{ %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::Agg" }>*  inalloca %0)
 // CHECK32-NEXT: ret void
 
-// CHECK64-LABEL: define linkonce_odr void @"\01?foo at C@stdcall_thunk@@W7EAAXUAgg at 2@@Z"
+// CHECK64-LABEL: define linkonce_odr dso_local void @"\01?foo at C@stdcall_thunk@@W7EAAXUAgg at 2@@Z"
 // CHECK64:             (%"struct.stdcall_thunk::C"* %this, %"struct.stdcall_thunk::Agg"* %x)
 // CHECK64:   getelementptr i8, i8* %{{.*}}, i32 -8
 // CHECK64:   call void @"\01?foo at C@stdcall_thunk@@UEAAXUAgg at 2@@Z"
@@ -75,7 +75,7 @@ struct B { virtual Agg __cdecl foo(Agg x
 struct C : A, B { C(); virtual Agg __cdecl foo(Agg x); };
 C::C() {} // force emission
 
-// CHECK32-LABEL: define linkonce_odr %"struct.sret_thunk::Agg"* @"\01?foo at C@sret_thunk@@W3AA?AUAgg at 2@U32@@Z"
+// CHECK32-LABEL: define linkonce_odr dso_local %"struct.sret_thunk::Agg"* @"\01?foo at C@sret_thunk@@W3AA?AUAgg at 2@U32@@Z"
 // CHECK32:             (<{ %"struct.sret_thunk::C"*, %"struct.sret_thunk::Agg"*, %"struct.sret_thunk::Agg" }>* inalloca)
 // CHECK32:   %[[this_slot:[^ ]*]] = getelementptr inbounds <{ %"struct.sret_thunk::C"*, %"struct.sret_thunk::Agg"*, %"struct.sret_thunk::Agg" }>, <{ %"struct.sret_thunk::C"*, %"struct.sret_thunk::Agg"*, %"struct.sret_thunk::Agg" }>* %0, i32 0, i32 0
 // CHECK32:   load %"struct.sret_thunk::C"*, %"struct.sret_thunk::C"** %[[this_slot]]
@@ -85,7 +85,7 @@ C::C() {} // force emission
 // CHECK32:       (<{ %"struct.sret_thunk::C"*, %"struct.sret_thunk::Agg"*, %"struct.sret_thunk::Agg" }>*  inalloca %0)
 // CHECK32-NEXT: ret %"struct.sret_thunk::Agg"* %[[rv]]
 
-// CHECK64-LABEL: define linkonce_odr void @"\01?foo at C@sret_thunk@@W7EAA?AUAgg at 2@U32@@Z"
+// CHECK64-LABEL: define linkonce_odr dso_local void @"\01?foo at C@sret_thunk@@W7EAA?AUAgg at 2@U32@@Z"
 // CHECK64:             (%"struct.sret_thunk::C"* %this, %"struct.sret_thunk::Agg"* noalias sret %agg.result, %"struct.sret_thunk::Agg"* %x)
 // CHECK64:   getelementptr i8, i8* %{{.*}}, i32 -8
 // CHECK64:   call void @"\01?foo at C@sret_thunk@@UEAA?AUAgg at 2@U32@@Z"

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp Fri Feb 23 11:30:48 2018
@@ -19,12 +19,12 @@ int foo(A a, ...) {
   return sum;
 }
 
-// CHECK-LABEL: define i32 @"\01?foo@@YAHUA@@ZZ"(<{ %struct.A }>* inalloca, ...)
+// CHECK-LABEL: define dso_local i32 @"\01?foo@@YAHUA@@ZZ"(<{ %struct.A }>* inalloca, ...)
 
 int main() {
   return foo(A(3), 1, 2, 3);
 }
-// CHECK-LABEL: define i32 @main()
+// CHECK-LABEL: define dso_local i32 @main()
 // CHECK: %[[argmem:[^ ]*]] = alloca inalloca <{ %struct.A, i32, i32, i32 }>
 // CHECK: call i32 {{.*bitcast.*}}@"\01?foo@@YAHUA@@ZZ"{{.*}}(<{ %struct.A, i32, i32, i32 }>* inalloca %[[argmem]])
 
@@ -40,13 +40,13 @@ void call_var_args() {
   varargs_three(1, 2, 3, x);
 }
 
-// CHECK-LABEL: define void @"\01?call_var_args@@YAXXZ"()
+// CHECK-LABEL: define dso_local void @"\01?call_var_args@@YAXXZ"()
 // CHECK: call void {{.*bitcast.*varargs_zero.*}}(<{ %struct.A }>* inalloca %{{.*}})
 // CHECK: call void {{.*bitcast.*varargs_one.*}}(<{ i32, %struct.A }>* inalloca %{{.*}})
 // CHECK: call void {{.*bitcast.*varargs_two.*}}(<{ i32, i32, %struct.A }>* inalloca %{{.*}})
 // CHECK: call void {{.*bitcast.*varargs_three.*}}(<{ i32, i32, i32, %struct.A }>* inalloca %{{.*}})
 
-// CHECK-LABEL: declare void @"\01?varargs_zero@@YAXZZ"(...)
-// CHECK-LABEL: declare void @"\01?varargs_one@@YAXHZZ"(i32, ...)
-// CHECK-LABEL: declare void @"\01?varargs_two@@YAXHHZZ"(i32, i32, ...)
-// CHECK-LABEL: declare void @"\01?varargs_three@@YAXHHHZZ"(i32, i32, i32, ...)
+// CHECK-LABEL: declare dso_local void @"\01?varargs_zero@@YAXZZ"(...)
+// CHECK-LABEL: declare dso_local void @"\01?varargs_one@@YAXHZZ"(i32, ...)
+// CHECK-LABEL: declare dso_local void @"\01?varargs_two@@YAXHHZZ"(i32, i32, ...)
+// CHECK-LABEL: declare dso_local void @"\01?varargs_three@@YAXHHHZZ"(i32, i32, i32, ...)

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp Fri Feb 23 11:30:48 2018
@@ -19,9 +19,9 @@ S C::variadic_sret(const char *f, ...) {
 S C::cdecl_sret() { return S(); }
 S C::byval_and_sret(S a) { return S(); }
 
-// CHECK: define void @"\01?variadic_sret at C@@QAA?AUS@@PBDZZ"(%struct.C* %this, %struct.S* noalias sret %agg.result, i8* %f, ...)
-// CHECK: define void @"\01?cdecl_sret at C@@QAA?AUS@@XZ"(%struct.C* %this, %struct.S* noalias sret %agg.result)
-// CHECK: define void @"\01?byval_and_sret at C@@QAA?AUS@@U2@@Z"(%struct.C* %this, %struct.S* noalias sret %agg.result, %struct.S* byval align 4 %a)
+// CHECK: define dso_local void @"\01?variadic_sret at C@@QAA?AUS@@PBDZZ"(%struct.C* %this, %struct.S* noalias sret %agg.result, i8* %f, ...)
+// CHECK: define dso_local void @"\01?cdecl_sret at C@@QAA?AUS@@XZ"(%struct.C* %this, %struct.S* noalias sret %agg.result)
+// CHECK: define dso_local void @"\01?byval_and_sret at C@@QAA?AUS@@U2@@Z"(%struct.C* %this, %struct.S* noalias sret %agg.result, %struct.S* byval align 4 %a)
 
 int main() {
   C c;
@@ -29,7 +29,7 @@ int main() {
   c.cdecl_sret();
   c.byval_and_sret(S());
 }
-// CHECK-LABEL: define i32 @main()
+// CHECK-LABEL: define dso_local i32 @main()
 // CHECK: call void {{.*}} @"\01?variadic_sret at C@@QAA?AUS@@PBDZZ"
 // CHECK: call void @"\01?cdecl_sret at C@@QAA?AUS@@XZ"
 // CHECK: call void @"\01?byval_and_sret at C@@QAA?AUS@@U2@@Z"
@@ -41,4 +41,4 @@ struct A {
 S A::f(int x) {
   return S();
 }
-// CHECK-LABEL: define x86_fastcallcc void @"\01?f at A@@QAI?AUS@@H at Z"(%struct.A* inreg %this, %struct.S* inreg noalias sret %agg.result, i32 %x)
+// CHECK-LABEL: define dso_local x86_fastcallcc void @"\01?f at A@@QAI?AUS@@H at Z"(%struct.A* inreg %this, %struct.S* inreg noalias sret %agg.result, i32 %x)

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp Fri Feb 23 11:30:48 2018
@@ -7,7 +7,7 @@ struct A {
 };
 
 A a(42);
-// CHECK: @"\01?a@@3UA@@A" = global { { [1 x i8*] }*, i32 } { { [1 x i8*] }* @"\01??_7A@@6B@", i32 42 }, align 4
+// CHECK: @"\01?a@@3UA@@A" = dso_local global { { [1 x i8*] }*, i32 } { { [1 x i8*] }* @"\01??_7A@@6B@", i32 42 }, align 4
 
 struct B {
   constexpr B(int y) : y(y) {}
@@ -20,4 +20,4 @@ struct C : A, B {
 };
 
 C c;
-// CHECK: @"\01?c@@3UC@@A" = global { { [1 x i8*] }*, i32, { [1 x i8*] }*, i32 } { { [1 x i8*] }* @"\01??_7C@@6BA@@@", i32 777, { [1 x i8*] }* @"\01??_7C@@6BB@@@", i32 13 }
+// CHECK: @"\01?c@@3UC@@A" = dso_local global { { [1 x i8*] }*, i32, { [1 x i8*] }*, i32 } { { [1 x i8*] }* @"\01??_7C@@6BA@@@", i32 777, { [1 x i8*] }* @"\01??_7C@@6BB@@@", i32 13 }

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-default-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-default-cc.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-default-cc.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-default-cc.cpp Fri Feb 23 11:30:48 2018
@@ -13,13 +13,13 @@ void foo();
 void __cdecl foo();
 void __cdecl foo() {}
 // GCABI-LABEL: define void @_Z3foov()
-// MSABI: define void @"\01?foo@@YAXXZ"
+// MSABI: define dso_local void @"\01?foo@@YAXXZ"
 
 void __cdecl bar();
 void bar();
 void bar() {}
 // GCABI-LABEL: define void @_Z3barv()
-// MSABI: define void @"\01?bar@@YAXXZ"
+// MSABI: define dso_local void @"\01?bar@@YAXXZ"
 
 // Test that it's OK to mark either the method declaration or method definition
 // with a default CC explicitly.
@@ -34,23 +34,23 @@ public:
 
 void METHOD_CC A::baz() {}
 // GCABI-LABEL: define void @_ZN1A3bazEv
-// MSABI: define x86_thiscallcc void @"\01?baz at A@@QAEXXZ"
+// MSABI: define dso_local x86_thiscallcc void @"\01?baz at A@@QAEXXZ"
 void A::qux() {}
 // GCABI-LABEL: define void @_ZN1A3quxEv
-// MSABI: define x86_thiscallcc void @"\01?qux at A@@QAEXXZ"
+// MSABI: define dso_local x86_thiscallcc void @"\01?qux at A@@QAEXXZ"
 
 void __cdecl static_baz() {}
 // GCABI-LABEL: define void @_Z10static_bazv
-// MSABI: define void @"\01?static_baz@@YAXXZ"
+// MSABI: define dso_local void @"\01?static_baz@@YAXXZ"
 void static_qux() {}
 // GCABI-LABEL: define void @_Z10static_quxv
-// MSABI: define void @"\01?static_qux@@YAXXZ"
+// MSABI: define dso_local void @"\01?static_qux@@YAXXZ"
 
 namespace PR31656 {
 template <int I>
 void __cdecl callee(int args[I]);
 // GCABI-LABEL: declare void @_ZN7PR316566calleeILi1EEEvPi(
-// MSABI: declare void @"\01??$callee@$00 at PR31656@@YAXQAH at Z"(
+// MSABI: declare dso_local void @"\01??$callee@$00 at PR31656@@YAXQAH at Z"(
 
 void caller() { callee<1>(0); }
 }

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp Fri Feb 23 11:30:48 2018
@@ -7,18 +7,18 @@ struct B : S, virtual V {};
 struct T {};
 
 T* test0() { return dynamic_cast<T*>((B*)0); }
-// CHECK-LABEL: define noalias %struct.T* @"\01?test0@@YAPAUT@@XZ"()
+// CHECK-LABEL: define dso_local noalias %struct.T* @"\01?test0@@YAPAUT@@XZ"()
 // CHECK:   ret %struct.T* null
 
 T* test1(V* x) { return &dynamic_cast<T&>(*x); }
-// CHECK-LABEL: define %struct.T* @"\01?test1@@YAPAUT@@PAUV@@@Z"(%struct.V* %x)
+// CHECK-LABEL: define dso_local %struct.T* @"\01?test1@@YAPAUT@@PAUV@@@Z"(%struct.V* %x)
 // CHECK:        [[CAST:%.*]] = bitcast %struct.V* %x to i8*
 // CHECK-NEXT:   [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[CAST]], i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUV@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUT@@@8" to i8*), i32 1)
 // CHECK-NEXT:   [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T*
 // CHECK-NEXT:   ret %struct.T* [[RET]]
 
 T* test2(A* x) { return &dynamic_cast<T&>(*x); }
-// CHECK-LABEL: define %struct.T* @"\01?test2@@YAPAUT@@PAUA@@@Z"(%struct.A* %x)
+// CHECK-LABEL: define dso_local %struct.T* @"\01?test2@@YAPAUT@@PAUA@@@Z"(%struct.A* %x)
 // CHECK:        [[CAST:%.*]] = bitcast %struct.A* %x to i8*
 // CHECK-NEXT:   [[VBPTRPTR:%.*]] = getelementptr inbounds %struct.A, %struct.A* %x, i32 0, i32 0
 // CHECK-NEXT:   [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4
@@ -30,7 +30,7 @@ T* test2(A* x) { return &dynamic_cast<T&
 // CHECK-NEXT:   ret %struct.T* [[RET]]
 
 T* test3(B* x) { return &dynamic_cast<T&>(*x); }
-// CHECK-LABEL: define %struct.T* @"\01?test3@@YAPAUT@@PAUB@@@Z"(%struct.B* %x)
+// CHECK-LABEL: define dso_local %struct.T* @"\01?test3@@YAPAUT@@PAUB@@@Z"(%struct.B* %x)
 // CHECK:        [[VOIDP:%.*]] = getelementptr inbounds %struct.B, %struct.B* %x, i32 0, i32 0, i32 0
 // CHECK-NEXT:   [[VBPTR:%.*]] = getelementptr inbounds i8, i8* [[VOIDP]], i32 4
 // CHECK-NEXT:   [[VBPTRPTR:%.*]] = bitcast i8* [[VBPTR:%.*]] to i32**
@@ -44,14 +44,14 @@ T* test3(B* x) { return &dynamic_cast<T&
 // CHECK-NEXT:   ret %struct.T* [[RET]]
 
 T* test4(V* x) { return dynamic_cast<T*>(x); }
-// CHECK-LABEL: define %struct.T* @"\01?test4@@YAPAUT@@PAUV@@@Z"(%struct.V* %x)
+// CHECK-LABEL: define dso_local %struct.T* @"\01?test4@@YAPAUT@@PAUV@@@Z"(%struct.V* %x)
 // CHECK:        [[CAST:%.*]] = bitcast %struct.V* %x to i8*
 // CHECK-NEXT:   [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[CAST]], i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUV@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUT@@@8" to i8*), i32 0)
 // CHECK-NEXT:   [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T*
 // CHECK-NEXT:   ret %struct.T* [[RET]]
 
 T* test5(A* x) { return dynamic_cast<T*>(x); }
-// CHECK-LABEL: define %struct.T* @"\01?test5@@YAPAUT@@PAUA@@@Z"(%struct.A* %x)
+// CHECK-LABEL: define dso_local %struct.T* @"\01?test5@@YAPAUT@@PAUA@@@Z"(%struct.A* %x)
 // CHECK:        [[CHECK:%.*]] = icmp eq %struct.A* %x, null
 // CHECK-NEXT:   br i1 [[CHECK]]
 // CHECK:        [[VOIDP:%.*]] = bitcast %struct.A* %x to i8*
@@ -67,7 +67,7 @@ T* test5(A* x) { return dynamic_cast<T*>
 // CHECK-NEXT:   ret %struct.T* [[RET]]
 
 T* test6(B* x) { return dynamic_cast<T*>(x); }
-// CHECK-LABEL: define %struct.T* @"\01?test6@@YAPAUT@@PAUB@@@Z"(%struct.B* %x)
+// CHECK-LABEL: define dso_local %struct.T* @"\01?test6@@YAPAUT@@PAUB@@@Z"(%struct.B* %x)
 // CHECK:        [[CHECK:%.*]] = icmp eq %struct.B* %x, null
 // CHECK-NEXT:   br i1 [[CHECK]]
 // CHECK:        [[CAST:%.*]] = getelementptr inbounds %struct.B, %struct.B* %x, i32 0, i32 0, i32 0
@@ -85,13 +85,13 @@ T* test6(B* x) { return dynamic_cast<T*>
 // CHECK-NEXT:   ret %struct.T* [[RET]]
 
 void* test7(V* x) { return dynamic_cast<void*>(x); }
-// CHECK-LABEL: define i8* @"\01?test7@@YAPAXPAUV@@@Z"(%struct.V* %x)
+// CHECK-LABEL: define dso_local i8* @"\01?test7@@YAPAXPAUV@@@Z"(%struct.V* %x)
 // CHECK:        [[CAST:%.*]] = bitcast %struct.V* %x to i8*
 // CHECK-NEXT:   [[RET:%.*]] = tail call i8* @__RTCastToVoid(i8* [[CAST]])
 // CHECK-NEXT:   ret i8* [[RET]]
 
 void* test8(A* x) { return dynamic_cast<void*>(x); }
-// CHECK-LABEL: define i8* @"\01?test8@@YAPAXPAUA@@@Z"(%struct.A* %x)
+// CHECK-LABEL: define dso_local i8* @"\01?test8@@YAPAXPAUA@@@Z"(%struct.A* %x)
 // CHECK:        [[CHECK:%.*]] = icmp eq %struct.A* %x, null
 // CHECK-NEXT:   br i1 [[CHECK]]
 // CHECK:        [[VOIDP:%.*]] = bitcast %struct.A* %x to i8*
@@ -106,7 +106,7 @@ void* test8(A* x) { return dynamic_cast<
 // CHECK-NEXT:   ret i8* [[RET]]
 
 void* test9(B* x) { return dynamic_cast<void*>(x); }
-// CHECK-LABEL: define i8* @"\01?test9@@YAPAXPAUB@@@Z"(%struct.B* %x)
+// CHECK-LABEL: define dso_local i8* @"\01?test9@@YAPAXPAUB@@@Z"(%struct.B* %x)
 // CHECK:        [[CHECK:%.*]] = icmp eq %struct.B* %x, null
 // CHECK-NEXT:   br i1 [[CHECK]]
 // CHECK:        [[CAST:%.*]] = getelementptr inbounds %struct.B, %struct.B* %x, i32 0, i32 0, i32 0
@@ -134,7 +134,7 @@ S3 *f(S2 &s) {
   Cleanup c;
   return dynamic_cast<S3 *>(&s);
 }
-// CHECK-LABEL: define %"struct.PR25606::S3"* @"\01?f at PR25606@@YAPAUS3 at 1@AAUS2 at 1@@Z"(
+// CHECK-LABEL: define dso_local %"struct.PR25606::S3"* @"\01?f at PR25606@@YAPAUS3 at 1@AAUS2 at 1@@Z"(
 // CHECK:    [[CALL:%.*]] = invoke i8* @__RTDynamicCast
 
 // CHECK:    [[BC:%.*]] = bitcast i8* [[CALL]] to %"struct.PR25606::S3"*

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-catch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-catch.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-catch.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-catch.cpp Fri Feb 23 11:30:48 2018
@@ -17,7 +17,7 @@ extern "C" void catch_all() {
   }
 }
 
-// WIN64-LABEL: define void @catch_all()
+// WIN64-LABEL: define dso_local void @catch_all()
 // WIN64: invoke void @might_throw()
 // WIN64-NEXT: to label %[[cont:[^ ]*]] unwind label %[[catchswitch_lpad:[^ ]*]]
 //
@@ -46,7 +46,7 @@ extern "C" void catch_int() {
   }
 }
 
-// WIN64-LABEL: define void @catch_int()
+// WIN64-LABEL: define dso_local void @catch_int()
 // WIN64: catchpad within %{{[^ ]*}} [%rtti.TypeDescriptor2* @"\01??_R0H at 8", i32 0, i32* %[[e_addr:[^\]]*]]]
 //
 // The catchpad instruction starts the lifetime of 'e'. Unfortunately, that
@@ -68,7 +68,7 @@ extern "C" void catch_int_unnamed() {
   }
 }
 
-// WIN64-LABEL: define void @catch_int_unnamed()
+// WIN64-LABEL: define dso_local void @catch_int_unnamed()
 // WIN64: catchpad within %{{.*}} [%rtti.TypeDescriptor2* @"\01??_R0H at 8", i32 0, i8* null]
 // WIN64: catchret
 
@@ -94,7 +94,7 @@ extern "C" void catch_a_byval() {
   }
 }
 
-// WIN64-LABEL: define void @catch_a_byval()
+// WIN64-LABEL: define dso_local void @catch_a_byval()
 // WIN64: %[[e_addr:[^ ]*]] = alloca %struct.A
 // WIN64: catchpad within %{{[^ ]*}} [%rtti.TypeDescriptor7* @"\01??_R0?AUA@@@8", i32 0, %struct.A* %[[e_addr]]]
 // WIN64: %[[e_i8:[^ ]*]] = bitcast %struct.A* %[[e_addr]] to i8*
@@ -109,7 +109,7 @@ extern "C" void catch_a_ref() {
   }
 }
 
-// WIN64-LABEL: define void @catch_a_ref()
+// WIN64-LABEL: define dso_local void @catch_a_ref()
 // WIN64: %[[e_addr:[^ ]*]] = alloca %struct.A*
 // WIN64: catchpad within %{{[^ ]*}} [%rtti.TypeDescriptor7* @"\01??_R0?AUA@@@8", i32 8, %struct.A** %[[e_addr]]]
 // WIN64: %[[eptr:[^ ]*]] = load %struct.A*, %struct.A** %[[e_addr]]
@@ -121,7 +121,7 @@ extern "C" void fn_with_exc_spec() throw
   might_throw();
 }
 
-// WIN64-LABEL: define void @fn_with_exc_spec()
+// WIN64-LABEL: define dso_local void @fn_with_exc_spec()
 // WIN64: call void @might_throw()
 // WIN64-NEXT: ret void
 
@@ -137,7 +137,7 @@ extern "C" void catch_nested() {
   }
 }
 
-// WIN64-LABEL: define void @catch_nested()
+// WIN64-LABEL: define dso_local void @catch_nested()
 // WIN64: invoke void @might_throw()
 // WIN64-NEXT: to label %{{.*}} unwind label %[[catchswitch_outer:[^ ]*]]
 //

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp Fri Feb 23 11:30:48 2018
@@ -15,7 +15,7 @@ void HasEHCleanup() {
 }
 
 // With exceptions, we need to clean up at least one of these temporaries.
-// WIN32-LABEL: define void @"\01?HasEHCleanup@@YAXXZ"() {{.*}} {
+// WIN32-LABEL: define dso_local void @"\01?HasEHCleanup@@YAXXZ"() {{.*}} {
 // WIN32:   %[[base:.*]] = call i8* @llvm.stacksave()
 //    If this call throws, we have to restore the stack.
 // WIN32:   call void @"\01?getA@@YA?AUA@@XZ"(%struct.A* sret %{{.*}})
@@ -37,7 +37,7 @@ int HasDeactivatedCleanups() {
   return TakesTwo((TakeRef(A()), A()), (TakeRef(A()), A()));
 }
 
-// WIN32-LABEL: define i32 @"\01?HasDeactivatedCleanups@@YAHXZ"() {{.*}} {
+// WIN32-LABEL: define dso_local i32 @"\01?HasDeactivatedCleanups@@YAHXZ"() {{.*}} {
 // WIN32:   %[[isactive:.*]] = alloca i1
 // WIN32:   call i8* @llvm.stacksave()
 // WIN32:   %[[argmem:.*]] = alloca inalloca [[argmem_ty:<{ %struct.A, %struct.A }>]]
@@ -72,7 +72,7 @@ int HasConditionalCleanup(bool cond) {
   return (cond ? TakesTwo(A(), A()) : CouldThrow());
 }
 
-// WIN32-LABEL: define i32 @"\01?HasConditionalCleanup@@YAH_N at Z"(i1 zeroext %{{.*}}) {{.*}} {
+// WIN32-LABEL: define dso_local i32 @"\01?HasConditionalCleanup@@YAH_N at Z"(i1 zeroext %{{.*}}) {{.*}} {
 // WIN32:   store i1 false
 // WIN32:   br i1
 // WIN32:   call i8* @llvm.stacksave()
@@ -95,7 +95,7 @@ int HasConditionalDeactivatedCleanups(bo
   return (cond ? TakesTwo((TakeRef(A()), A()), (TakeRef(A()), A())) : CouldThrow());
 }
 
-// WIN32-O0-LABEL: define i32 @"\01?HasConditionalDeactivatedCleanups@@YAH_N at Z"{{.*}} {
+// WIN32-O0-LABEL: define dso_local i32 @"\01?HasConditionalDeactivatedCleanups@@YAH_N at Z"{{.*}} {
 // WIN32-O0:   alloca i1
 // WIN32-O0:   %[[arg1_cond:.*]] = alloca i1
 //        Start all four cleanups as deactivated.
@@ -130,7 +130,7 @@ int HasConditionalDeactivatedCleanups(bo
 // WIN32-O0:   call x86_thiscallcc void @"\01??1A@@QAE at XZ"({{.*}})
 // WIN32-O0: }
 
-// WIN32-O3-LABEL: define i32 @"\01?HasConditionalDeactivatedCleanups@@YAH_N at Z"{{.*}} {
+// WIN32-O3-LABEL: define dso_local i32 @"\01?HasConditionalDeactivatedCleanups@@YAH_N at Z"{{.*}} {
 // WIN32-O3:   alloca i1
 // WIN32-O3:   alloca i1
 // WIN32-O3:   %[[arg1_cond:.*]] = alloca i1
@@ -187,7 +187,7 @@ C::C() { foo(); }
 
 // Verify that we don't bother with a vbtable lookup when adjusting the this
 // pointer to call a base destructor from a constructor while unwinding.
-// WIN32-LABEL: define {{.*}} @"\01??0C at crash_on_partial_destroy@@QAE at XZ"{{.*}} {
+// WIN32-LABEL: define dso_local {{.*}} @"\01??0C at crash_on_partial_destroy@@QAE at XZ"{{.*}} {
 // WIN32:      cleanuppad
 //
 //        We shouldn't do any vbptr loads, just constant GEPs.
@@ -217,7 +217,7 @@ void f() {
   g();
 }
 
-// WIN32-LABEL: define void @"\01?f at dont_call_terminate@@YAXXZ"()
+// WIN32-LABEL: define dso_local void @"\01?f at dont_call_terminate@@YAXXZ"()
 // WIN32: invoke void @"\01?g at dont_call_terminate@@YAXXZ"()
 // WIN32-NEXT: to label %[[cont:[^ ]*]] unwind label %[[lpad:[^ ]*]]
 //
@@ -239,7 +239,7 @@ void f() {
 }
 }
 
-// WIN32-LABEL: define void @"\01?f at noexcept_false_dtor@@YAXXZ"()
+// WIN32-LABEL: define dso_local void @"\01?f at noexcept_false_dtor@@YAXXZ"()
 // WIN32: invoke i32 @"\01?CouldThrow@@YAHXZ"()
 // WIN32: call x86_thiscallcc void @"\01??1D at noexcept_false_dtor@@QAE at XZ"(%"struct.noexcept_false_dtor::D"* %{{.*}})
 // WIN32: cleanuppad
@@ -256,7 +256,7 @@ void f() {
   g();
 }
 
-// WIN32-LIFETIME-LABEL: define void @"\01?f at lifetime_marker@@YAXXZ"()
+// WIN32-LIFETIME-LABEL: define dso_local void @"\01?f at lifetime_marker@@YAXXZ"()
 // WIN32-LIFETIME: %[[c:.*]] = alloca %"struct.lifetime_marker::C"
 // WIN32-LIFETIME: %[[bc0:.*]] = bitcast %"struct.lifetime_marker::C"* %c to i8*
 // WIN32-LIFETIME: call void @llvm.lifetime.start.p0i8(i64 1, i8* %[[bc0]])
@@ -293,7 +293,7 @@ struct class_0 : class_1 {
 };
 
 class_0::class_0() {
-  // WIN32: define x86_thiscallcc %struct.class_0* @"\01??0class_0@@QAE at XZ"(%struct.class_0* returned %this, i32 %is_most_derived) 
+  // WIN32: define dso_local x86_thiscallcc %struct.class_0* @"\01??0class_0@@QAE at XZ"(%struct.class_0* returned %this, i32 %is_most_derived) 
   // WIN32: store i32 %is_most_derived, i32* %[[IS_MOST_DERIVED_VAR:.*]], align 4
   // WIN32: %[[IS_MOST_DERIVED_VAL:.*]] = load i32, i32* %[[IS_MOST_DERIVED_VAR]]
   // WIN32: %[[SHOULD_CALL_VBASE_CTORS:.*]] = icmp ne i32 %[[IS_MOST_DERIVED_VAL]], 0

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-inlineasm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-inlineasm.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-inlineasm.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-inlineasm.cpp Fri Feb 23 11:30:48 2018
@@ -12,7 +12,7 @@ extern "C" void foo() {
   }
 }
 
-// CHECK-LABEL: define void @foo()
+// CHECK-LABEL: define dso_local void @foo()
 // CHECK: invoke void @might_throw()
 // CHECK: %[[CATCHPAD:[^ ]*]] = catchpad within
 // CHECK: call void asm sideeffect "nop", {{.*}} [ "funclet"(token %[[CATCHPAD]]) ]

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-terminate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-terminate.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-terminate.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-eh-terminate.cpp Fri Feb 23 11:30:48 2018
@@ -6,7 +6,7 @@ void never_throws() noexcept(true) {
   may_throw();
 }
 
-// CHECK-LABEL: define void @"\01?never_throws@@YAXXZ"()
+// CHECK-LABEL: define dso_local void @"\01?never_throws@@YAXXZ"()
 // CHECK-SAME:          personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
 // CHECK:      invoke void @"\01?may_throw@@YAXXZ"()
 // CHECK:      %[[cp:.*]] = cleanuppad within none []

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-extern-template.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-extern-template.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-extern-template.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-extern-template.cpp Fri Feb 23 11:30:48 2018
@@ -7,13 +7,13 @@
 // CHECK-SAME:   i8* bitcast (i8* (%struct.Foo*, i32)* @"\01??_G?$Foo at H@@UEAAPEAXI at Z" to i8*)
 // CHECK-SAME: ] }, comdat
 
-// CHECK-LABEL: define %struct.Foo* @"\01?f@@YAPEAU?$Foo at H@@XZ"()
+// CHECK-LABEL: define dso_local %struct.Foo* @"\01?f@@YAPEAU?$Foo at H@@XZ"()
 // CHECK: call %struct.Foo* @"\01??0?$Foo at H@@QEAA at XZ"(%struct.Foo* %{{.*}})
 
-// CHECK: define available_externally %struct.Foo* @"\01??0?$Foo at H@@QEAA at XZ"(%struct.Foo* returned %this)
+// CHECK: define available_externally dso_local %struct.Foo* @"\01??0?$Foo at H@@QEAA at XZ"(%struct.Foo* returned %this)
 // CHECK:   store {{.*}} @"\01??_7?$Foo at H@@6B@"
 
-// CHECK: define linkonce_odr i8* @"\01??_G?$Foo at H@@UEAAPEAXI at Z"(%struct.Foo* %this, i32 %should_call_delete)
+// CHECK: define linkonce_odr dso_local i8* @"\01??_G?$Foo at H@@UEAAPEAXI at Z"(%struct.Foo* %this, i32 %should_call_delete)
 
 struct Base {
   virtual ~Base();

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-member-pointers.cpp Fri Feb 23 11:30:48 2018
@@ -15,17 +15,17 @@ void PR26313_f(PR26313_FUNC *p) { delete
 struct PR26313_Z;
 int PR26313_Z::**a = nullptr;
 int PR26313_Z::*b = *a;
-// CHECK-DAG: @"\01?a@@3PAPQPR26313_Z@@HA" = global %0* null, align 4
-// CHECK-DAG: @"\01?b@@3PQPR26313_Z@@HQ1@" = global { i32, i32, i32 } { i32 0, i32 0, i32 -1 }, align 4
+// CHECK-DAG: @"\01?a@@3PAPQPR26313_Z@@HA" = dso_local global %0* null, align 4
+// CHECK-DAG: @"\01?b@@3PQPR26313_Z@@HQ1@" = dso_local global { i32, i32, i32 } { i32 0, i32 0, i32 -1 }, align 4
 
 namespace PR20947 {
 struct A;
 int A::**a = nullptr;
-// CHECK-DAG: @"\01?a at PR20947@@3PAPQA at 1@HA" = global %{{.*}}* null, align 4
+// CHECK-DAG: @"\01?a at PR20947@@3PAPQA at 1@HA" = dso_local global %{{.*}}* null, align 4
 
 struct B;
 int B::*&b = b;
-// CHECK-DAG: @"\01?b at PR20947@@3AAPQB at 1@HA" = global %{{.*}}* null, align 4
+// CHECK-DAG: @"\01?b at PR20947@@3AAPQB at 1@HA" = dso_local global %{{.*}}* null, align 4
 }
 
 namespace PR20017 {
@@ -35,7 +35,7 @@ struct A {
 };
 struct B;
 auto a = &A<B>::m_fn1;
-// CHECK-DAG: @"\01?a at PR20017@@3P8?$A at UB@PR20017@@@1 at AEPQB@1 at HXZQ21@" = global i8* bitcast ({ i32, i32, i32 } ({{.*}}*)* @"\01?m_fn1@?$A at UB@PR20017@@@PR20017@@QAEPQB at 2@HXZ" to i8*), align 4
+// CHECK-DAG: @"\01?a at PR20017@@3P8?$A at UB@PR20017@@@1 at AEPQB@1 at HXZQ21@" = dso_local global i8* bitcast ({ i32, i32, i32 } ({{.*}}*)* @"\01?m_fn1@?$A at UB@PR20017@@@PR20017@@QAEPQB at 2@HXZ" to i8*), align 4
 }
 
 #ifndef INCOMPLETE_VIRTUAL
@@ -89,24 +89,24 @@ int Virtual    ::*v_d_memptr;
 int NonZeroVBPtr::*n_d_memptr;
 int Unspecified::*u_d_memptr;
 int UnspecSingle::*us_d_memptr;
-// CHECK: @"\01?s_d_memptr@@3PQSingle@@HQ1@" = global i32 -1, align 4
-// CHECK: @"\01?p_d_memptr@@3PQPolymorphic@@HQ1@" = global i32 0, align 4
-// CHECK: @"\01?m_d_memptr@@3PQMultiple@@HQ1@" = global i32 -1, align 4
-// CHECK: @"\01?v_d_memptr@@3PQVirtual@@HQ1@" = global { i32, i32 }
+// CHECK: @"\01?s_d_memptr@@3PQSingle@@HQ1@" = dso_local global i32 -1, align 4
+// CHECK: @"\01?p_d_memptr@@3PQPolymorphic@@HQ1@" = dso_local global i32 0, align 4
+// CHECK: @"\01?m_d_memptr@@3PQMultiple@@HQ1@" = dso_local global i32 -1, align 4
+// CHECK: @"\01?v_d_memptr@@3PQVirtual@@HQ1@" = dso_local global { i32, i32 }
 // CHECK:   { i32 0, i32 -1 }, align 4
-// CHECK: @"\01?n_d_memptr@@3PQNonZeroVBPtr@@HQ1@" = global { i32, i32 }
+// CHECK: @"\01?n_d_memptr@@3PQNonZeroVBPtr@@HQ1@" = dso_local global { i32, i32 }
 // CHECK:   { i32 0, i32 -1 }, align 4
-// CHECK: @"\01?u_d_memptr@@3PQUnspecified@@HQ1@" = global { i32, i32, i32 }
+// CHECK: @"\01?u_d_memptr@@3PQUnspecified@@HQ1@" = dso_local global { i32, i32, i32 }
 // CHECK:   { i32 0, i32 0, i32 -1 }, align 4
-// CHECK: @"\01?us_d_memptr@@3PQUnspecSingle@@HQ1@" = global { i32, i32, i32 }
+// CHECK: @"\01?us_d_memptr@@3PQUnspecSingle@@HQ1@" = dso_local global { i32, i32, i32 }
 // CHECK:   { i32 0, i32 0, i32 -1 }, align 4
 
 void (Single  ::*s_f_memptr)();
 void (Multiple::*m_f_memptr)();
 void (Virtual ::*v_f_memptr)();
-// CHECK: @"\01?s_f_memptr@@3P8Single@@AEXXZQ1@" = global i8* null, align 4
-// CHECK: @"\01?m_f_memptr@@3P8Multiple@@AEXXZQ1@" = global { i8*, i32 } zeroinitializer, align 4
-// CHECK: @"\01?v_f_memptr@@3P8Virtual@@AEXXZQ1@" = global { i8*, i32, i32 } zeroinitializer, align 4
+// CHECK: @"\01?s_f_memptr@@3P8Single@@AEXXZQ1@" = dso_local global i8* null, align 4
+// CHECK: @"\01?m_f_memptr@@3P8Multiple@@AEXXZQ1@" = dso_local global { i8*, i32 } zeroinitializer, align 4
+// CHECK: @"\01?v_f_memptr@@3P8Virtual@@AEXXZQ1@" = dso_local global { i8*, i32, i32 } zeroinitializer, align 4
 
 // We can define Unspecified after locking in the inheritance model.
 struct Unspecified : Multiple, Virtual {
@@ -170,11 +170,11 @@ struct D : C {
 // Try a cast that changes the inheritance model.  Null for D is 0, but null for
 // C is -1.  We need the cast to long in order to hit the non-APValue path.
 int C::*ptr4 = (int C::*) (int D::*) (long D::*) 0;
-// CHECK: @"\01?ptr4 at CastParam@@3PQC at 1@HQ21@" = global i32 -1, align 4
+// CHECK: @"\01?ptr4 at CastParam@@3PQC at 1@HQ21@" = dso_local global i32 -1, align 4
 
 // MSVC rejects this but we accept it.
 int C::*ptr5 = (int C::*) (long D::*) 0;
-// CHECK: @"\01?ptr5 at CastParam@@3PQC at 1@HQ21@" = global i32 -1, align 4
+// CHECK: @"\01?ptr5 at CastParam@@3PQC at 1@HQ21@" = dso_local global i32 -1, align 4
 }
 
 struct UnspecWithVBPtr;
@@ -191,7 +191,7 @@ void EmitNonVirtualMemberPointers() {
   void (Virtual    ::*v_f_memptr)() = &Virtual::foo;
   void (Unspecified::*u_f_memptr)() = &Unspecified::foo;
   void (UnspecWithVBPtr::*u2_f_memptr)() = &UnspecWithVBPtr::foo;
-// CHECK: define void @"\01?EmitNonVirtualMemberPointers@@YAXXZ"() {{.*}} {
+// CHECK: define dso_local void @"\01?EmitNonVirtualMemberPointers@@YAXXZ"() {{.*}} {
 // CHECK:   alloca i8*, align 4
 // CHECK:   alloca { i8*, i32 }, align 4
 // CHECK:   alloca { i8*, i32, i32 }, align 4
@@ -221,7 +221,7 @@ void podMemPtrs() {
   if (memptr)
     memptr = 0;
 // Check that member pointers use the right offsets and that null is -1.
-// CHECK:      define void @"\01?podMemPtrs@@YAXXZ"() {{.*}} {
+// CHECK:      define dso_local void @"\01?podMemPtrs@@YAXXZ"() {{.*}} {
 // CHECK:        %[[memptr:.*]] = alloca i32, align 4
 // CHECK-NEXT:   store i32 0, i32* %[[memptr]], align 4
 // CHECK-NEXT:   store i32 4, i32* %[[memptr]], align 4
@@ -241,7 +241,7 @@ void polymorphicMemPtrs() {
     memptr = 0;
 // Member pointers for polymorphic classes include the vtable slot in their
 // offset and use 0 to represent null.
-// CHECK:      define void @"\01?polymorphicMemPtrs@@YAXXZ"() {{.*}} {
+// CHECK:      define dso_local void @"\01?polymorphicMemPtrs@@YAXXZ"() {{.*}} {
 // CHECK:        %[[memptr:.*]] = alloca i32, align 4
 // CHECK-NEXT:   store i32 4, i32* %[[memptr]], align 4
 // CHECK-NEXT:   store i32 8, i32* %[[memptr]], align 4
@@ -255,7 +255,7 @@ void polymorphicMemPtrs() {
 
 bool nullTestDataUnspecified(int Unspecified::*mp) {
   return mp;
-// CHECK: define zeroext i1 @"\01?nullTestDataUnspecified@@YA_NPQUnspecified@@H at Z"{{.*}} {
+// CHECK: define dso_local zeroext i1 @"\01?nullTestDataUnspecified@@YA_NPQUnspecified@@H at Z"{{.*}} {
 // CHECK:   %{{.*}} = load { i32, i32, i32 }, { i32, i32, i32 }* %{{.*}}, align 4
 // CHECK:   store { i32, i32, i32 } {{.*}} align 4
 // CHECK:   %[[mp:.*]] = load { i32, i32, i32 }, { i32, i32, i32 }* %{{.*}}, align 4
@@ -271,13 +271,13 @@ bool nullTestDataUnspecified(int Unspeci
 // CHECK: }
 
 // Pass this large type indirectly.
-// X64-LABEL: define zeroext i1 @"\01?nullTestDataUnspecified@@
+// X64-LABEL: define dso_local zeroext i1 @"\01?nullTestDataUnspecified@@
 // X64:             ({ i32, i32, i32 }*)
 }
 
 bool nullTestFunctionUnspecified(void (Unspecified::*mp)()) {
   return mp;
-// CHECK: define zeroext i1 @"\01?nullTestFunctionUnspecified@@YA_NP8Unspecified@@AEXXZ at Z"{{.*}} {
+// CHECK: define dso_local zeroext i1 @"\01?nullTestFunctionUnspecified@@YA_NP8Unspecified@@AEXXZ at Z"{{.*}} {
 // CHECK:   %{{.*}} = load { i8*, i32, i32, i32 }, { i8*, i32, i32, i32 }* %{{.*}}, align 4
 // CHECK:   store { i8*, i32, i32, i32 } {{.*}} align 4
 // CHECK:   %[[mp:.*]] = load { i8*, i32, i32, i32 }, { i8*, i32, i32, i32 }* %{{.*}}, align 4
@@ -291,7 +291,7 @@ int loadDataMemberPointerVirtual(Virtual
   return o->*memptr;
 // Test that we can unpack this aggregate member pointer and load the member
 // data pointer.
-// CHECK: define i32 @"\01?loadDataMemberPointerVirtual@@YAHPAUVirtual@@PQ1 at H@Z"{{.*}} {
+// CHECK: define dso_local i32 @"\01?loadDataMemberPointerVirtual@@YAHPAUVirtual@@PQ1 at H@Z"{{.*}} {
 // CHECK:   %[[o:.*]] = load %{{.*}}*, %{{.*}}** %{{.*}}, align 4
 // CHECK:   %[[memptr:.*]] = load { i32, i32 }, { i32, i32 }* %{{.*}}, align 4
 // CHECK:   %[[memptr0:.*]] = extractvalue { i32, i32 } %[[memptr:.*]], 0
@@ -312,7 +312,7 @@ int loadDataMemberPointerVirtual(Virtual
 
 // A two-field data memptr on x64 gets coerced to i64 and is passed in a
 // register or memory.
-// X64-LABEL: define i32 @"\01?loadDataMemberPointerVirtual@@YAHPEAUVirtual@@PEQ1 at H@Z"
+// X64-LABEL: define dso_local i32 @"\01?loadDataMemberPointerVirtual@@YAHPEAUVirtual@@PEQ1 at H@Z"
 // X64:             (%struct.Virtual* %o, i64 %memptr.coerce)
 }
 
@@ -320,7 +320,7 @@ int loadDataMemberPointerUnspecified(Uns
   return o->*memptr;
 // Test that we can unpack this aggregate member pointer and load the member
 // data pointer.
-// CHECK: define i32 @"\01?loadDataMemberPointerUnspecified@@YAHPAUUnspecified@@PQ1 at H@Z"{{.*}} {
+// CHECK: define dso_local i32 @"\01?loadDataMemberPointerUnspecified@@YAHPAUUnspecified@@PQ1 at H@Z"{{.*}} {
 // CHECK:   %[[o:.*]] = load %{{.*}}*, %{{.*}}** %{{.*}}, align 4
 // CHECK:   %[[memptr:.*]] = load { i32, i32, i32 }, { i32, i32, i32 }* %{{.*}}, align 4
 // CHECK:   %[[memptr0:.*]] = extractvalue { i32, i32, i32 } %[[memptr:.*]], 0
@@ -351,12 +351,12 @@ int loadDataMemberPointerUnspecified(Uns
 void callMemberPointerSingle(Single *o, void (Single::*memptr)()) {
   (o->*memptr)();
 // Just look for an indirect thiscall.
-// CHECK: define void @"\01?callMemberPointerSingle@@{{.*}} {{.*}} {
+// CHECK: define dso_local void @"\01?callMemberPointerSingle@@{{.*}} {{.*}} {
 // CHECK:   call x86_thiscallcc void %{{.*}}(%{{.*}} %{{.*}})
 // CHECK:   ret void
 // CHECK: }
 
-// X64-LABEL: define void @"\01?callMemberPointerSingle@@
+// X64-LABEL: define dso_local void @"\01?callMemberPointerSingle@@
 // X64:           (%struct.Single* %o, i8* %memptr)
 // X64:   bitcast i8* %{{[^ ]*}} to void (%struct.Single*)*
 // X64:   ret void
@@ -364,7 +364,7 @@ void callMemberPointerSingle(Single *o,
 
 void callMemberPointerMultiple(Multiple *o, void (Multiple::*memptr)()) {
   (o->*memptr)();
-// CHECK: define void @"\01?callMemberPointerMultiple@@{{.*}} {
+// CHECK: define dso_local void @"\01?callMemberPointerMultiple@@{{.*}} {
 // CHECK:   %[[memptr0:.*]] = extractvalue { i8*, i32 } %{{.*}}, 0
 // CHECK:   %[[memptr1:.*]] = extractvalue { i8*, i32 } %{{.*}}, 1
 // CHECK:   %[[this_adjusted:.*]] = getelementptr inbounds i8, i8* %{{.*}}, i32 %[[memptr1]]
@@ -378,7 +378,7 @@ void callMemberPointerMultiple(Multiple
 void callMemberPointerVirtualBase(Virtual *o, void (Virtual::*memptr)()) {
   (o->*memptr)();
 // This shares a lot with virtual data member pointers.
-// CHECK: define void @"\01?callMemberPointerVirtualBase@@{{.*}} {
+// CHECK: define dso_local void @"\01?callMemberPointerVirtualBase@@{{.*}} {
 // CHECK:   %[[memptr0:.*]] = extractvalue { i8*, i32, i32 } %{{.*}}, 0
 // CHECK:   %[[memptr1:.*]] = extractvalue { i8*, i32, i32 } %{{.*}}, 1
 // CHECK:   %[[memptr2:.*]] = extractvalue { i8*, i32, i32 } %{{.*}}, 2
@@ -400,21 +400,21 @@ void callMemberPointerVirtualBase(Virtua
 bool compareSingleFunctionMemptr(void (Single::*l)(), void (Single::*r)()) {
   return l == r;
 // Should only be one comparison here.
-// CHECK: define zeroext i1 @"\01?compareSingleFunctionMemptr@@YA_NP8Single@@AEXXZ0 at Z"{{.*}} {
+// CHECK: define dso_local zeroext i1 @"\01?compareSingleFunctionMemptr@@YA_NP8Single@@AEXXZ0 at Z"{{.*}} {
 // CHECK-NOT: icmp
 // CHECK:   %[[r:.*]] = icmp eq
 // CHECK-NOT: icmp
 // CHECK:   ret i1 %[[r]]
 // CHECK: }
 
-// X64-LABEL: define zeroext i1 @"\01?compareSingleFunctionMemptr@@
+// X64-LABEL: define dso_local zeroext i1 @"\01?compareSingleFunctionMemptr@@
 // X64:             (i8* %{{[^,]*}}, i8* %{{[^)]*}})
 }
 
 bool compareNeqSingleFunctionMemptr(void (Single::*l)(), void (Single::*r)()) {
   return l != r;
 // Should only be one comparison here.
-// CHECK: define zeroext i1 @"\01?compareNeqSingleFunctionMemptr@@YA_NP8Single@@AEXXZ0 at Z"{{.*}} {
+// CHECK: define dso_local zeroext i1 @"\01?compareNeqSingleFunctionMemptr@@YA_NP8Single@@AEXXZ0 at Z"{{.*}} {
 // CHECK-NOT: icmp
 // CHECK:   %[[r:.*]] = icmp ne
 // CHECK-NOT: icmp
@@ -424,7 +424,7 @@ bool compareNeqSingleFunctionMemptr(void
 
 bool unspecFuncMemptrEq(void (Unspecified::*l)(), void (Unspecified::*r)()) {
   return l == r;
-// CHECK: define zeroext i1 @"\01?unspecFuncMemptrEq@@YA_NP8Unspecified@@AEXXZ0 at Z"{{.*}} {
+// CHECK: define dso_local zeroext i1 @"\01?unspecFuncMemptrEq@@YA_NP8Unspecified@@AEXXZ0 at Z"{{.*}} {
 // CHECK:   %[[lhs0:.*]] = extractvalue { i8*, i32, i32, i32 } %[[l:.*]], 0
 // CHECK:   %{{.*}} = extractvalue { i8*, i32, i32, i32 } %[[r:.*]], 0
 // CHECK:   %[[cmp0:.*]] = icmp eq i8* %[[lhs0]], %{{.*}}
@@ -445,13 +445,13 @@ bool unspecFuncMemptrEq(void (Unspecifie
 // CHECK:   ret i1 %{{.*}}
 // CHECK: }
 
-// X64-LABEL: define zeroext i1 @"\01?unspecFuncMemptrEq@@
+// X64-LABEL: define dso_local zeroext i1 @"\01?unspecFuncMemptrEq@@
 // X64:             ({ i8*, i32, i32, i32 }*, { i8*, i32, i32, i32 }*)
 }
 
 bool unspecFuncMemptrNeq(void (Unspecified::*l)(), void (Unspecified::*r)()) {
   return l != r;
-// CHECK: define zeroext i1 @"\01?unspecFuncMemptrNeq@@YA_NP8Unspecified@@AEXXZ0 at Z"{{.*}} {
+// CHECK: define dso_local zeroext i1 @"\01?unspecFuncMemptrNeq@@YA_NP8Unspecified@@AEXXZ0 at Z"{{.*}} {
 // CHECK:   %[[lhs0:.*]] = extractvalue { i8*, i32, i32, i32 } %[[l:.*]], 0
 // CHECK:   %{{.*}} = extractvalue { i8*, i32, i32, i32 } %[[r:.*]], 0
 // CHECK:   %[[cmp0:.*]] = icmp ne i8* %[[lhs0]], %{{.*}}
@@ -475,7 +475,7 @@ bool unspecFuncMemptrNeq(void (Unspecifi
 
 bool unspecDataMemptrEq(int Unspecified::*l, int Unspecified::*r) {
   return l == r;
-// CHECK: define zeroext i1 @"\01?unspecDataMemptrEq@@YA_NPQUnspecified@@H0 at Z"{{.*}} {
+// CHECK: define dso_local zeroext i1 @"\01?unspecDataMemptrEq@@YA_NPQUnspecified@@H0 at Z"{{.*}} {
 // CHECK:   extractvalue { i32, i32, i32 } %{{.*}}, 0
 // CHECK:   extractvalue { i32, i32, i32 } %{{.*}}, 0
 // CHECK:   icmp eq i32
@@ -490,13 +490,13 @@ bool unspecDataMemptrEq(int Unspecified:
 // CHECK:   ret i1
 // CHECK: }
 
-// X64-LABEL: define zeroext i1 @"\01?unspecDataMemptrEq@@
+// X64-LABEL: define dso_local zeroext i1 @"\01?unspecDataMemptrEq@@
 // X64:             ({ i32, i32, i32 }*, { i32, i32, i32 }*)
 }
 
 void (Multiple::*convertB2FuncToMultiple(void (B2::*mp)()))() {
   return mp;
-// CHECK: define i64 @"\01?convertB2FuncToMultiple@@YAP8Multiple@@AEXXZP8B2@@AEXXZ at Z"{{.*}} {
+// CHECK: define dso_local i64 @"\01?convertB2FuncToMultiple@@YAP8Multiple@@AEXXZP8B2@@AEXXZ at Z"{{.*}} {
 // CHECK:   store
 // CHECK:   %[[mp:.*]] = load i8*, i8** %{{.*}}, align 4
 // CHECK:   icmp ne i8* %[[mp]], null
@@ -520,7 +520,7 @@ void (B2::*convertMultipleFuncToB2(void
 // LLVM from optimizing away the branch.  This is likely a bug in
 // lib/CodeGen/TargetInfo.cpp with how we classify memptr types for returns.
 //
-// CHECK: define i32 @"\01?convertMultipleFuncToB2@@YAP8B2@@AEXXZP8Multiple@@AEXXZ at Z"{{.*}} {
+// CHECK: define dso_local i32 @"\01?convertMultipleFuncToB2@@YAP8B2@@AEXXZP8Multiple@@AEXXZ at Z"{{.*}} {
 // CHECK:   store
 // CHECK:   %[[src:.*]] = load { i8*, i32 }, { i8*, i32 }* %{{.*}}, align 4
 // CHECK:   extractvalue { i8*, i32 } %[[src]], 0
@@ -545,7 +545,7 @@ struct D : B, C { int d; };
 
 void (D::*convertCToD(void (C::*mp)()))() {
   return mp;
-// CHECK: define void @"\01?convertCToD at Test1@@YAP8D at 1@AEXXZP8C at 1@AEXXZ at Z"{{.*}} {
+// CHECK: define dso_local void @"\01?convertCToD at Test1@@YAP8D at 1@AEXXZP8C at 1@AEXXZ at Z"{{.*}} {
 // CHECK:   store
 // CHECK:   load { i8*, i32, i32 }, { i8*, i32, i32 }* %{{.*}}, align 4
 // CHECK:   extractvalue { i8*, i32, i32 } %{{.*}}, 0
@@ -585,7 +585,7 @@ struct C : A {
 
 int A::*reinterpret(int B::*mp) {
   return reinterpret_cast<int A::*>(mp);
-// CHECK: define i32 @"\01?reinterpret at Test2@@YAPQA at 1@HPQB at 1@H at Z"{{.*}}  {
+// CHECK: define dso_local i32 @"\01?reinterpret at Test2@@YAPQA at 1@HPQB at 1@H at Z"{{.*}}  {
 // CHECK-NOT: select
 // CHECK:   ret i32
 // CHECK: }
@@ -593,7 +593,7 @@ int A::*reinterpret(int B::*mp) {
 
 int A::*reinterpret(int C::*mp) {
   return reinterpret_cast<int A::*>(mp);
-// CHECK: define i32 @"\01?reinterpret at Test2@@YAPQA at 1@HPQC at 1@H at Z"{{.*}}  {
+// CHECK: define dso_local i32 @"\01?reinterpret at Test2@@YAPQA at 1@HPQC at 1@H at Z"{{.*}}  {
 // CHECK:   %[[mp:.*]] = load i32, i32*
 // CHECK:   %[[cmp:.*]] = icmp ne i32 %[[mp]], 0
 // CHECK:   select i1 %[[cmp]], i32 %[[mp]], i32 -1
@@ -612,7 +612,7 @@ struct A {
 
 int *load_data(A *a, int A::*mp) {
   return &(a->*mp);
-// CHECK-LABEL: define i32* @"\01?load_data at Test3@@YAPAHPAUA at 1@PQ21 at H@Z"{{.*}}  {
+// CHECK-LABEL: define dso_local i32* @"\01?load_data at Test3@@YAPAHPAUA at 1@PQ21 at H@Z"{{.*}}  {
 // CHECK:    %[[a:.*]] = load %"struct.Test3::A"*, %"struct.Test3::A"** %{{.*}}, align 4
 // CHECK:    %[[mp:.*]] = load i32, i32* %{{.*}}, align 4
 // CHECK:    %[[a_i8:.*]] = bitcast %"struct.Test3::A"* %[[a]] to i8*
@@ -631,7 +631,7 @@ struct C : A, B { virtual void g(); };
 void (C::*getmp())() {
   return &C::g;
 }
-// CHECK-LABEL: define i64 @"\01?getmp at Test4@@YAP8C at 1@AEXXZXZ"()
+// CHECK-LABEL: define dso_local i64 @"\01?getmp at Test4@@YAP8C at 1@AEXXZXZ"()
 // CHECK: store { i8*, i32 } { i8* bitcast (void (%"struct.Test4::C"*, ...)* @"\01??_9C at Test4@@$BA at AE" to i8*), i32 4 }, { i8*, i32 }* %{{.*}}
 //
 
@@ -651,7 +651,7 @@ struct A {
 };
 struct B : public A {};
 void test() { void (B::*a)() = &B::f; }
-// CHECK-LABEL: define void @"\01?test at pr20007@@YAXXZ"
+// CHECK-LABEL: define dso_local void @"\01?test at pr20007@@YAXXZ"
 // CHECK: store i8* bitcast (void (%"struct.pr20007::A"*)* @"\01?f at A@pr20007@@QAEXXZ" to i8*)
 }
 
@@ -663,7 +663,7 @@ struct A {
 struct __single_inheritance B;
 struct B : public A {};
 void test() { void (B::*a)() = &B::f; }
-// CHECK-LABEL: define void @"\01?test at pr20007_kw@@YAXXZ"
+// CHECK-LABEL: define dso_local void @"\01?test at pr20007_kw@@YAXXZ"
 // CHECK: store i8* bitcast (void (%"struct.pr20007_kw::A"*)* @"\01?f at A@pr20007_kw@@QAEXXZ" to i8*)
 }
 
@@ -678,7 +678,7 @@ void test() { (void)(void (B::*)()) &B::
 static_assert(sizeof(int B::*) == 4, "");
 static_assert(sizeof(int A::*) == 4, "");
 #pragma pointers_to_members(best_case)
-// CHECK-LABEL: define void @"\01?test at pr20007_pragma@@YAXXZ"
+// CHECK-LABEL: define dso_local void @"\01?test at pr20007_pragma@@YAXXZ"
 }
 
 namespace pr20007_pragma2 {
@@ -692,7 +692,7 @@ void test() { (void)&B::f; }
 static_assert(sizeof(int B::*) == 4, "");
 static_assert(sizeof(int A::*) == 12, "");
 #pragma pointers_to_members(best_case)
-// CHECK-LABEL: define void @"\01?test at pr20007_pragma2@@YAXXZ"
+// CHECK-LABEL: define dso_local void @"\01?test at pr20007_pragma2@@YAXXZ"
 }
 
 namespace pr23823 {
@@ -738,7 +738,7 @@ struct D : A, C {};
 
 typedef void (D::*DMemPtrTy)();
 
-// CHECK-LABEL: define void @"\01?get_memptr at pr23878@@YAP8D at 1@AEXXZXZ"
+// CHECK-LABEL: define dso_local void @"\01?get_memptr at pr23878@@YAP8D at 1@AEXXZXZ"
 // CHECK: @"\01??_9C at pr23878@@$BA at AE" to i8*), i32 0, i32 4
 DMemPtrTy get_memptr() { return &D::f; }
 }
@@ -762,7 +762,7 @@ namespace PR24703 {
 struct S;
 
 void f(int S::*&p) {}
-// CHECK-LABEL: define void @"\01?f at PR24703@@YAXAAPQS at 1@H at Z"(
+// CHECK-LABEL: define dso_local void @"\01?f at PR24703@@YAXAAPQS at 1@H at Z"(
 }
 
 namespace ReferenceToMPTWithIncompleteClass {

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-methods.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-methods.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-methods.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-methods.cpp Fri Feb 23 11:30:48 2018
@@ -22,7 +22,7 @@ void call_simple_method() {
 // CHECK: ret
 
 // Make sure that the definition uses the right calling convention:
-// CHECK: define linkonce_odr x86_thiscallcc void @"\01?simple_method at C@@QAEXXZ"
+// CHECK: define linkonce_odr dso_local x86_thiscallcc void @"\01?simple_method at C@@QAEXXZ"
 // CHECK: ret
 }
 
@@ -34,7 +34,7 @@ void call_cdecl_method() {
 // CHECK: ret
 
 // Make sure that the definition uses the right calling convention:
-// CHECK: define linkonce_odr void @"\01?cdecl_method at C@@QAAXXZ"
+// CHECK: define linkonce_odr dso_local void @"\01?cdecl_method at C@@QAAXXZ"
 // CHECK: ret
 }
 
@@ -46,7 +46,7 @@ void call_vararg_method() {
 // CHECK: ret
 
 // Make sure that the definition uses the right calling convention:
-// CHECK: define linkonce_odr void @"\01?vararg_method at C@@QAAXPBDZZ"
+// CHECK: define linkonce_odr dso_local void @"\01?vararg_method at C@@QAAXPBDZZ"
 }
 
 void call_static_method() {
@@ -56,7 +56,7 @@ void call_static_method() {
 // CHECK: ret
 
 // Make sure that the definition uses the right calling convention:
-// CHECK: define linkonce_odr void @"\01?static_method at C@@SAXXZ"
+// CHECK: define linkonce_odr dso_local void @"\01?static_method at C@@SAXXZ"
 }
 
 class Base {
@@ -71,19 +71,19 @@ void constructors() {
   Child c;
 // Make sure that the Base constructor call in the Child constructor uses
 // the right calling convention:
-// CHECK: define linkonce_odr x86_thiscallcc %class.Child* @"\01??0Child@@QAE at XZ"
+// CHECK: define linkonce_odr dso_local x86_thiscallcc %class.Child* @"\01??0Child@@QAE at XZ"
 // CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc %class.Base* @"\01??0Base@@QAE at XZ"
 // CHECK: ret
 
 // Make sure that the Base constructor definition uses the right CC:
-// CHECK: define linkonce_odr x86_thiscallcc %class.Base* @"\01??0Base@@QAE at XZ"
+// CHECK: define linkonce_odr dso_local x86_thiscallcc %class.Base* @"\01??0Base@@QAE at XZ"
 
 // Make sure that the Base destructor call in the Child denstructor uses
 // the right calling convention:
-// CHECK: define linkonce_odr x86_thiscallcc void @"\01??1Child@@QAE at XZ"
+// CHECK: define linkonce_odr dso_local x86_thiscallcc void @"\01??1Child@@QAE at XZ"
 // CHECK: call x86_thiscallcc void @"\01??1Base@@QAE at XZ"
 // CHECK: ret
 
 // Make sure that the Base destructor definition uses the right CC:
-// CHECK: define linkonce_odr x86_thiscallcc void @"\01??1Base@@QAE at XZ"
+// CHECK: define linkonce_odr dso_local x86_thiscallcc void @"\01??1Base@@QAE at XZ"
 }

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp Fri Feb 23 11:30:48 2018
@@ -19,7 +19,7 @@ struct ChildOverride : Left, Right {
 extern "C" void foo(void *);
 
 void call_left_no_override(ChildNoOverride *child) {
-// CHECK-LABEL: define void @"\01?call_left_no_override
+// CHECK-LABEL: define dso_local void @"\01?call_left_no_override
 // CHECK: %[[CHILD:.*]] = load %struct.ChildNoOverride
 
   child->left();
@@ -34,7 +34,7 @@ void call_left_no_override(ChildNoOverri
 }
 
 void ChildOverride::left() {
-// CHECK-LABEL: define x86_thiscallcc void @"\01?left at ChildOverride@@UAEXXZ"
+// CHECK-LABEL: define dso_local x86_thiscallcc void @"\01?left at ChildOverride@@UAEXXZ"
 // CHECK-SAME: (%struct.ChildOverride* %[[THIS:.*]])
 //
 // No need to adjust 'this' as the ChildOverride's layout begins with Left.
@@ -49,7 +49,7 @@ void ChildOverride::left() {
 }
 
 void call_left_override(ChildOverride *child) {
-// CHECK-LABEL: define void @"\01?call_left_override
+// CHECK-LABEL: define dso_local void @"\01?call_left_override
 // CHECK: %[[CHILD:.*]] = load %struct.ChildOverride
 
   child->left();
@@ -63,7 +63,7 @@ void call_left_override(ChildOverride *c
 }
 
 void call_right_no_override(ChildNoOverride *child) {
-// CHECK-LABEL: define void @"\01?call_right_no_override
+// CHECK-LABEL: define dso_local void @"\01?call_right_no_override
 // CHECK: %[[CHILD:.*]] = load %struct.ChildNoOverride
 
   child->right();
@@ -83,7 +83,7 @@ void call_right_no_override(ChildNoOverr
 }
 
 void ChildOverride::right() {
-// CHECK-LABEL: define x86_thiscallcc void @"\01?right at ChildOverride@@UAEXXZ"(i8*
+// CHECK-LABEL: define dso_local x86_thiscallcc void @"\01?right at ChildOverride@@UAEXXZ"(i8*
 //
 // ChildOverride::right gets 'this' cast to Right* in ECX (i.e. this+4) so we
 // need to adjust 'this' before use.
@@ -106,7 +106,7 @@ void ChildOverride::right() {
 }
 
 void call_right_override(ChildOverride *child) {
-// CHECK-LABEL: define void @"\01?call_right_override
+// CHECK-LABEL: define dso_local void @"\01?call_right_override
 // CHECK: %[[CHILD:.*]] = load %struct.ChildOverride
 
   child->right();
@@ -132,7 +132,7 @@ struct GrandchildOverride : ChildOverrid
 };
 
 void GrandchildOverride::right() {
-// CHECK-LABEL: define x86_thiscallcc void @"\01?right at GrandchildOverride@@UAEXXZ"(i8*
+// CHECK-LABEL: define dso_local x86_thiscallcc void @"\01?right at GrandchildOverride@@UAEXXZ"(i8*
 //
 // CHECK: %[[THIS_STORE:.*]] = alloca %struct.GrandchildOverride*, align 4
 // CHECK: %[[THIS_ADDR:.*]] = alloca %struct.GrandchildOverride*, align 4
@@ -202,7 +202,7 @@ struct AsymmetricChild : LeftWithNonVirt
 };
 
 void call_asymmetric_child_complete_dtor() {
-  // CHECK-LABEL: define void @"\01?call_asymmetric_child_complete_dtor@@YAXXZ"
+  // CHECK-LABEL: define dso_local void @"\01?call_asymmetric_child_complete_dtor@@YAXXZ"
   AsymmetricChild obj;
   // CHECK: call x86_thiscallcc %struct.AsymmetricChild* @"\01??0AsymmetricChild@@QAE at XZ"(%struct.AsymmetricChild* %[[OBJ:.*]])
   // CHECK-NOT: getelementptr

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp Fri Feb 23 11:30:48 2018
@@ -68,7 +68,7 @@ struct BaseNoByval : Small {
   int bb;
 };
 
-// WIN32: declare void @"{{.*take_bools_and_chars.*}}"
+// WIN32: declare dso_local void @"{{.*take_bools_and_chars.*}}"
 // WIN32:       (<{ i8, [3 x i8], i8, [3 x i8], %struct.SmallWithDtor,
 // WIN32:           i8, [3 x i8], i8, [3 x i8], i32, i8, [3 x i8] }>* inalloca)
 void take_bools_and_chars(char a, char b, SmallWithDtor c, char d, bool e, int f, bool g);
@@ -79,93 +79,93 @@ void call_bools_and_chars() {
 // Returning structs that fit into a register.
 Small small_return() { return Small(); }
 // LINUX-LABEL: define void @_Z12small_returnv(%struct.Small* noalias sret %agg.result)
-// WIN32: define i32 @"\01?small_return@@YA?AUSmall@@XZ"()
-// WIN64: define i32 @"\01?small_return@@YA?AUSmall@@XZ"()
+// WIN32: define dso_local i32 @"\01?small_return@@YA?AUSmall@@XZ"()
+// WIN64: define dso_local i32 @"\01?small_return@@YA?AUSmall@@XZ"()
 
 Medium medium_return() { return Medium(); }
 // LINUX-LABEL: define void @_Z13medium_returnv(%struct.Medium* noalias sret %agg.result)
-// WIN32: define i64 @"\01?medium_return@@YA?AUMedium@@XZ"()
-// WIN64: define i64 @"\01?medium_return@@YA?AUMedium@@XZ"()
+// WIN32: define dso_local i64 @"\01?medium_return@@YA?AUMedium@@XZ"()
+// WIN64: define dso_local i64 @"\01?medium_return@@YA?AUMedium@@XZ"()
 
 // Returning structs that fit into a register but are not POD.
 SmallCpp11NotCpp03Pod small_non_pod_return() { return SmallCpp11NotCpp03Pod(); }
 // LINUX-LABEL: define void @_Z20small_non_pod_returnv(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result)
-// WIN32: define void @"\01?small_non_pod_return@@YA?AUSmallCpp11NotCpp03Pod@@XZ"(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result)
-// WIN64: define void @"\01?small_non_pod_return@@YA?AUSmallCpp11NotCpp03Pod@@XZ"(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result)
+// WIN32: define dso_local void @"\01?small_non_pod_return@@YA?AUSmallCpp11NotCpp03Pod@@XZ"(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result)
+// WIN64: define dso_local void @"\01?small_non_pod_return@@YA?AUSmallCpp11NotCpp03Pod@@XZ"(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result)
 
 SmallWithCtor small_with_ctor_return() { return SmallWithCtor(); }
 // LINUX-LABEL: define void @_Z22small_with_ctor_returnv(%struct.SmallWithCtor* noalias sret %agg.result)
-// WIN32: define void @"\01?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result)
-// WIN64: define void @"\01?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result)
+// WIN32: define dso_local void @"\01?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result)
+// WIN64: define dso_local void @"\01?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result)
 // FIXME: The 'sret' mark here doesn't seem to be enough to convince LLVM to
 // preserve the hidden sret pointer in R0 across the function.
-// WOA: define arm_aapcs_vfpcc void @"\01?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result)
+// WOA: define dso_local arm_aapcs_vfpcc void @"\01?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result)
 
 SmallWithVftable small_with_vftable_return() { return SmallWithVftable(); }
 // LINUX-LABEL: define void @_Z25small_with_vftable_returnv(%struct.SmallWithVftable* noalias sret %agg.result)
-// WIN32: define void @"\01?small_with_vftable_return@@YA?AUSmallWithVftable@@XZ"(%struct.SmallWithVftable* noalias sret %agg.result)
-// WIN64: define void @"\01?small_with_vftable_return@@YA?AUSmallWithVftable@@XZ"(%struct.SmallWithVftable* noalias sret %agg.result)
+// WIN32: define dso_local void @"\01?small_with_vftable_return@@YA?AUSmallWithVftable@@XZ"(%struct.SmallWithVftable* noalias sret %agg.result)
+// WIN64: define dso_local void @"\01?small_with_vftable_return@@YA?AUSmallWithVftable@@XZ"(%struct.SmallWithVftable* noalias sret %agg.result)
 
 MediumWithCopyCtor medium_with_copy_ctor_return() { return MediumWithCopyCtor(); }
 // LINUX-LABEL: define void @_Z28medium_with_copy_ctor_returnv(%struct.MediumWithCopyCtor* noalias sret %agg.result)
-// WIN32: define void @"\01?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result)
-// WIN64: define void @"\01?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result)
-// WOA: define arm_aapcs_vfpcc void @"\01?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result)
+// WIN32: define dso_local void @"\01?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result)
+// WIN64: define dso_local void @"\01?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result)
+// WOA: define dso_local arm_aapcs_vfpcc void @"\01?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result)
 
 // Returning a large struct that doesn't fit into a register.
 Big big_return() { return Big(); }
 // LINUX-LABEL: define void @_Z10big_returnv(%struct.Big* noalias sret %agg.result)
-// WIN32: define void @"\01?big_return@@YA?AUBig@@XZ"(%struct.Big* noalias sret %agg.result)
-// WIN64: define void @"\01?big_return@@YA?AUBig@@XZ"(%struct.Big* noalias sret %agg.result)
+// WIN32: define dso_local void @"\01?big_return@@YA?AUBig@@XZ"(%struct.Big* noalias sret %agg.result)
+// WIN64: define dso_local void @"\01?big_return@@YA?AUBig@@XZ"(%struct.Big* noalias sret %agg.result)
 
 
 void small_arg(Small s) {}
 // LINUX-LABEL: define void @_Z9small_arg5Small(i32 %s.0)
-// WIN32: define void @"\01?small_arg@@YAXUSmall@@@Z"(i32 %s.0)
-// WIN64: define void @"\01?small_arg@@YAXUSmall@@@Z"(i32 %s.coerce)
-// WOA: define arm_aapcs_vfpcc void @"\01?small_arg@@YAXUSmall@@@Z"([1 x i32] %s.coerce)
+// WIN32: define dso_local void @"\01?small_arg@@YAXUSmall@@@Z"(i32 %s.0)
+// WIN64: define dso_local void @"\01?small_arg@@YAXUSmall@@@Z"(i32 %s.coerce)
+// WOA: define dso_local arm_aapcs_vfpcc void @"\01?small_arg@@YAXUSmall@@@Z"([1 x i32] %s.coerce)
 
 void medium_arg(Medium s) {}
 // LINUX-LABEL: define void @_Z10medium_arg6Medium(i32 %s.0, i32 %s.1)
-// WIN32: define void @"\01?medium_arg@@YAXUMedium@@@Z"(i32 %s.0, i32 %s.1)
-// WIN64: define void @"\01?medium_arg@@YAXUMedium@@@Z"(i64 %s.coerce)
-// WOA: define arm_aapcs_vfpcc void @"\01?medium_arg@@YAXUMedium@@@Z"([2 x i32] %s.coerce)
+// WIN32: define dso_local void @"\01?medium_arg@@YAXUMedium@@@Z"(i32 %s.0, i32 %s.1)
+// WIN64: define dso_local void @"\01?medium_arg@@YAXUMedium@@@Z"(i64 %s.coerce)
+// WOA: define dso_local arm_aapcs_vfpcc void @"\01?medium_arg@@YAXUMedium@@@Z"([2 x i32] %s.coerce)
 
 void base_no_byval_arg(BaseNoByval s) {}
 // LINUX-LABEL: define void @_Z17base_no_byval_arg11BaseNoByval(%struct.BaseNoByval* byval align 4 %s)
-// WIN32: define void @"\01?base_no_byval_arg@@YAXUBaseNoByval@@@Z"(i32 %s.0, i32 %s.1)
-// WIN64: define void @"\01?base_no_byval_arg@@YAXUBaseNoByval@@@Z"(i64 %s.coerce)
-// WOA: define arm_aapcs_vfpcc void @"\01?base_no_byval_arg@@YAXUBaseNoByval@@@Z"([2 x i32] %s.coerce)
+// WIN32: define dso_local void @"\01?base_no_byval_arg@@YAXUBaseNoByval@@@Z"(i32 %s.0, i32 %s.1)
+// WIN64: define dso_local void @"\01?base_no_byval_arg@@YAXUBaseNoByval@@@Z"(i64 %s.coerce)
+// WOA: define dso_local arm_aapcs_vfpcc void @"\01?base_no_byval_arg@@YAXUBaseNoByval@@@Z"([2 x i32] %s.coerce)
 
 void small_arg_with_ctor(SmallWithCtor s) {}
 // LINUX-LABEL: define void @_Z19small_arg_with_ctor13SmallWithCtor(%struct.SmallWithCtor* byval align 4 %s)
-// WIN32: define void @"\01?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"(i32 %s.0)
-// WIN64: define void @"\01?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"(i32 %s.coerce)
-// WOA: define arm_aapcs_vfpcc void @"\01?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"([1 x i32] %s.coerce)
+// WIN32: define dso_local void @"\01?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"(i32 %s.0)
+// WIN64: define dso_local void @"\01?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"(i32 %s.coerce)
+// WOA: define dso_local arm_aapcs_vfpcc void @"\01?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"([1 x i32] %s.coerce)
 
 // FIXME: We could coerce to a series of i32s here if we wanted to.
 void multibyte_arg(Multibyte s) {}
 // LINUX-LABEL: define void @_Z13multibyte_arg9Multibyte(%struct.Multibyte* byval align 4 %s)
-// WIN32: define void @"\01?multibyte_arg@@YAXUMultibyte@@@Z"(%struct.Multibyte* byval align 4 %s)
-// WIN64: define void @"\01?multibyte_arg@@YAXUMultibyte@@@Z"(i32 %s.coerce)
-// WOA: define arm_aapcs_vfpcc void @"\01?multibyte_arg@@YAXUMultibyte@@@Z"([1 x i32] %s.coerce)
+// WIN32: define dso_local void @"\01?multibyte_arg@@YAXUMultibyte@@@Z"(%struct.Multibyte* byval align 4 %s)
+// WIN64: define dso_local void @"\01?multibyte_arg@@YAXUMultibyte@@@Z"(i32 %s.coerce)
+// WOA: define dso_local arm_aapcs_vfpcc void @"\01?multibyte_arg@@YAXUMultibyte@@@Z"([1 x i32] %s.coerce)
 
 void packed_arg(Packed s) {}
 // LINUX-LABEL: define void @_Z10packed_arg6Packed(%struct.Packed* byval align 4 %s)
-// WIN32: define void @"\01?packed_arg@@YAXUPacked@@@Z"(%struct.Packed* byval align 4 %s)
-// WIN64: define void @"\01?packed_arg@@YAXUPacked@@@Z"(%struct.Packed* %s)
+// WIN32: define dso_local void @"\01?packed_arg@@YAXUPacked@@@Z"(%struct.Packed* byval align 4 %s)
+// WIN64: define dso_local void @"\01?packed_arg@@YAXUPacked@@@Z"(%struct.Packed* %s)
 
 // Test that dtors are invoked in the callee.
 void small_arg_with_dtor(SmallWithDtor s) {}
-// WIN32: define void @"\01?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(<{ %struct.SmallWithDtor }>* inalloca) {{.*}} {
+// WIN32: define dso_local void @"\01?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(<{ %struct.SmallWithDtor }>* inalloca) {{.*}} {
 // WIN32:   call x86_thiscallcc void @"\01??1SmallWithDtor@@QAE at XZ"
 // WIN32: }
-// WIN64: define void @"\01?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(i32 %s.coerce) {{.*}} {
+// WIN64: define dso_local void @"\01?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(i32 %s.coerce) {{.*}} {
 // WIN64:   call void @"\01??1SmallWithDtor@@QEAA at XZ"
 // WIN64: }
 
 // FIXME: MSVC incompatible!
-// WOA: define arm_aapcs_vfpcc void @"\01?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(%struct.SmallWithDtor* %s) {{.*}} {
+// WOA: define dso_local arm_aapcs_vfpcc void @"\01?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(%struct.SmallWithDtor* %s) {{.*}} {
 // WOA:   call arm_aapcs_vfpcc void @"\01??1SmallWithDtor@@QAA at XZ"(%struct.SmallWithDtor* %s)
 // WOA: }
 
@@ -174,7 +174,7 @@ void call_small_arg_with_dtor() {
 }
 // The temporary is copied, so it's destroyed in the caller as well as the
 // callee.
-// WIN64-LABEL: define void @"\01?call_small_arg_with_dtor@@YAXXZ"()
+// WIN64-LABEL: define dso_local void @"\01?call_small_arg_with_dtor@@YAXXZ"()
 // WIN64:   call %struct.SmallWithDtor* @"\01??0SmallWithDtor@@QEAA at XZ"
 // WIN64:   call void @"\01?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(i32 %{{.*}})
 // WIN64:   call void @"\01??1SmallWithDtor@@QEAA at XZ"
@@ -182,13 +182,13 @@ void call_small_arg_with_dtor() {
 
 // Test that references aren't destroyed in the callee.
 void ref_small_arg_with_dtor(const SmallWithDtor &s) { }
-// WIN32: define void @"\01?ref_small_arg_with_dtor@@YAXABUSmallWithDtor@@@Z"(%struct.SmallWithDtor* dereferenceable({{[0-9]+}}) %s) {{.*}} {
+// WIN32: define dso_local void @"\01?ref_small_arg_with_dtor@@YAXABUSmallWithDtor@@@Z"(%struct.SmallWithDtor* dereferenceable({{[0-9]+}}) %s) {{.*}} {
 // WIN32-NOT:   call x86_thiscallcc void @"\01??1SmallWithDtor@@QAE at XZ"
 // WIN32: }
-// WIN64-LABEL: define void @"\01?ref_small_arg_with_dtor@@YAXAEBUSmallWithDtor@@@Z"(%struct.SmallWithDtor* dereferenceable({{[0-9]+}}) %s)
+// WIN64-LABEL: define dso_local void @"\01?ref_small_arg_with_dtor@@YAXAEBUSmallWithDtor@@@Z"(%struct.SmallWithDtor* dereferenceable({{[0-9]+}}) %s)
 
 void big_arg_with_dtor(BigWithDtor s) {}
-// WIN64-LABEL: define void @"\01?big_arg_with_dtor@@YAXUBigWithDtor@@@Z"(%struct.BigWithDtor* %s)
+// WIN64-LABEL: define dso_local void @"\01?big_arg_with_dtor@@YAXUBigWithDtor@@@Z"(%struct.BigWithDtor* %s)
 // WIN64:   call void @"\01??1BigWithDtor@@QEAA at XZ"
 // WIN64: }
 
@@ -197,7 +197,7 @@ void call_big_arg_with_dtor() {
 }
 // We can elide the copy of the temporary in the caller, because this object is
 // larger than 8 bytes and is passed indirectly.
-// WIN64-LABEL: define void @"\01?call_big_arg_with_dtor@@YAXXZ"()
+// WIN64-LABEL: define dso_local void @"\01?call_big_arg_with_dtor@@YAXXZ"()
 // WIN64:   call %struct.BigWithDtor* @"\01??0BigWithDtor@@QEAA at XZ"
 // WIN64:   call void @"\01?big_arg_with_dtor@@YAXUBigWithDtor@@@Z"(%struct.BigWithDtor* %{{.*}})
 // WIN64-NOT: call void @"\01??1BigWithDtor@@QEAA at XZ"
@@ -207,7 +207,7 @@ void call_big_arg_with_dtor() {
 void temporary_ref_with_dtor() {
   ref_small_arg_with_dtor(SmallWithDtor());
 }
-// WIN32: define void @"\01?temporary_ref_with_dtor@@YAXXZ"() {{.*}} {
+// WIN32: define dso_local void @"\01?temporary_ref_with_dtor@@YAXXZ"() {{.*}} {
 // WIN32:   call x86_thiscallcc %struct.SmallWithDtor* @"\01??0SmallWithDtor@@QAE at XZ"
 // WIN32:   call void @"\01?ref_small_arg_with_dtor@@YAXABUSmallWithDtor@@@Z"
 // WIN32:   call x86_thiscallcc void @"\01??1SmallWithDtor@@QAE at XZ"
@@ -219,7 +219,7 @@ void eh_cleanup_arg_with_dtor() {
 }
 //   When exceptions are off, we don't have any cleanups.  See
 //   microsoft-abi-exceptions.cpp for these cleanups.
-// WIN32: define void @"\01?eh_cleanup_arg_with_dtor@@YAXXZ"() {{.*}} {
+// WIN32: define dso_local void @"\01?eh_cleanup_arg_with_dtor@@YAXXZ"() {{.*}} {
 // WIN32:   call x86_thiscallcc %struct.SmallWithDtor* @"\01??0SmallWithDtor@@QAE at XZ"
 // WIN32:   call x86_thiscallcc %struct.SmallWithDtor* @"\01??0SmallWithDtor@@QAE at XZ"
 // WIN32:   call void @"\01?takes_two_by_val_with_dtor@@YAXUSmallWithDtor@@0 at Z"
@@ -228,19 +228,19 @@ void eh_cleanup_arg_with_dtor() {
 
 void small_arg_with_vftable(SmallWithVftable s) {}
 // LINUX-LABEL: define void @_Z22small_arg_with_vftable16SmallWithVftable(%struct.SmallWithVftable* %s)
-// WIN32: define void @"\01?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(<{ %struct.SmallWithVftable }>* inalloca)
-// WIN64: define void @"\01?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(%struct.SmallWithVftable* %s)
+// WIN32: define dso_local void @"\01?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(<{ %struct.SmallWithVftable }>* inalloca)
+// WIN64: define dso_local void @"\01?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(%struct.SmallWithVftable* %s)
 
 void medium_arg_with_copy_ctor(MediumWithCopyCtor s) {}
 // LINUX-LABEL: define void @_Z25medium_arg_with_copy_ctor18MediumWithCopyCtor(%struct.MediumWithCopyCtor* %s)
-// WIN32: define void @"\01?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(<{ %struct.MediumWithCopyCtor }>* inalloca)
-// WIN64: define void @"\01?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* %s)
-// WOA: define arm_aapcs_vfpcc void @"\01?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* %s)
+// WIN32: define dso_local void @"\01?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(<{ %struct.MediumWithCopyCtor }>* inalloca)
+// WIN64: define dso_local void @"\01?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* %s)
+// WOA: define dso_local arm_aapcs_vfpcc void @"\01?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* %s)
 
 void big_arg(Big s) {}
 // LINUX-LABEL: define void @_Z7big_arg3Big(%struct.Big* byval align 4 %s)
-// WIN32: define void @"\01?big_arg@@YAXUBig@@@Z"(%struct.Big* byval align 4 %s)
-// WIN64: define void @"\01?big_arg@@YAXUBig@@@Z"(%struct.Big* %s)
+// WIN32: define dso_local void @"\01?big_arg@@YAXUBig@@@Z"(%struct.Big* byval align 4 %s)
+// WIN64: define dso_local void @"\01?big_arg@@YAXUBig@@@Z"(%struct.Big* %s)
 
 // PR27607: We would attempt to load i32 value out of the reference instead of
 // just loading the pointer from the struct during argument expansion.
@@ -250,8 +250,8 @@ struct RefField {
 };
 void takes_ref_field(RefField s) {}
 // LINUX-LABEL: define void @_Z15takes_ref_field8RefField(%struct.RefField* byval align 4 %s)
-// WIN32: define void @"\01?takes_ref_field@@YAXURefField@@@Z"(i32* %s.0)
-// WIN64: define void @"\01?takes_ref_field@@YAXURefField@@@Z"(i64 %s.coerce)
+// WIN32: define dso_local void @"\01?takes_ref_field@@YAXURefField@@@Z"(i32* %s.0)
+// WIN64: define dso_local void @"\01?takes_ref_field@@YAXURefField@@@Z"(i64 %s.coerce)
 
 void pass_ref_field() {
   int x;
@@ -259,9 +259,9 @@ void pass_ref_field() {
 }
 // LINUX-LABEL: define void @_Z14pass_ref_fieldv()
 // LINUX: call void @_Z15takes_ref_field8RefField(%struct.RefField* byval align 4 %{{.*}})
-// WIN32-LABEL: define void @"\01?pass_ref_field@@YAXXZ"()
+// WIN32-LABEL: define dso_local void @"\01?pass_ref_field@@YAXXZ"()
 // WIN32: call void @"\01?takes_ref_field@@YAXURefField@@@Z"(i32* %{{.*}})
-// WIN64-LABEL: define void @"\01?pass_ref_field@@YAXXZ"()
+// WIN64-LABEL: define dso_local void @"\01?pass_ref_field@@YAXXZ"()
 // WIN64: call void @"\01?takes_ref_field@@YAXURefField@@@Z"(i64 %{{.*}})
 
 class Class {
@@ -269,47 +269,47 @@ class Class {
   Small thiscall_method_small() { return Small(); }
   // LINUX: define {{.*}} void @_ZN5Class21thiscall_method_smallEv(%struct.Small* noalias sret %agg.result, %class.Class* %this)
   // WIN32: define {{.*}} x86_thiscallcc void @"\01?thiscall_method_small at Class@@QAE?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result)
-  // WIN64: define linkonce_odr void @"\01?thiscall_method_small at Class@@QEAA?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result)
+  // WIN64: define linkonce_odr dso_local void @"\01?thiscall_method_small at Class@@QEAA?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result)
 
   SmallWithCtor thiscall_method_small_with_ctor() { return SmallWithCtor(); }
   // LINUX: define {{.*}} void @_ZN5Class31thiscall_method_small_with_ctorEv(%struct.SmallWithCtor* noalias sret %agg.result, %class.Class* %this)
   // WIN32: define {{.*}} x86_thiscallcc void @"\01?thiscall_method_small_with_ctor at Class@@QAE?AUSmallWithCtor@@XZ"(%class.Class* %this, %struct.SmallWithCtor* noalias sret %agg.result)
-  // WIN64: define linkonce_odr void @"\01?thiscall_method_small_with_ctor at Class@@QEAA?AUSmallWithCtor@@XZ"(%class.Class* %this, %struct.SmallWithCtor* noalias sret %agg.result)
+  // WIN64: define linkonce_odr dso_local void @"\01?thiscall_method_small_with_ctor at Class@@QEAA?AUSmallWithCtor@@XZ"(%class.Class* %this, %struct.SmallWithCtor* noalias sret %agg.result)
 
   Small __cdecl cdecl_method_small() { return Small(); }
   // LINUX: define {{.*}} void @_ZN5Class18cdecl_method_smallEv(%struct.Small* noalias sret %agg.result, %class.Class* %this)
   // WIN32: define {{.*}} void @"\01?cdecl_method_small at Class@@QAA?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result)
-  // WIN64: define linkonce_odr void @"\01?cdecl_method_small at Class@@QEAA?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result)
+  // WIN64: define linkonce_odr dso_local void @"\01?cdecl_method_small at Class@@QEAA?AUSmall@@XZ"(%class.Class* %this, %struct.Small* noalias sret %agg.result)
 
   Big __cdecl cdecl_method_big() { return Big(); }
   // LINUX: define {{.*}} void @_ZN5Class16cdecl_method_bigEv(%struct.Big* noalias sret %agg.result, %class.Class* %this)
   // WIN32: define {{.*}} void @"\01?cdecl_method_big at Class@@QAA?AUBig@@XZ"(%class.Class* %this, %struct.Big* noalias sret %agg.result)
-  // WIN64: define linkonce_odr void @"\01?cdecl_method_big at Class@@QEAA?AUBig@@XZ"(%class.Class* %this, %struct.Big* noalias sret %agg.result)
+  // WIN64: define linkonce_odr dso_local void @"\01?cdecl_method_big at Class@@QEAA?AUBig@@XZ"(%class.Class* %this, %struct.Big* noalias sret %agg.result)
 
   void thiscall_method_arg(Empty s) {}
   // LINUX: define {{.*}} void @_ZN5Class19thiscall_method_argE5Empty(%class.Class* %this)
   // WIN32: define {{.*}} void @"\01?thiscall_method_arg at Class@@QAEXUEmpty@@@Z"(%class.Class* %this, %struct.Empty* byval align 4 %s)
-  // WIN64: define linkonce_odr void @"\01?thiscall_method_arg at Class@@QEAAXUEmpty@@@Z"(%class.Class* %this, i8 %s.coerce)
+  // WIN64: define linkonce_odr dso_local void @"\01?thiscall_method_arg at Class@@QEAAXUEmpty@@@Z"(%class.Class* %this, i8 %s.coerce)
 
   void thiscall_method_arg(EmptyWithCtor s) {}
   // LINUX: define {{.*}} void @_ZN5Class19thiscall_method_argE13EmptyWithCtor(%class.Class* %this)
   // WIN32: define {{.*}} void @"\01?thiscall_method_arg at Class@@QAEXUEmptyWithCtor@@@Z"(%class.Class* %this, %struct.EmptyWithCtor* byval align 4 %s)
-  // WIN64: define linkonce_odr void @"\01?thiscall_method_arg at Class@@QEAAXUEmptyWithCtor@@@Z"(%class.Class* %this, i8 %s.coerce)
+  // WIN64: define linkonce_odr dso_local void @"\01?thiscall_method_arg at Class@@QEAAXUEmptyWithCtor@@@Z"(%class.Class* %this, i8 %s.coerce)
 
   void thiscall_method_arg(Small s) {}
   // LINUX: define {{.*}} void @_ZN5Class19thiscall_method_argE5Small(%class.Class* %this, i32 %s.0)
   // WIN32: define {{.*}} void @"\01?thiscall_method_arg at Class@@QAEXUSmall@@@Z"(%class.Class* %this, i32 %s.0)
-  // WIN64: define linkonce_odr void @"\01?thiscall_method_arg at Class@@QEAAXUSmall@@@Z"(%class.Class* %this, i32 %s.coerce)
+  // WIN64: define linkonce_odr dso_local void @"\01?thiscall_method_arg at Class@@QEAAXUSmall@@@Z"(%class.Class* %this, i32 %s.coerce)
 
   void thiscall_method_arg(SmallWithCtor s) {}
   // LINUX: define {{.*}} void @_ZN5Class19thiscall_method_argE13SmallWithCtor(%class.Class* %this, %struct.SmallWithCtor* byval align 4 %s)
   // WIN32: define {{.*}} void @"\01?thiscall_method_arg at Class@@QAEXUSmallWithCtor@@@Z"(%class.Class* %this, i32 %s.0)
-  // WIN64: define linkonce_odr void @"\01?thiscall_method_arg at Class@@QEAAXUSmallWithCtor@@@Z"(%class.Class* %this, i32 %s.coerce)
+  // WIN64: define linkonce_odr dso_local void @"\01?thiscall_method_arg at Class@@QEAAXUSmallWithCtor@@@Z"(%class.Class* %this, i32 %s.coerce)
 
   void thiscall_method_arg(Big s) {}
   // LINUX: define {{.*}} void @_ZN5Class19thiscall_method_argE3Big(%class.Class* %this, %struct.Big* byval align 4 %s)
   // WIN32: define {{.*}} void @"\01?thiscall_method_arg at Class@@QAEXUBig@@@Z"(%class.Class* %this, %struct.Big* byval align 4 %s)
-  // WIN64: define linkonce_odr void @"\01?thiscall_method_arg at Class@@QEAAXUBig@@@Z"(%class.Class* %this, %struct.Big* %s)
+  // WIN64: define linkonce_odr dso_local void @"\01?thiscall_method_arg at Class@@QEAAXUBig@@@Z"(%class.Class* %this, %struct.Big* %s)
 };
 
 void use_class() {
@@ -333,13 +333,13 @@ struct X {
 };
 void g(X) {
 }
-// WIN32: define void @"\01?g@@YAXUX@@@Z"(<{ %struct.X, [3 x i8] }>* inalloca) {{.*}} {
+// WIN32: define dso_local void @"\01?g@@YAXUX@@@Z"(<{ %struct.X, [3 x i8] }>* inalloca) {{.*}} {
 // WIN32:   call x86_thiscallcc void @"\01??1X@@QAE at XZ"(%struct.X* {{.*}})
 // WIN32: }
 void f() {
   g(X());
 }
-// WIN32: define void @"\01?f@@YAXXZ"() {{.*}} {
+// WIN32: define dso_local void @"\01?f@@YAXXZ"() {{.*}} {
 // WIN32-NOT: call {{.*}} @"\01??1X@@QAE at XZ"
 // WIN32: }
 
@@ -362,7 +362,7 @@ void bar() {
   b.b = 13;
   int c = foo(NonTrivial(), b);
 }
-// WIN32-LABEL: define void @"\01?bar at test2@@YAXXZ"() {{.*}} {
+// WIN32-LABEL: define dso_local void @"\01?bar at test2@@YAXXZ"() {{.*}} {
 // WIN32:   %[[argmem:[^ ]*]] = alloca inalloca [[argmem_ty:<{ %"struct.test2::NonTrivial", %"struct.test2::POD" }>]]
 // WIN32:   getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %[[argmem]], i32 0, i32 1
 // WIN32:   call void @llvm.memcpy
@@ -384,7 +384,7 @@ struct NonTrivial {
   int a;
 };
 void foo(NonTrivial a, bool b) { }
-// WIN32-LABEL: define void @"\01?foo at test3@@YAXUNonTrivial at 1@_N at Z"(<{ %"struct.test3::NonTrivial", i8, [3 x i8] }>* inalloca)
+// WIN32-LABEL: define dso_local void @"\01?foo at test3@@YAXUNonTrivial at 1@_N at Z"(<{ %"struct.test3::NonTrivial", i8, [3 x i8] }>* inalloca)
 
 }
 
@@ -399,7 +399,7 @@ void fn1(FnPtr1 a, SmallWithDtor b) { }
 struct ForwardDeclare1 {};
 
 void fn2(FnPtr1 a, SmallWithDtor b) { fn1(a, b); };
-// WIN32-LABEL: define void @"\01?fn2@@YAXP6AXUForwardDeclare1@@@ZUSmallWithDtor@@@Z"
+// WIN32-LABEL: define dso_local void @"\01?fn2@@YAXP6AXUForwardDeclare1@@@ZUSmallWithDtor@@@Z"
 // WIN32:   %[[a:[^ ]*]] = getelementptr inbounds [[argmem_ty:<{ {}\*, %struct.SmallWithDtor }>]], [[argmem_ty:<{ {}\*, %struct.SmallWithDtor }>]]* %{{.*}}, i32 0, i32 0
 // WIN32:   %[[a1:[^ ]*]] = bitcast {}** %[[a]] to void [[dst_ty:\(%struct.ForwardDeclare1\*\)\*]]*
 // WIN32:   %[[argmem:[^ ]*]] = alloca inalloca [[argmem_ty]]
@@ -430,11 +430,11 @@ struct C final : A, B {
 };
 void C::g() { return h(SmallWithDtor()); }
 
-// WIN32-LABEL: define x86_thiscallcc void @"\01?g at C@pr30293@@QAEXXZ"(%"struct.pr30293::C"* %this)
+// WIN32-LABEL: define dso_local x86_thiscallcc void @"\01?g at C@pr30293@@QAEXXZ"(%"struct.pr30293::C"* %this)
 // WIN32: call x86_thiscallcc %struct.SmallWithDtor* @"\01??0SmallWithDtor@@QAE at XZ"
 // WIN32: call void @"\01?h at C@pr30293@@UAAXUSmallWithDtor@@@Z"(<{ i8*, %struct.SmallWithDtor }>* inalloca %{{[^,)]*}})
-// WIN32: declare void @"\01?h at C@pr30293@@UAAXUSmallWithDtor@@@Z"(<{ i8*, %struct.SmallWithDtor }>* inalloca)
+// WIN32: declare dso_local void @"\01?h at C@pr30293@@UAAXUSmallWithDtor@@@Z"(<{ i8*, %struct.SmallWithDtor }>* inalloca)
 
-// WIN64-LABEL: define void @"\01?g at C@pr30293@@QEAAXXZ"(%"struct.pr30293::C"* %this)
-// WIN64: declare void @"\01?h at C@pr30293@@UEAAXUSmallWithDtor@@@Z"(i8*, i32)
+// WIN64-LABEL: define dso_local void @"\01?g at C@pr30293@@QEAAXXZ"(%"struct.pr30293::C"* %this)
+// WIN64: declare dso_local void @"\01?h at C@pr30293@@UEAAXUSmallWithDtor@@@Z"(i8*, i32)
 }

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-static-initializers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-static-initializers.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-static-initializers.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-static-initializers.cpp Fri Feb 23 11:30:48 2018
@@ -51,7 +51,7 @@ void StaticLocal() {
   static S TheS;
 }
 
-// CHECK-LABEL: define void @"\01?StaticLocal@@YAXXZ"()
+// CHECK-LABEL: define dso_local void @"\01?StaticLocal@@YAXXZ"()
 // CHECK: load i32, i32* @"\01?$S1@?1??StaticLocal@@YAXXZ at 4IA"
 // CHECK: store i32 {{.*}}, i32* @"\01?$S1@?1??StaticLocal@@YAXXZ at 4IA"
 // CHECK: ret
@@ -93,7 +93,7 @@ void MultipleStatics() {
   static S S34;
   static S S35;
 }
-// CHECK-LABEL: define void @"\01?MultipleStatics@@YAXXZ"()
+// CHECK-LABEL: define dso_local void @"\01?MultipleStatics@@YAXXZ"()
 // CHECK: load i32, i32* @"\01?$S1@?1??MultipleStatics@@YAXXZ at 4IA"
 // CHECK: and i32 {{.*}}, 1
 // CHECK: and i32 {{.*}}, 2
@@ -133,7 +133,7 @@ inline S &UnreachableStatic() {
   return s;
 }
 
-// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.S* @"\01?UnreachableStatic@@YAAAUS@@XZ"() {{.*}} comdat
+// CHECK-LABEL: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.S* @"\01?UnreachableStatic@@YAAAUS@@XZ"() {{.*}} comdat
 // CHECK: and i32 {{.*}}, 2
 // CHECK: or i32 {{.*}}, 2
 // CHECK: ret
@@ -143,7 +143,7 @@ inline S &getS() {
   return TheS;
 }
 
-// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.S* @"\01?getS@@YAAAUS@@XZ"() {{.*}} comdat
+// CHECK-LABEL: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.S* @"\01?getS@@YAAAUS@@XZ"() {{.*}} comdat
 // CHECK: load i32, i32* @"\01??_B?1??getS@@YAAAUS@@XZ at 51"
 // CHECK: and i32 {{.*}}, 1
 // CHECK: icmp eq i32 {{.*}}, 0
@@ -158,7 +158,7 @@ inline S &getS() {
 // CHECK: ret %struct.S* @"\01?TheS@?1??getS@@YAAAUS@@XZ at 4U2@A"
 
 inline int enum_in_function() {
-  // CHECK-LABEL: define linkonce_odr i32 @"\01?enum_in_function@@YAHXZ"() {{.*}} comdat
+  // CHECK-LABEL: define linkonce_odr dso_local i32 @"\01?enum_in_function@@YAHXZ"() {{.*}} comdat
   static enum e { foo, bar, baz } x;
   // CHECK: @"\01?x@?1??enum_in_function@@YAHXZ at 4W4e@?1??1 at YAHXZ@A"
   static int y;
@@ -169,7 +169,7 @@ inline int enum_in_function() {
 struct T {
   enum e { foo, bar, baz };
   int enum_in_struct() {
-    // CHECK-LABEL: define linkonce_odr x86_thiscallcc i32 @"\01?enum_in_struct at T@@QAEHXZ"({{.*}}) {{.*}} comdat
+    // CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc i32 @"\01?enum_in_struct at T@@QAEHXZ"({{.*}}) {{.*}} comdat
     static int x;
     // CHECK: @"\01?x@?1??enum_in_struct at T@@QAEHXZ at 4HA"
     return x++;
@@ -177,7 +177,7 @@ struct T {
 };
 
 inline int switch_test(int x) {
-  // CHECK-LABEL: define linkonce_odr i32 @"\01?switch_test@@YAHH at Z"(i32 %x) {{.*}} comdat
+  // CHECK-LABEL: define linkonce_odr dso_local i32 @"\01?switch_test@@YAHH at Z"(i32 %x) {{.*}} comdat
   switch (x) {
     static int a;
     // CHECK: @"\01?a@?3??switch_test@@YAHH at Z@4HA"
@@ -198,7 +198,7 @@ inline int switch_test(int x) {
 
 int f();
 inline void switch_test2() {
-  // CHECK-LABEL: define linkonce_odr void @"\01?switch_test2@@YAXXZ"() {{.*}} comdat
+  // CHECK-LABEL: define linkonce_odr dso_local void @"\01?switch_test2@@YAXXZ"() {{.*}} comdat
   // CHECK: @"\01?x@?2??switch_test2@@YAXXZ at 4HA"
   switch (1) default: static int x = f();
 }
@@ -213,7 +213,7 @@ namespace DynamicDLLImportInitVSMangling
   template struct __declspec(dllimport) A<int>;
 
   inline int switch_test3() {
-    // CHECK-LABEL: define linkonce_odr i32 @"\01?switch_test3 at DynamicDLLImportInitVSMangling@@YAHXZ"() {{.*}} comdat
+    // CHECK-LABEL: define linkonce_odr dso_local i32 @"\01?switch_test3 at DynamicDLLImportInitVSMangling@@YAHXZ"() {{.*}} comdat
     static int local;
     // CHECK: @"\01?local@?1??switch_test3 at DynamicDLLImportInitVSMangling@@YAHXZ at 4HA"
     return local++;
@@ -238,9 +238,9 @@ void force_usage() {
 // CHECK: call i32 @atexit(void ()* @"\01??__Ffoo@?$B at H@@2VA@@A at YAXXZ")
 // CHECK: ret void
 
-// CHECK: define linkonce_odr x86_thiscallcc %class.A* @"\01??0A@@QAE at XZ"({{.*}}) {{.*}} comdat
+// CHECK: define linkonce_odr dso_local x86_thiscallcc %class.A* @"\01??0A@@QAE at XZ"({{.*}}) {{.*}} comdat
 
-// CHECK: define linkonce_odr x86_thiscallcc void @"\01??1A@@QAE at XZ"({{.*}}) {{.*}} comdat
+// CHECK: define linkonce_odr dso_local x86_thiscallcc void @"\01??1A@@QAE at XZ"({{.*}}) {{.*}} comdat
 
 // CHECK: define internal void @"\01??__Ffoo@?$B at H@@2VA@@A at YAXXZ"
 // CHECK: call x86_thiscallcc void @"\01??1A@@QAE at XZ"{{.*}}foo

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-structors-alias.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-structors-alias.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-structors-alias.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-structors-alias.cpp Fri Feb 23 11:30:48 2018
@@ -5,7 +5,7 @@ template <typename T> class A {
   ~A() {}
 };
 template class A<char>;
-// CHECK-DAG: define weak_odr x86_thiscallcc void @"\01??1?$A at D@test1@@AAE at XZ"
+// CHECK-DAG: define weak_odr dso_local x86_thiscallcc void @"\01??1?$A at D@test1@@AAE at XZ"
 }
 
 namespace test2 {
@@ -22,14 +22,14 @@ B::~B() {}
 void foo() {
   B b;
 }
-// CHECK-DAG: @"\01??1B at test2@@UAE at XZ" = alias void (%"struct.test2::B"*), bitcast (void (%"struct.test2::A"*)* @"\01??1A at test2@@UAE at XZ" to void (%"struct.test2::B"*)*)
+// CHECK-DAG: @"\01??1B at test2@@UAE at XZ" = dso_local alias void (%"struct.test2::B"*), bitcast (void (%"struct.test2::A"*)* @"\01??1A at test2@@UAE at XZ" to void (%"struct.test2::B"*)*)
 }
 
 namespace test3 {
 struct A { virtual ~A(); };
 A::~A() {}
 }
-// CHECK-DAG: define x86_thiscallcc void @"\01??1A at test3@@UAE at XZ"(
+// CHECK-DAG: define dso_local x86_thiscallcc void @"\01??1A at test3@@UAE at XZ"(
 namespace test3 {
 template <typename T>
 struct B : A {
@@ -39,4 +39,4 @@ template struct B<int>;
 }
 // This has to be weak, and emitting weak aliases is fragile, so we don't do the
 // aliasing.
-// CHECK-DAG: define weak_odr x86_thiscallcc void @"\01??1?$B at H@test3@@UAE at XZ"(
+// CHECK-DAG: define weak_odr dso_local x86_thiscallcc void @"\01??1?$B at H@test3@@UAE at XZ"(

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-structors.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-structors.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-structors.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-structors.cpp Fri Feb 23 11:30:48 2018
@@ -20,7 +20,7 @@ class A {
 void no_constructor_destructor_infinite_recursion() {
   A a;
 
-// CHECK:      define linkonce_odr x86_thiscallcc %"class.basic::A"* @"\01??0A at basic@@QAE at XZ"(%"class.basic::A"* returned %this) {{.*}} comdat {{.*}} {
+// CHECK:      define linkonce_odr dso_local x86_thiscallcc %"class.basic::A"* @"\01??0A at basic@@QAE at XZ"(%"class.basic::A"* returned %this) {{.*}} comdat {{.*}} {
 // CHECK:        [[THIS_ADDR:%[.0-9A-Z_a-z]+]] = alloca %"class.basic::A"*, align 4
 // CHECK-NEXT:   store %"class.basic::A"* %this, %"class.basic::A"** [[THIS_ADDR]], align 4
 // CHECK-NEXT:   [[T1:%[.0-9A-Z_a-z]+]] = load %"class.basic::A"*, %"class.basic::A"** [[THIS_ADDR]]
@@ -41,13 +41,13 @@ struct B {
 
 // Tests that we can define constructors outside the class (PR12784).
 B::B() {
-  // CHECK: define x86_thiscallcc %"struct.basic::B"* @"\01??0B at basic@@QAE at XZ"(%"struct.basic::B"* returned %this)
+  // CHECK: define dso_local x86_thiscallcc %"struct.basic::B"* @"\01??0B at basic@@QAE at XZ"(%"struct.basic::B"* returned %this)
   // CHECK: ret
 }
 
 struct C {
   virtual ~C() {
-// DTORS:      define linkonce_odr x86_thiscallcc i8* @"\01??_GC at basic@@UAEPAXI at Z"(%"struct.basic::C"* %this, i32 %should_call_delete) {{.*}} comdat {{.*}} {
+// DTORS:      define linkonce_odr dso_local x86_thiscallcc i8* @"\01??_GC at basic@@UAEPAXI at Z"(%"struct.basic::C"* %this, i32 %should_call_delete) {{.*}} comdat {{.*}} {
 // DTORS:        store i32 %should_call_delete, i32* %[[SHOULD_DELETE_VAR:[0-9a-z._]+]], align 4
 // DTORS:        store i8* %{{.*}}, i8** %[[RETVAL:[0-9a-z._]+]]
 // DTORS:        %[[SHOULD_DELETE_VALUE:[0-9a-z._]+]] = load i32, i32* %[[SHOULD_DELETE_VAR]]
@@ -81,7 +81,7 @@ void check_vftable_offset() {
 }
 
 void call_complete_dtor(C *obj_ptr) {
-// CHECK: define void @"\01?call_complete_dtor at basic@@YAXPAUC at 1@@Z"(%"struct.basic::C"* %obj_ptr)
+// CHECK: define dso_local void @"\01?call_complete_dtor at basic@@YAXPAUC at 1@@Z"(%"struct.basic::C"* %obj_ptr)
   obj_ptr->~C();
 // CHECK: %[[OBJ_PTR_VALUE:.*]] = load %"struct.basic::C"*, %"struct.basic::C"** %{{.*}}, align 4
 // CHECK-NEXT: %[[PVTABLE:.*]] = bitcast %"struct.basic::C"* %[[OBJ_PTR_VALUE]] to i8* (%"struct.basic::C"*, i32)***
@@ -93,7 +93,7 @@ void call_complete_dtor(C *obj_ptr) {
 }
 
 void call_deleting_dtor(C *obj_ptr) {
-// CHECK: define void @"\01?call_deleting_dtor at basic@@YAXPAUC at 1@@Z"(%"struct.basic::C"* %obj_ptr)
+// CHECK: define dso_local void @"\01?call_deleting_dtor at basic@@YAXPAUC at 1@@Z"(%"struct.basic::C"* %obj_ptr)
   delete obj_ptr;
 // CHECK:      %[[OBJ_PTR_VALUE:.*]] = load %"struct.basic::C"*, %"struct.basic::C"** %{{.*}}, align 4
 // CHECK:      br i1 {{.*}}, label %[[DELETE_NULL:.*]], label %[[DELETE_NOTNULL:.*]]
@@ -108,7 +108,7 @@ void call_deleting_dtor(C *obj_ptr) {
 }
 
 void call_deleting_dtor_and_global_delete(C *obj_ptr) {
-// CHECK: define void @"\01?call_deleting_dtor_and_global_delete at basic@@YAXPAUC at 1@@Z"(%"struct.basic::C"* %obj_ptr)
+// CHECK: define dso_local void @"\01?call_deleting_dtor_and_global_delete at basic@@YAXPAUC at 1@@Z"(%"struct.basic::C"* %obj_ptr)
   ::delete obj_ptr;
 // CHECK:      %[[OBJ_PTR_VALUE:.*]] = load %"struct.basic::C"*, %"struct.basic::C"** %{{.*}}, align 4
 // CHECK:      br i1 {{.*}}, label %[[DELETE_NULL:.*]], label %[[DELETE_NOTNULL:.*]]
@@ -155,7 +155,7 @@ struct C : A, B {
 };
 
 C::~C() {
-// CHECK-LABEL: define x86_thiscallcc void @"\01??1C at dtor_in_second_nvbase@@UAE at XZ"
+// CHECK-LABEL: define dso_local x86_thiscallcc void @"\01??1C at dtor_in_second_nvbase@@UAE at XZ"
 // CHECK:       (%"struct.dtor_in_second_nvbase::C"* %this)
 //      No this adjustment!
 // CHECK-NOT: getelementptr
@@ -172,7 +172,7 @@ C::~C() {
 void foo() {
   C c;
 }
-// DTORS2-LABEL: define linkonce_odr x86_thiscallcc i8* @"\01??_EC at dtor_in_second_nvbase@@W3AEPAXI at Z"
+// DTORS2-LABEL: define linkonce_odr dso_local x86_thiscallcc i8* @"\01??_EC at dtor_in_second_nvbase@@W3AEPAXI at Z"
 // DTORS2:       (%"struct.dtor_in_second_nvbase::C"* %this, i32 %should_call_delete)
 //      Do an adjustment from B* to C*.
 // DTORS2:   getelementptr i8, i8* %{{.*}}, i32 -4
@@ -196,7 +196,7 @@ struct E : virtual C { int e; };
 struct F : D, E { ~F(); int f; };
 
 F::~F() {
-// CHECK-LABEL: define x86_thiscallcc void @"\01??1F at test2@@UAE at XZ"(%"struct.test2::F"*{{[^,]*}})
+// CHECK-LABEL: define dso_local x86_thiscallcc void @"\01??1F at test2@@UAE at XZ"(%"struct.test2::F"*{{[^,]*}})
 //      Do an adjustment from C vbase subobject to F as though F was the
 //      complete type.
 // CHECK:   getelementptr inbounds i8, i8* %{{.*}}, i32 -20
@@ -207,7 +207,7 @@ F::~F() {
 void foo() {
   F f;
 }
-// DTORS3-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_DF at test2@@QAEXXZ"({{.*}} {{.*}} comdat
+// DTORS3-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"\01??_DF at test2@@QAEXXZ"({{.*}} {{.*}} comdat
 //      Do an adjustment from C* to F*.
 // DTORS3:   getelementptr i8, i8* %{{.*}}, i32 20
 // DTORS3:   bitcast i8* %{{.*}} to %"struct.test2::F"*
@@ -228,7 +228,7 @@ struct B : A {
 };
 
 B::B() {
-  // CHECK: define x86_thiscallcc %"struct.constructors::B"* @"\01??0B at constructors@@QAE at XZ"(%"struct.constructors::B"* returned %this)
+  // CHECK: define dso_local x86_thiscallcc %"struct.constructors::B"* @"\01??0B at constructors@@QAE at XZ"(%"struct.constructors::B"* returned %this)
   // CHECK: call x86_thiscallcc %"struct.constructors::A"* @"\01??0A at constructors@@QAE at XZ"(%"struct.constructors::A"* %{{.*}})
   // CHECK: ret
 }
@@ -238,7 +238,7 @@ struct C : virtual A {
 };
 
 C::C() {
-  // CHECK: define x86_thiscallcc %"struct.constructors::C"* @"\01??0C at constructors@@QAE at XZ"(%"struct.constructors::C"* returned %this, i32 %is_most_derived)
+  // CHECK: define dso_local x86_thiscallcc %"struct.constructors::C"* @"\01??0C at constructors@@QAE at XZ"(%"struct.constructors::C"* returned %this, i32 %is_most_derived)
   // TODO: make sure this works in the Release build too;
   // CHECK: store i32 %is_most_derived, i32* %[[IS_MOST_DERIVED_VAR:.*]], align 4
   // CHECK: %[[IS_MOST_DERIVED_VAL:.*]] = load i32, i32* %[[IS_MOST_DERIVED_VAR]]
@@ -264,7 +264,7 @@ C::C() {
 
 void create_C() {
   C c;
-  // CHECK: define void @"\01?create_C at constructors@@YAXXZ"()
+  // CHECK: define dso_local void @"\01?create_C at constructors@@YAXXZ"()
   // CHECK: call x86_thiscallcc %"struct.constructors::C"* @"\01??0C at constructors@@QAE at XZ"(%"struct.constructors::C"* %c, i32 1)
   // CHECK: ret
 }
@@ -274,7 +274,7 @@ struct D : C {
 };
 
 D::D() {
-  // CHECK: define x86_thiscallcc %"struct.constructors::D"* @"\01??0D at constructors@@QAE at XZ"(%"struct.constructors::D"* returned %this, i32 %is_most_derived) unnamed_addr
+  // CHECK: define dso_local x86_thiscallcc %"struct.constructors::D"* @"\01??0D at constructors@@QAE at XZ"(%"struct.constructors::D"* returned %this, i32 %is_most_derived) unnamed_addr
   // CHECK: store i32 %is_most_derived, i32* %[[IS_MOST_DERIVED_VAR:.*]], align 4
   // CHECK: %[[IS_MOST_DERIVED_VAL:.*]] = load i32, i32* %[[IS_MOST_DERIVED_VAR]]
   // CHECK: %[[SHOULD_CALL_VBASE_CTORS:.*]] = icmp ne i32 %[[IS_MOST_DERIVED_VAL]], 0
@@ -301,7 +301,7 @@ struct E : virtual C {
 };
 
 E::E() {
-  // CHECK: define x86_thiscallcc %"struct.constructors::E"* @"\01??0E at constructors@@QAE at XZ"(%"struct.constructors::E"* returned %this, i32 %is_most_derived) unnamed_addr
+  // CHECK: define dso_local x86_thiscallcc %"struct.constructors::E"* @"\01??0E at constructors@@QAE at XZ"(%"struct.constructors::E"* returned %this, i32 %is_most_derived) unnamed_addr
   // CHECK: store i32 %is_most_derived, i32* %[[IS_MOST_DERIVED_VAR:.*]], align 4
   // CHECK: %[[IS_MOST_DERIVED_VAL:.*]] = load i32, i32* %[[IS_MOST_DERIVED_VAR]]
   // CHECK: %[[SHOULD_CALL_VBASE_CTORS:.*]] = icmp ne i32 %[[IS_MOST_DERIVED_VAL]], 0
@@ -333,7 +333,7 @@ struct F {
 };
 
 F::F() {}
-// CHECK: define x86_thiscallcc %"struct.constructors::F"* @"\01??0F at constructors@@QAE at XZ"
+// CHECK: define dso_local x86_thiscallcc %"struct.constructors::F"* @"\01??0F at constructors@@QAE at XZ"
 
 } // end namespace constructors
 
@@ -345,12 +345,12 @@ struct A {
 
 void call_nv_complete(A *a) {
   a->~A();
-// CHECK: define void @"\01?call_nv_complete at dtors@@YAXPAUA at 1@@Z"
+// CHECK: define dso_local void @"\01?call_nv_complete at dtors@@YAXPAUA at 1@@Z"
 // CHECK: call x86_thiscallcc void @"\01??1A at dtors@@QAE at XZ"
 // CHECK: ret
 }
 
-// CHECK: declare x86_thiscallcc void @"\01??1A at dtors@@QAE at XZ"
+// CHECK: declare dso_local x86_thiscallcc void @"\01??1A at dtors@@QAE at XZ"
 
 // Now try some virtual bases, where we need the complete dtor.
 
@@ -360,13 +360,13 @@ struct D : B, C { ~D(); };
 
 void call_vbase_complete(D *d) {
   d->~D();
-// CHECK: define void @"\01?call_vbase_complete at dtors@@YAXPAUD at 1@@Z"
+// CHECK: define dso_local void @"\01?call_vbase_complete at dtors@@YAXPAUD at 1@@Z"
 // CHECK: call x86_thiscallcc void @"\01??_DD at dtors@@QAEXXZ"(%"struct.dtors::D"* %{{[^,]+}})
 // CHECK: ret
 }
 
 // The complete dtor should call the base dtors for D and the vbase A (once).
-// CHECK: define linkonce_odr x86_thiscallcc void @"\01??_DD at dtors@@QAEXXZ"({{.*}}) {{.*}} comdat
+// CHECK: define linkonce_odr dso_local x86_thiscallcc void @"\01??_DD at dtors@@QAEXXZ"({{.*}}) {{.*}} comdat
 // CHECK-NOT: call
 // CHECK: call x86_thiscallcc void @"\01??1D at dtors@@QAE at XZ"
 // CHECK-NOT: call
@@ -376,7 +376,7 @@ void call_vbase_complete(D *d) {
 
 void destroy_d_complete() {
   D d;
-// CHECK: define void @"\01?destroy_d_complete at dtors@@YAXXZ"
+// CHECK: define dso_local void @"\01?destroy_d_complete at dtors@@YAXXZ"
 // CHECK: call x86_thiscallcc void @"\01??_DD at dtors@@QAEXXZ"(%"struct.dtors::D"* %{{[^,]+}})
 // CHECK: ret
 }
@@ -386,7 +386,7 @@ void destroy_d_complete() {
 // a vftable.
 void call_nv_deleting_dtor(D *d) {
   delete d;
-// CHECK: define void @"\01?call_nv_deleting_dtor at dtors@@YAXPAUD at 1@@Z"
+// CHECK: define dso_local void @"\01?call_nv_deleting_dtor at dtors@@YAXPAUD at 1@@Z"
 // CHECK: call x86_thiscallcc void @"\01??_DD at dtors@@QAEXXZ"(%"struct.dtors::D"* %{{[^,]+}})
 // CHECK: call void @"\01??3 at YAXPAX@Z"
 // CHECK: ret
@@ -404,11 +404,11 @@ struct B : virtual A {
 B::B(int *a) {}
 B::B(const char *a, ...) {}
 B::B(short *a) {}
-// CHECK: define x86_thiscallcc %"struct.test1::B"* @"\01??0B at test1@@QAE at PAH@Z"
+// CHECK: define dso_local x86_thiscallcc %"struct.test1::B"* @"\01??0B at test1@@QAE at PAH@Z"
 // CHECK:               (%"struct.test1::B"* returned %this, i32* %a, i32 %is_most_derived)
-// CHECK: define %"struct.test1::B"* @"\01??0B at test1@@QAA at PBDZZ"
+// CHECK: define dso_local %"struct.test1::B"* @"\01??0B at test1@@QAA at PBDZZ"
 // CHECK:               (%"struct.test1::B"* returned %this, i32 %is_most_derived, i8* %a, ...)
-// CHECK: define x86_thiscallcc %"struct.test1::B"* @"\01??0B at test1@@QAE at PAF@Z"
+// CHECK: define dso_local x86_thiscallcc %"struct.test1::B"* @"\01??0B at test1@@QAE at PAF@Z"
 // CHECK:               (%"struct.test1::B"* returned %this, i16* %a, i32 %is_most_derived)
 
 void construct_b() {
@@ -416,7 +416,7 @@ void construct_b() {
   B b1(&a);
   B b2("%d %d", 1, 2);
 }
-// CHECK-LABEL: define void @"\01?construct_b at test1@@YAXXZ"()
+// CHECK-LABEL: define dso_local void @"\01?construct_b at test1@@YAXXZ"()
 // CHECK: call x86_thiscallcc %"struct.test1::B"* @"\01??0B at test1@@QAE at PAH@Z"
 // CHECK:               (%"struct.test1::B"* {{.*}}, i32* {{.*}}, i32 1)
 // CHECK: call %"struct.test1::B"* (%"struct.test1::B"*, i32, i8*, ...) @"\01??0B at test1@@QAA at PBDZZ"
@@ -451,7 +451,7 @@ struct X : virtual Y {
 };
 X::X(int) : X() {}
 }
-// CHECK: define x86_thiscallcc %"struct.delegating_ctor::X"* @"\01??0X at delegating_ctor@@QAE at H@Z"(
+// CHECK: define dso_local x86_thiscallcc %"struct.delegating_ctor::X"* @"\01??0X at delegating_ctor@@QAE at H@Z"(
 // CHECK:  %[[is_most_derived_addr:.*]] = alloca i32, align 4
 // CHECK:  store i32 %is_most_derived, i32* %[[is_most_derived_addr]]
 // CHECK:  %[[is_most_derived:.*]] = load i32, i32* %[[is_most_derived_addr]]
@@ -477,9 +477,9 @@ void *getA() {
 class G {
  public:
   __stdcall G() {};
-// DTORS4: define linkonce_odr x86_thiscallcc %class.G* @"\01??0G@@QAE at XZ"
+// DTORS4: define linkonce_odr dso_local x86_thiscallcc %class.G* @"\01??0G@@QAE at XZ"
   __stdcall ~G() {};
-// DTORS4: define linkonce_odr x86_thiscallcc void @"\01??1G@@QAE at XZ"
+// DTORS4: define linkonce_odr dso_local x86_thiscallcc void @"\01??1G@@QAE at XZ"
 };
 
 extern void testG() {

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp Fri Feb 23 11:30:48 2018
@@ -6,14 +6,14 @@ struct S {
   ~S();
 };
 
-// CHECK-DAG: @"\01?s@?1??f@@YAAAUS@@XZ at 4U2@A" = linkonce_odr thread_local global %struct.S zeroinitializer
+// CHECK-DAG: @"\01?s@?1??f@@YAAAUS@@XZ at 4U2@A" = linkonce_odr dso_local thread_local global %struct.S zeroinitializer
 // CHECK-DAG: @"\01??__J?1??f@@YAAAUS@@XZ at 51" = linkonce_odr thread_local global i32 0
-// CHECK-DAG: @"\01?s@?1??g@@YAAAUS@@XZ at 4U2@A" = linkonce_odr global %struct.S zeroinitializer
+// CHECK-DAG: @"\01?s@?1??g@@YAAAUS@@XZ at 4U2@A" = linkonce_odr dso_local global %struct.S zeroinitializer
 // CHECK-DAG: @"\01?$TSS0@?1??g@@YAAAUS@@XZ at 4HA" = linkonce_odr global i32 0
 // CHECK-DAG: @_Init_thread_epoch = external thread_local global i32, align 4
-// CHECK-DAG: @"\01?j@?1??h@@YAAAUS@@_N at Z@4U2 at A" = linkonce_odr thread_local global %struct.S zeroinitializer
+// CHECK-DAG: @"\01?j@?1??h@@YAAAUS@@_N at Z@4U2 at A" = linkonce_odr dso_local thread_local global %struct.S zeroinitializer
 // CHECK-DAG: @"\01??__J?1??h@@YAAAUS@@_N at Z@51" = linkonce_odr thread_local global i32 0
-// CHECK-DAG: @"\01?i@?1??h@@YAAAUS@@_N at Z@4U2 at A" = linkonce_odr global %struct.S zeroinitializer
+// CHECK-DAG: @"\01?i@?1??h@@YAAAUS@@_N at Z@4U2 at A" = linkonce_odr dso_local global %struct.S zeroinitializer
 // CHECK-DAG: @"\01?$TSS0@?1??h@@YAAAUS@@_N at Z@4HA" = linkonce_odr global i32 0
 // CHECK-DAG: @"\01?i@?1??g1@@YAHXZ at 4HA" = internal global i32 0, align 4
 // CHECK-DAG: @"\01?$TSS0@?1??g1@@YAHXZ at 4HA" = internal global i32 0, align 4
@@ -89,7 +89,7 @@ extern inline S&h(bool b) {
   return b ? j : i;
 }
 
-// CHECK-LABEL: define i32 @"\01?g1@@YAHXZ"()
+// CHECK-LABEL: define dso_local i32 @"\01?g1@@YAHXZ"()
 int f1();
 int g1() {
   static int i = f1();

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-thunks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-thunks.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-thunks.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-thunks.cpp Fri Feb 23 11:30:48 2018
@@ -61,13 +61,13 @@ struct C : A, B {
 
 C::C() {}  // Emits vftable and forces thunk generation.
 
-// CODEGEN-LABEL: define linkonce_odr x86_thiscallcc i8* @"\01??_EC@@W3AEPAXI at Z"(%struct.C* %this, i32 %should_call_delete) {{.*}} comdat
+// CODEGEN-LABEL: define linkonce_odr dso_local x86_thiscallcc i8* @"\01??_EC@@W3AEPAXI at Z"(%struct.C* %this, i32 %should_call_delete) {{.*}} comdat
 // CODEGEN:   getelementptr i8, i8* {{.*}}, i32 -4
 // FIXME: should actually call _EC, not _GC.
 // CODEGEN:   call x86_thiscallcc i8* @"\01??_GC@@UAEPAXI at Z"
 // CODEGEN: ret
 
-// CODEGEN-LABEL: define linkonce_odr x86_thiscallcc void @"\01?public_f at C@@W3AEXXZ"(%struct.C*
+// CODEGEN-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"\01?public_f at C@@W3AEXXZ"(%struct.C*
 // CODEGEN:   getelementptr i8, i8* {{.*}}, i32 -4
 // CODEGEN:   call x86_thiscallcc void @"\01?public_f at C@@UAEXXZ"(%struct.C*
 // CODEGEN: ret
@@ -91,7 +91,7 @@ struct E : D {
 
 E::E() {}  // Emits vftable and forces thunk generation.
 
-// CODEGEN-LABEL: define weak_odr x86_thiscallcc %struct.C* @"\01?goo at E@@QAEPAUB@@XZ"{{.*}} comdat
+// CODEGEN-LABEL: define weak_odr dso_local x86_thiscallcc %struct.C* @"\01?goo at E@@QAEPAUB@@XZ"{{.*}} comdat
 // CODEGEN:   call x86_thiscallcc %struct.C* @"\01?goo at E@@UAEPAUC@@XZ"
 // CODEGEN:   getelementptr inbounds i8, i8* {{.*}}, i32 4
 // CODEGEN: ret
@@ -124,7 +124,7 @@ struct I : D {
 
 I::I() {}  // Emits vftable and forces thunk generation.
 
-// CODEGEN-LABEL: define weak_odr x86_thiscallcc %struct.{{[BF]}}* @"\01?goo at I@@QAEPAUB@@XZ"{{.*}} comdat
+// CODEGEN-LABEL: define weak_odr dso_local x86_thiscallcc %struct.{{[BF]}}* @"\01?goo at I@@QAEPAUB@@XZ"{{.*}} comdat
 // CODEGEN: %[[ORIG_RET:.*]] = call x86_thiscallcc %struct.F* @"\01?goo at I@@UAEPAUF@@XZ"
 // CODEGEN: %[[ORIG_RET_i8:.*]] = bitcast %struct.F* %[[ORIG_RET]] to i8*
 // CODEGEN: %[[VBPTR_i8:.*]] = getelementptr inbounds i8, i8* %[[ORIG_RET_i8]], i32 4

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-try-throw.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-try-throw.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-try-throw.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-try-throw.cpp Fri Feb 23 11:30:48 2018
@@ -33,7 +33,7 @@ int main() {
 }
 
 #ifdef TRY
-// TRY-LABEL: define void @"\01?qual_catch@@YAXXZ"
+// TRY-LABEL: define dso_local void @"\01?qual_catch@@YAXXZ"
 void qual_catch() {
   try {
     external();

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-typeid.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-typeid.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-typeid.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-typeid.cpp Fri Feb 23 11:30:48 2018
@@ -12,19 +12,19 @@ extern int b;
 A* fn();
 
 const std::type_info* test0_typeid() { return &typeid(int); }
-// CHECK-LABEL: define %struct.type_info* @"\01?test0_typeid@@YAPBUtype_info@@XZ"()
+// CHECK-LABEL: define dso_local %struct.type_info* @"\01?test0_typeid@@YAPBUtype_info@@XZ"()
 // CHECK:   ret %struct.type_info* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H at 8" to %struct.type_info*)
 
 const std::type_info* test1_typeid() { return &typeid(A); }
-// CHECK-LABEL: define %struct.type_info* @"\01?test1_typeid@@YAPBUtype_info@@XZ"()
+// CHECK-LABEL: define dso_local %struct.type_info* @"\01?test1_typeid@@YAPBUtype_info@@XZ"()
 // CHECK:   ret %struct.type_info* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUA@@@8" to %struct.type_info*)
 
 const std::type_info* test2_typeid() { return &typeid(&a); }
-// CHECK-LABEL: define %struct.type_info* @"\01?test2_typeid@@YAPBUtype_info@@XZ"()
+// CHECK-LABEL: define dso_local %struct.type_info* @"\01?test2_typeid@@YAPBUtype_info@@XZ"()
 // CHECK:   ret %struct.type_info* bitcast (%rtti.TypeDescriptor7* @"\01??_R0PAUA@@@8" to %struct.type_info*)
 
 const std::type_info* test3_typeid() { return &typeid(*fn()); }
-// CHECK-LABEL: define %struct.type_info* @"\01?test3_typeid@@YAPBUtype_info@@XZ"()
+// CHECK-LABEL: define dso_local %struct.type_info* @"\01?test3_typeid@@YAPBUtype_info@@XZ"()
 // CHECK:        [[CALL:%.*]] = tail call %struct.A* @"\01?fn@@YAPAUA@@XZ"()
 // CHECK-NEXT:   [[CMP:%.*]] = icmp eq %struct.A* [[CALL]], null
 // CHECK-NEXT:   br i1 [[CMP]]
@@ -41,11 +41,11 @@ const std::type_info* test3_typeid() { r
 // CHECK-NEXT:   ret %struct.type_info* [[RET]]
 
 const std::type_info* test4_typeid() { return &typeid(b); }
-// CHECK: define %struct.type_info* @"\01?test4_typeid@@YAPBUtype_info@@XZ"()
+// CHECK: define dso_local %struct.type_info* @"\01?test4_typeid@@YAPBUtype_info@@XZ"()
 // CHECK:   ret %struct.type_info* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H at 8" to %struct.type_info*)
 
 const std::type_info* test5_typeid() { return &typeid(v); }
-// CHECK: define %struct.type_info* @"\01?test5_typeid@@YAPBUtype_info@@XZ"()
+// CHECK: define dso_local %struct.type_info* @"\01?test5_typeid@@YAPBUtype_info@@XZ"()
 // CHECK:        [[RT:%.*]] = tail call i8* @__RTtypeid(i8* bitcast (%struct.V* @"\01?v@@3UV@@A" to i8*))
 // CHECK-NEXT:   [[RET:%.*]] = bitcast i8* [[RT]] to %struct.type_info*
 // CHECK-NEXT:   ret %struct.type_info* [[RET]]
@@ -63,7 +63,7 @@ void f(const Polymorphic &poly) {
     typeid(poly);
   }
 }
-// CHECK-LABEL: define void @"\01?f at PR26329@@YAXABUPolymorphic at 1@@Z"(
+// CHECK-LABEL: define dso_local void @"\01?f at PR26329@@YAXABUPolymorphic at 1@@Z"(
 // CHECK: %[[cs:.*]] = catchswitch within none [label %{{.*}}] unwind to caller
 // CHECK: %[[cp:.*]] = catchpad within %[[cs]] [i8* null, i32 64, i8* null]
 // CHECK: invoke i8* @__RTtypeid(i8* {{.*}}) [ "funclet"(token %[[cp]]) ]

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp Fri Feb 23 11:30:48 2018
@@ -23,7 +23,7 @@ struct D : virtual C {
 
 D::D() {}  // Forces vftable emission.
 
-// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01?f at D@@$4PPPPPPPM at A@AEXXZ"
+// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"\01?f at D@@$4PPPPPPPM at A@AEXXZ"
 // Note that the vtordisp is applied before really adjusting to D*.
 // CHECK: %[[COERCE_LOAD:.*]] = load %struct.D*, %struct.D** %{{.*}}
 // CHECK: %[[ECX:.*]] = load %struct.D*, %struct.D** %{{.*}}
@@ -36,7 +36,7 @@ D::D() {}  // Forces vftable emission.
 // CHECK: call x86_thiscallcc void @"\01?f at D@@UAEXXZ"(i8* %[[ADJUSTED_i8]])
 // CHECK: ret void
 
-// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01?f at D@@$4PPPPPPPI at 3AEXXZ"
+// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"\01?f at D@@$4PPPPPPPI at 3AEXXZ"
 // CHECK: %[[COERCE_LOAD:.*]] = load %struct.D*, %struct.D** %{{.*}}
 // CHECK: %[[ECX:.*]] = load %struct.D*, %struct.D** %{{.*}}
 // CHECK: %[[ECX_i8:.*]] = bitcast %struct.D* %[[ECX]] to i8*
@@ -66,7 +66,7 @@ struct G : virtual F, virtual E {
 
 G::G() {}  // Forces vftable emission.
 
-// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @"\01?f at E@@$R4BA at M@PPPPPPPM at 7AEXXZ"(i8*
+// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"\01?f at E@@$R4BA at M@PPPPPPPM at 7AEXXZ"(i8*
 // CHECK: %[[COERCE_LOAD:.*]] = load %struct.E*, %struct.E** %{{.*}}
 // CHECK: %[[ECX:.*]] = load %struct.E*, %struct.E** %{{.*}}
 // CHECK: %[[ECX_i8:.*]] = bitcast %struct.E* %[[ECX]] to i8*

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp Fri Feb 23 11:30:48 2018
@@ -20,7 +20,7 @@ struct B : virtual VBase {
 };
 
 B::B() {
-  // CHECK-LABEL: define x86_thiscallcc %struct.B* @"\01??0B@@QAE at XZ"
+  // CHECK-LABEL: define dso_local x86_thiscallcc %struct.B* @"\01??0B@@QAE at XZ"
   // CHECK:   %[[THIS:.*]] = load %struct.B*, %struct.B**
   // CHECK:   br i1 %{{.*}}, label %[[INIT_VBASES:.*]], label %[[SKIP_VBASES:.*]]
 
@@ -51,7 +51,7 @@ B::B() {
 }
 
 B::~B() {
-  // CHECK-LABEL: define x86_thiscallcc void @"\01??1B@@UAE at XZ"
+  // CHECK-LABEL: define dso_local x86_thiscallcc void @"\01??1B@@UAE at XZ"
   // Store initial this:
   // CHECK:   %[[THIS_ADDR:.*]] = alloca %struct.B*
   // CHECK:   store %struct.B* %{{.*}}, %struct.B** %[[THIS_ADDR]], align 4
@@ -86,7 +86,7 @@ B::~B() {
 
   // CHECK: ret
 
-  // CHECK2-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_DB@@QAEXXZ"(%struct.B*
+  // CHECK2-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"\01??_DB@@QAEXXZ"(%struct.B*
   // CHECK2: %[[THIS:.*]] = load %struct.B*, %struct.B** {{.*}}
   // CHECK2: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
   // CHECK2: %[[B_i8:.*]] = getelementptr i8, i8* %[[THIS_i8]], i32 8
@@ -98,7 +98,7 @@ B::~B() {
   // CHECK2: call x86_thiscallcc void @"\01??1VBase@@UAE at XZ"(%struct.VBase* %[[VBASE]])
   // CHECK2: ret
 
-  // CHECK2-LABEL: define linkonce_odr x86_thiscallcc i8* @"\01??_GB@@UAEPAXI at Z"
+  // CHECK2-LABEL: define linkonce_odr dso_local x86_thiscallcc i8* @"\01??_GB@@UAEPAXI at Z"
   // CHECK2:   store %struct.B* %{{.*}}, %struct.B** %[[THIS_ADDR:.*]], align 4
   // CHECK2:   %[[THIS:.*]] = load %struct.B*, %struct.B** %[[THIS_ADDR]]
   // CHECK2:   %[[THIS_PARAM_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
@@ -110,7 +110,7 @@ B::~B() {
 }
 
 void B::foo() {
-// CHECK-LABEL: define x86_thiscallcc void @"\01?foo at B@@UAEXXZ"(i8*
+// CHECK-LABEL: define dso_local x86_thiscallcc void @"\01?foo at B@@UAEXXZ"(i8*
 //
 // B::foo gets 'this' cast to VBase* in ECX (i.e. this+8) so we
 // need to adjust 'this' before use.
@@ -149,7 +149,7 @@ void B::foo() {
 }
 
 void call_vbase_bar(B *obj) {
-// CHECK-LABEL: define void @"\01?call_vbase_bar@@YAXPAUB@@@Z"(%struct.B* %obj)
+// CHECK-LABEL: define dso_local void @"\01?call_vbase_bar@@YAXPAUB@@@Z"(%struct.B* %obj)
 // CHECK: %[[OBJ:.*]] = load %struct.B
 
   obj->bar();
@@ -184,7 +184,7 @@ void call_vbase_bar(B *obj) {
 }
 
 void delete_B(B *obj) {
-// CHECK-LABEL: define void @"\01?delete_B@@YAXPAUB@@@Z"(%struct.B* %obj)
+// CHECK-LABEL: define dso_local void @"\01?delete_B@@YAXPAUB@@@Z"(%struct.B* %obj)
 // CHECK: %[[OBJ:.*]] = load %struct.B
 
   delete obj;
@@ -216,7 +216,7 @@ void delete_B(B *obj) {
 }
 
 void call_complete_dtor() {
-  // CHECK-LABEL: define void @"\01?call_complete_dtor@@YAXXZ"
+  // CHECK-LABEL: define dso_local void @"\01?call_complete_dtor@@YAXXZ"
   B b;
   // CHECK: call x86_thiscallcc %struct.B* @"\01??0B@@QAE at XZ"(%struct.B* %[[B:.*]], i32 1)
   // CHECK-NOT: getelementptr
@@ -231,7 +231,7 @@ struct C : B {
 
 // Used to crash on an assertion.
 C::C() {
-// CHECK-LABEL: define x86_thiscallcc %struct.C* @"\01??0C@@QAE at XZ"
+// CHECK-LABEL: define dso_local x86_thiscallcc %struct.C* @"\01??0C@@QAE at XZ"
 }
 
 namespace multiple_vbases {
@@ -255,7 +255,7 @@ struct D : virtual A, virtual B, virtual
 };
 
 D::D() {
-  // CHECK-LABEL: define x86_thiscallcc %"struct.multiple_vbases::D"* @"\01??0D at multiple_vbases@@QAE at XZ"
+  // CHECK-LABEL: define dso_local x86_thiscallcc %"struct.multiple_vbases::D"* @"\01??0D at multiple_vbases@@QAE at XZ"
   // Just make sure we emit 3 vtordisps after initializing vfptrs.
   // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"\01??_7D at multiple_vbases@@6BA at 1@@" to i32 (...)**), i32 (...)*** %{{.*}}
   // CHECK: store i32 (...)** bitcast ({ [1 x i8*] }* @"\01??_7D at multiple_vbases@@6BB at 1@@" to i32 (...)**), i32 (...)*** %{{.*}}
@@ -295,7 +295,7 @@ struct D : virtual Z, B, C {
 } d;
 
 D::~D() {
-  // CHECK-LABEL: define x86_thiscallcc void @"\01??1D at diamond@@UAE at XZ"(%"struct.diamond::D"*{{.*}})
+  // CHECK-LABEL: define dso_local x86_thiscallcc void @"\01??1D at diamond@@UAE at XZ"(%"struct.diamond::D"*{{.*}})
   // Store initial this:
   // CHECK: %[[THIS_ADDR:.*]] = alloca %"struct.diamond::D"*
   // CHECK: store %"struct.diamond::D"* %{{.*}}, %"struct.diamond::D"** %[[THIS_ADDR]], align 4
@@ -334,7 +334,7 @@ struct C : B, A { C() {} };
 // call to B() from C().
 void callC() { C x; }
 
-// CHECK-LABEL: define linkonce_odr x86_thiscallcc %"struct.test2::C"* @"\01??0C at test2@@QAE at XZ"
+// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc %"struct.test2::C"* @"\01??0C at test2@@QAE at XZ"
 // CHECK:           (%"struct.test2::C"* returned %this, i32 %is_most_derived)
 // CHECK: br i1
 //   Virtual bases
@@ -345,7 +345,7 @@ void callC() { C x; }
 // CHECK: call x86_thiscallcc %"struct.test2::A"* @"\01??0A at test2@@QAE at XZ"(%"struct.test2::A"* %{{.*}})
 // CHECK: ret
 
-// CHECK2-LABEL: define linkonce_odr x86_thiscallcc %"struct.test2::B"* @"\01??0B at test2@@QAE at XZ"
+// CHECK2-LABEL: define linkonce_odr dso_local x86_thiscallcc %"struct.test2::B"* @"\01??0B at test2@@QAE at XZ"
 // CHECK2:           (%"struct.test2::B"* returned %this, i32 %is_most_derived)
 // CHECK2: call x86_thiscallcc %"struct.test2::A"* @"\01??0A at test2@@QAE at XZ"(%"struct.test2::A"* %{{.*}})
 // CHECK2: ret
@@ -374,7 +374,7 @@ struct D : B, C {
 };
 
 void D::bar() {
-  // CHECK-LABEL: define x86_thiscallcc void @"\01?bar at D@test3@@UAEXXZ"(%"struct.test3::D"* %this)
+  // CHECK-LABEL: define dso_local x86_thiscallcc void @"\01?bar at D@test3@@UAEXXZ"(%"struct.test3::D"* %this)
 
   C::foo();
   // Shouldn't need any vbtable lookups.  All we have to do is adjust to C*,
@@ -408,7 +408,7 @@ struct C : virtual A, B {
 void foo(void*);
 
 C::~C() {
-  // CHECK-LABEL: define x86_thiscallcc void @"\01??1C at test4@@UAE at XZ"(%"struct.test4::C"* %this)
+  // CHECK-LABEL: define dso_local x86_thiscallcc void @"\01??1C at test4@@UAE at XZ"(%"struct.test4::C"* %this)
 
   // In this case "this" points to the most derived class, so no GEPs needed.
   // CHECK-NOT: getelementptr
@@ -421,7 +421,7 @@ C::~C() {
 }
 
 void destroy(C *obj) {
-  // CHECK-LABEL: define void @"\01?destroy at test4@@YAXPAUC at 1@@Z"(%"struct.test4::C"* %obj)
+  // CHECK-LABEL: define dso_local void @"\01?destroy at test4@@YAXPAUC at 1@@Z"(%"struct.test4::C"* %obj)
 
   delete obj;
   // CHECK: %[[VPTR:.*]] = bitcast %"struct.test4::C"* %[[OBJ:.*]] to i8* (%"struct.test4::C"*, i32)***
@@ -443,7 +443,7 @@ struct E : D, B, virtual A {
 };
 
 E::~E() {
-  // CHECK-LABEL: define x86_thiscallcc void @"\01??1E at test4@@UAE at XZ"(%"struct.test4::E"* %this)
+  // CHECK-LABEL: define dso_local x86_thiscallcc void @"\01??1E at test4@@UAE at XZ"(%"struct.test4::E"* %this)
 
   // In this case "this" points to the most derived class, so no GEPs needed.
   // CHECK-NOT: getelementptr
@@ -454,7 +454,7 @@ E::~E() {
 }
 
 void destroy(E *obj) {
-  // CHECK-LABEL: define void @"\01?destroy at test4@@YAXPAUE at 1@@Z"(%"struct.test4::E"* %obj)
+  // CHECK-LABEL: define dso_local void @"\01?destroy at test4@@YAXPAUE at 1@@Z"(%"struct.test4::E"* %obj)
 
   // CHECK-NOT: getelementptr
   // CHECK: %[[OBJ_i8:.*]] = bitcast %"struct.test4::E"* %[[OBJ]] to i8*
@@ -488,7 +488,7 @@ struct C : B {
 };
 
 C::C() : B() {}
-// CHECK-LABEL: define x86_thiscallcc %"struct.test5::C"* @"\01??0C at test5@@QAE at XZ"(
+// CHECK-LABEL: define dso_local x86_thiscallcc %"struct.test5::C"* @"\01??0C at test5@@QAE at XZ"(
 // CHECK:   %[[THIS:.*]] = load %"struct.test5::C"*, %"struct.test5::C"**
 // CHECK:   br i1 %{{.*}}, label %[[INIT_VBASES:.*]], label %[[SKIP_VBASES:.*]]
 
@@ -512,7 +512,7 @@ struct C final : A, B {
 void callit(C *p) {
   static_cast<B*>(p)->g();
 }
-// CHECK-LABEL: define void @"\01?callit at pr27621@@YAXPAUC at 1@@Z"(%"struct.pr27621::C"* %{{.*}})
+// CHECK-LABEL: define dso_local void @"\01?callit at pr27621@@YAXPAUC at 1@@Z"(%"struct.pr27621::C"* %{{.*}})
 // CHECK: %[[B_i8:.*]] = getelementptr i8, i8* %{{.*}}, i32 4
 // CHECK: call x86_thiscallcc void @"\01?g at C@pr27621@@UAEXXZ"(i8* %[[B_i8]])
 }
@@ -528,7 +528,7 @@ class D : C {
   D();
 };
 D::D() : C() {}
-// CHECK-LABEL: define x86_thiscallcc %"class.test6::D"* @"\01??0D at test6@@AAE at XZ"(
+// CHECK-LABEL: define dso_local x86_thiscallcc %"class.test6::D"* @"\01??0D at test6@@AAE at XZ"(
 // CHECK:   %[[THIS:.*]] = load %"class.test6::D"*, %"class.test6::D"**
 // CHECK:   br i1 %{{.*}}, label %[[INIT_VBASES:.*]], label %[[SKIP_VBASES:.*]]
 

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp Fri Feb 23 11:30:48 2018
@@ -53,14 +53,14 @@ void f() {
   auto ptr7 = &C::plugh;
 
 
-// CHECK32-LABEL: define void @"\01?f@@YAXXZ"()
+// CHECK32-LABEL: define dso_local void @"\01?f@@YAXXZ"()
 // CHECK32: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$BA at AE" to i8*), i8** %ptr
 // CHECK32: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$B3AE" to i8*), i8** %ptr2
 // CHECK32: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$B7AE" to i8*), i8** %ptr3
 // CHECK32: store i8* bitcast (void (%"struct.(anonymous namespace)::D"*, ...)* @"\01??_9D@?A@@$BA at AE" to i8*), i8** %ptr4
 // CHECK32: }
 //
-// CHECK64-LABEL: define void @"\01?f@@YAXXZ"()
+// CHECK64-LABEL: define dso_local void @"\01?f@@YAXXZ"()
 // CHECK64: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$BA at AA" to i8*), i8** %ptr
 // CHECK64: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$B7AA" to i8*), i8** %ptr2
 // CHECK64: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$BBA at AA" to i8*), i8** %ptr3

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp Fri Feb 23 11:30:48 2018
@@ -19,7 +19,7 @@ void f(C *c) {
 }
 }
 
-// CHECK-LABEL: define void @"\01?f at num_params@@YAXPAUC at 1@@Z"(%"struct.num_params::C"* %c)
+// CHECK-LABEL: define dso_local void @"\01?f at num_params@@YAXPAUC at 1@@Z"(%"struct.num_params::C"* %c)
 // CHECK: call x86_thiscallcc void bitcast (void (%"struct.num_params::C"*, ...)* @"\01??_9C at num_params@@$BA at AE" to void (%"struct.num_params::C"*, i32)*)(%"struct.num_params::C"* %{{.*}}, i32 0)
 // CHECK: call x86_thiscallcc void bitcast (void (%"struct.num_params::C"*, ...)* @"\01??_9C at num_params@@$BA at AE" to void (%"struct.num_params::C"*, i32, i32)*)(%"struct.num_params::C"* %{{.*}}, i32 0, i32 0)
 
@@ -41,7 +41,7 @@ long long f(C *c) {
 }
 }
 
-// CHECK-LABEL: define i64 @"\01?f at i64_return@@YA_JPAUC at 1@@Z"(%"struct.i64_return::C"* %c)
+// CHECK-LABEL: define dso_local i64 @"\01?f at i64_return@@YA_JPAUC at 1@@Z"(%"struct.i64_return::C"* %c)
 // CHECK: call x86_thiscallcc i32 bitcast (void (%"struct.i64_return::C"*, ...)* @"\01??_9C at i64_return@@$BA at AE" to i32 (%"struct.i64_return::C"*)*)(%"struct.i64_return::C"* %{{.*}})
 // CHECK: call x86_thiscallcc i64 bitcast (void (%"struct.i64_return::C"*, ...)* @"\01??_9C at i64_return@@$BA at AE" to i64 (%"struct.i64_return::C"*)*)(%"struct.i64_return::C"* %{{.*}})
 
@@ -63,7 +63,7 @@ void f(C *c) {
 }
 }
 
-// CHECK-LABEL: define void @"\01?f at sret@@YAXPAUC at 1@@Z"(%"struct.sret::C"* %c)
+// CHECK-LABEL: define dso_local void @"\01?f at sret@@YAXPAUC at 1@@Z"(%"struct.sret::C"* %c)
 // CHECK: call x86_thiscallcc i32 bitcast (void (%"struct.sret::C"*, ...)* @"\01??_9C at sret@@$BA at AE" to i32 (%"struct.sret::C"*)*)(%"struct.sret::C"* %{{.*}})
 // CHECK: call x86_thiscallcc void bitcast (void (%"struct.sret::C"*, ...)* @"\01??_9C at sret@@$BA at AE" to void (%"struct.sret::C"*, %"struct.sret::Big"*)*)(%"struct.sret::C"* %{{.*}}, %"struct.sret::Big"* sret %{{.*}})
 
@@ -92,7 +92,7 @@ void f(C *c) {
 }
 }
 
-// CHECK-LABEL: define void @"\01?f at cdecl_inalloca@@YAXPAUC at 1@@Z"(%"struct.cdecl_inalloca::C"* %c)
+// CHECK-LABEL: define dso_local void @"\01?f at cdecl_inalloca@@YAXPAUC at 1@@Z"(%"struct.cdecl_inalloca::C"* %c)
 // CHECK: call void bitcast (void (%"struct.cdecl_inalloca::C"*, ...)* @"\01??_9C at cdecl_inalloca@@$BA at AA" to void (%"struct.cdecl_inalloca::C"*)*)(%"struct.cdecl_inalloca::C"* %{{.*}})
 // CHECK: call void bitcast (void (%"struct.cdecl_inalloca::C"*, ...)* @"\01??_9C at cdecl_inalloca@@$BA at AA" to void (<{ %"struct.cdecl_inalloca::C"*, %"struct.cdecl_inalloca::Big" }>*)*)(<{ %"struct.cdecl_inalloca::C"*, %"struct.cdecl_inalloca::Big" }>* inalloca %{{.*}})
 

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-vmemptr-vbase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-vmemptr-vbase.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-vmemptr-vbase.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-vmemptr-vbase.cpp Fri Feb 23 11:30:48 2018
@@ -8,5 +8,5 @@ struct B : virtual A {
     virtual void f();
 };
 void (B::*MemPtr)(void) = &B::f;
-// CHECK-DAG: @"\01?MemPtr at PR23452@@3P8B at 1@AEXXZQ21@" = global { i8*, i32, i32 } { i8* bitcast ({{.*}} @"\01??_9B at PR23452@@$BA at AE" to i8*), i32 0, i32 4 }
+// CHECK-DAG: @"\01?MemPtr at PR23452@@3P8B at 1@AEXXZQ21@" = dso_local global { i8*, i32, i32 } { i8* bitcast ({{.*}} @"\01??_9B at PR23452@@$BA at AE" to i8*), i32 0, i32 4 }
 }

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp Fri Feb 23 11:30:48 2018
@@ -189,7 +189,7 @@ void C::g(NonTrivial o) {
   whatsthis = this;
 }
 
-// BITCODE-LABEL: define void @"\01?g at C@pr30293@@UAAXUNonTrivial at 2@@Z"(<{ i8*, %"struct.pr30293::NonTrivial" }>* inalloca)
+// BITCODE-LABEL: define dso_local void @"\01?g at C@pr30293@@UAAXUNonTrivial at 2@@Z"(<{ i8*, %"struct.pr30293::NonTrivial" }>* inalloca)
 // BITCODE: %[[thisaddr:[^ ]*]] = getelementptr inbounds <{ i8*, %"struct.pr30293::NonTrivial" }>, <{ i8*, %"struct.pr30293::NonTrivial" }>* {{.*}}, i32 0, i32 0
 // BITCODE: %[[thisaddr1:[^ ]*]] = bitcast i8** %[[thisaddr]] to %"struct.pr30293::C"**
 // BITCODE: %[[this1:[^ ]*]] = load %"struct.pr30293::C"*, %"struct.pr30293::C"** %[[thisaddr1]], align 4

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp Fri Feb 23 11:30:48 2018
@@ -145,7 +145,7 @@ struct X: virtual C {
   // MANGLING-DAG: @"\01??_7X at Test4@@6B@"
 
   // Also check the mangling of the thunk.
-  // MANGLING-DAG: define linkonce_odr x86_thiscallcc void @"\01?f at C@@WPPPPPPPI at AEXXZ"
+  // MANGLING-DAG: define linkonce_odr dso_local x86_thiscallcc void @"\01?f at C@@WPPPPPPPI at AEXXZ"
 };
 
 X::X() {}

Modified: cfe/trunk/test/CodeGenCXX/microsoft-compatibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-compatibility.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-compatibility.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-compatibility.cpp Fri Feb 23 11:30:48 2018
@@ -8,7 +8,7 @@ struct S {
 template <>
 const int S<char>::x[] = {1};
 
-// CHECK-LABEL: @"\01?x@?$S at D@@2QBHB" = weak_odr constant [1 x i32] [i32 1], comdat
+// CHECK-LABEL: @"\01?x@?$S at D@@2QBHB" = weak_odr dso_local constant [1 x i32] [i32 1], comdat
 
 template<class T>
 void destroy(T *p) {
@@ -20,11 +20,11 @@ extern "C" void f() {
   destroy((void*)&a);
 }
 
-// CHECK-LABEL: define void @f()
+// CHECK-LABEL: define dso_local void @f()
 // CHECK: call void @"\01??$destroy at X@@YAXPAX at Z"
 // CHECK: ret void
 
-// CHECK-LABEL: define linkonce_odr void @"\01??$destroy at X@@YAXPAX at Z"(i8* %p)
+// CHECK-LABEL: define linkonce_odr dso_local void @"\01??$destroy at X@@YAXPAX at Z"(i8* %p)
 //    The pseudo-dtor expr should not generate calls to anything.
 // CHECK-NOT: call
 // CHECK-NOT: invoke

Modified: cfe/trunk/test/CodeGenCXX/microsoft-inaccessible-base.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-inaccessible-base.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-inaccessible-base.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-inaccessible-base.cpp Fri Feb 23 11:30:48 2018
@@ -10,11 +10,11 @@ struct B : A { int b; };
 
 struct C : A, B { };
 extern "C" A *a_from_c(C *p) { return p; }
-// CHECK-LABEL: define %struct.A* @a_from_c(%struct.C* %{{.*}})
+// CHECK-LABEL: define dso_local %struct.A* @a_from_c(%struct.C* %{{.*}})
 // CHECK: bitcast %struct.C* %{{.*}} to %struct.A*
 
 struct D : B, A { };
 extern "C" A *a_from_d(D *p) { return p; }
-// CHECK-LABEL: define %struct.A* @a_from_d(%struct.D* %{{.*}})
+// CHECK-LABEL: define dso_local %struct.A* @a_from_d(%struct.D* %{{.*}})
 // CHECK: %[[p_i8:[^ ]*]] = bitcast %struct.D* %{{.*}} to i8*
 // CHECK: getelementptr inbounds i8, i8* %[[p_i8]], i64 8

Modified: cfe/trunk/test/CodeGenCXX/microsoft-interface.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-interface.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-interface.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-interface.cpp Fri Feb 23 11:30:48 2018
@@ -17,24 +17,24 @@ int fn() {
   return s.test();
 }
 
-// CHECK: @_ZTV1S = linkonce_odr unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1S to i8*), i8* bitcast (i32 (%struct.S*)* @_ZN1S4testEv to i8*)] }
+// CHECK: @_ZTV1S = linkonce_odr dso_local unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1S to i8*), i8* bitcast (i32 (%struct.S*)* @_ZN1S4testEv to i8*)] }
 
-// CHECK-LABEL: define i32 @_Z2fnv()
+// CHECK-LABEL: define dso_local i32 @_Z2fnv()
 // CHECK:   call x86_thiscallcc void @_ZN1SC1Ev(%struct.S* %s)
 // CHECK:   %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc i32 @_ZN1S4testEv(%struct.S* %s)
 
-// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @_ZN1SC1Ev(%struct.S* %this)
+// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @_ZN1SC1Ev(%struct.S* %this)
 // CHECK:   call x86_thiscallcc void @_ZN1SC2Ev(%struct.S* %{{[.0-9A-Z_a-z]+}})
 
-// CHECK-LABEL: define linkonce_odr x86_thiscallcc i32 @_ZN1S4testEv(%struct.S* %this)
+// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc i32 @_ZN1S4testEv(%struct.S* %this)
 // CHECK:   %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc i32 @_ZN1I4testEv(%__interface.I* %{{[.0-9A-Z_a-z]+}})
 
-// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @_ZN1SC2Ev(%struct.S* %this)
+// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @_ZN1SC2Ev(%struct.S* %this)
 // CHECK:   call x86_thiscallcc void @_ZN1IC2Ev(%__interface.I* %{{[.0-9A-Z_a-z]+}})
 // CHECK:   store i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTV1S, i32 0, inrange i32 0, i32 2) to i32 (...)**), i32 (...)*** %{{[.0-9A-Z_a-z]+}}
 
-// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @_ZN1IC2Ev(%__interface.I* %this)
+// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @_ZN1IC2Ev(%__interface.I* %this)
 // CHECK:   store i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTV1I, i32 0, inrange i32 0, i32 2) to i32 (...)**), i32 (...)*** %{{[.0-9A-Z_a-z]+}}
 
-// CHECK-LABEL: define linkonce_odr x86_thiscallcc i32 @_ZN1I4testEv(%__interface.I* %this)
+// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc i32 @_ZN1I4testEv(%__interface.I* %this)
 // CHECK:   ret i32 1

Modified: cfe/trunk/test/CodeGenCXX/mingw-new-abi.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mingw-new-abi.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mingw-new-abi.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mingw-new-abi.cpp Fri Feb 23 11:30:48 2018
@@ -3,8 +3,8 @@
 
 namespace test1 {
   struct foo {
-    //  MINGW: declare x86_thiscallcc void @_ZN5test13foo1fEv
-    //  CYGWIN: declare void @_ZN5test13foo1fEv
+    //  MINGW: declare dso_local x86_thiscallcc void @_ZN5test13foo1fEv
+    //  CYGWIN: declare dso_local void @_ZN5test13foo1fEv
     void f();
   };
   void g(foo *x) {

Modified: cfe/trunk/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp Fri Feb 23 11:30:48 2018
@@ -16,12 +16,12 @@ extern "C" void test() {
   foo();
 }
 
-// X64: define void @test()
+// X64: define dso_local void @test()
 // X64-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_seh0 to i8*)
 // X64: invoke void @foo()
 // X64: landingpad { i8*, i32 }
 
-// X86: define void @test()
+// X86: define dso_local void @test()
 // X86-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
 // X86: invoke void @foo()
 // X86: landingpad { i8*, i32 }

Modified: cfe/trunk/test/CodeGenCXX/ms-eh-personality.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/ms-eh-personality.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/ms-eh-personality.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/ms-eh-personality.cpp Fri Feb 23 11:30:48 2018
@@ -3,9 +3,9 @@
 // RUN: %clang_cc1 -triple x86_64-windows-msvc -fexceptions -fcxx-exceptions -fseh-exceptions %s -emit-llvm -o - | FileCheck %s --check-prefix=MSVC
 // RUN: %clang_cc1 -triple x86_64-windows-msvc -fexceptions -fcxx-exceptions -fdwarf-exceptions %s -emit-llvm -o - | FileCheck %s --check-prefix=DWARF
 
-// MSVC: define void @f(){{.*}}@__CxxFrameHandler3
-// SJLJ: define void @f(){{.*}}@__gxx_personality_sj0
-// DWARF: define void @f(){{.*}}@__gxx_personality_v0
+// MSVC: define dso_local void @f(){{.*}}@__CxxFrameHandler3
+// SJLJ: define dso_local void @f(){{.*}}@__gxx_personality_sj0
+// DWARF: define dso_local void @f(){{.*}}@__gxx_personality_v0
 
 struct Cleanup {
   Cleanup();

Modified: cfe/trunk/test/CodeGenCXX/ms-inline-asm-return.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/ms-inline-asm-return.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/ms-inline-asm-return.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/ms-inline-asm-return.cpp Fri Feb 23 11:30:48 2018
@@ -12,7 +12,7 @@ long long f_i64() {
     mov edx, 1
   }
 }
-// CHECK-LABEL: define i64 @f_i64()
+// CHECK-LABEL: define dso_local i64 @f_i64()
 // CHECK: %[[r:[^ ]*]] = call i64 asm sideeffect inteldialect "mov eax, $$1\0A\09mov edx, $$1", "=A,~{eax},{{.*}}"
 // CHECK: ret i64 %[[r]]
 
@@ -22,7 +22,7 @@ int f_i32() {
     mov edx, 1
   }
 }
-// CHECK-LABEL: define i32 @f_i32()
+// CHECK-LABEL: define dso_local i32 @f_i32()
 // CHECK: %[[r:[^ ]*]] = call i32 asm sideeffect inteldialect "mov eax, $$1\0A\09mov edx, $$1", "={eax},~{eax},{{.*}}"
 // CHECK: ret i32 %[[r]]
 
@@ -32,7 +32,7 @@ short f_i16() {
     mov edx, 1
   }
 }
-// CHECK-LABEL: define signext i16 @f_i16()
+// CHECK-LABEL: define dso_local signext i16 @f_i16()
 // CHECK: %[[r:[^ ]*]] = call i32 asm sideeffect inteldialect "mov eax, $$1\0A\09mov edx, $$1", "={eax},~{eax},{{.*}}"
 // CHECK: %[[r_i16:[^ ]*]] = trunc i32 %[[r]] to i16
 // CHECK: ret i16 %[[r_i16]]
@@ -43,7 +43,7 @@ char f_i8() {
     mov edx, 1
   }
 }
-// CHECK-LABEL: define signext i8 @f_i8()
+// CHECK-LABEL: define dso_local signext i8 @f_i8()
 // CHECK: %[[r:[^ ]*]] = call i32 asm sideeffect inteldialect "mov eax, $$1\0A\09mov edx, $$1", "={eax},~{eax},{{.*}}"
 // CHECK: %[[r_i8:[^ ]*]] = trunc i32 %[[r]] to i8
 // CHECK: ret i8 %[[r_i8]]
@@ -54,7 +54,7 @@ bool f_i1() {
     mov edx, 1U
   }
 }
-// CHECK-LABEL: define zeroext i1 @f_i1()
+// CHECK-LABEL: define dso_local zeroext i1 @f_i1()
 // CHECK: %[[r:[^ ]*]] = call i32 asm sideeffect inteldialect "mov eax, $$1\0A\09mov edx, $$1", "={eax},~{eax},{{.*}}"
 // CHECK: %[[r_i8:[^ ]*]] = trunc i32 %[[r]] to i8
 // CHECK: store i8 %[[r_i8]], i8* %{{.*}}
@@ -69,7 +69,7 @@ FourChars f_s4() {
     mov eax, 0x01010101
   }
 }
-// CHECK-LABEL: define i32 @f_s4()
+// CHECK-LABEL: define dso_local i32 @f_s4()
 // CHECK: %[[r:[^ ]*]] = call i32 asm sideeffect inteldialect "mov eax, $$16843009", "={eax},~{eax},{{.*}}"
 // CHECK: store i32 %[[r]], i32* %{{.*}}
 // CHECK: %[[r_i32:[^ ]*]] = load i32, i32* %{{.*}}
@@ -84,7 +84,7 @@ EightChars f_s8() {
     mov edx, 01010101b
   }
 }
-// CHECK-LABEL: define i64 @f_s8()
+// CHECK-LABEL: define dso_local i64 @f_s8()
 // CHECK: %[[r:[^ ]*]] = call i64 asm sideeffect inteldialect "mov eax, $$16843009\0A\09mov edx, $$85", "=A,~{eax},{{.*}}"
 // CHECK: store i64 %[[r]], i64* %{{.*}}
 // CHECK: %[[r_i64:[^ ]*]] = load i64, i64* %{{.*}}
@@ -95,6 +95,6 @@ EightChars f_s8() {
 int main() {
   __asm xor eax, eax
 }
-// CHECK-LABEL: define i32 @main()
+// CHECK-LABEL: define dso_local i32 @main()
 // CHECK: %[[r:[^ ]*]] = call i32 asm sideeffect inteldialect "xor eax, eax", "={eax},{{.*}}"
 // CHECK: ret i32 %[[r]]

Modified: cfe/trunk/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp Fri Feb 23 11:30:48 2018
@@ -17,6 +17,6 @@ struct __declspec(dllexport) S {
   };
 };
 
-// CHECK: @"\01?x at S@@2FB" = weak_odr dllexport constant i16 42, comdat, align 2
-// CHECK: @"\01?y at S@@2W4Enum@@B" = weak_odr dllexport constant i32 2, comdat, align 4
+// CHECK: @"\01?x at S@@2FB" = weak_odr dso_local dllexport constant i16 42, comdat, align 2
+// CHECK: @"\01?y at S@@2W4Enum@@B" = weak_odr dso_local dllexport constant i32 2, comdat, align 4
 // CHECK-NOT: NonExported

Modified: cfe/trunk/test/CodeGenCXX/ms-integer-static-data-members.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/ms-integer-static-data-members.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/ms-integer-static-data-members.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/ms-integer-static-data-members.cpp Fri Feb 23 11:30:48 2018
@@ -33,20 +33,20 @@ const int S::OutOfLine_Def_Ref = 5;
 
 
 // No initialization.
-// CHECK-DAG: @"\01?NoInit_Ref at S@@2HB" = external constant i32
+// CHECK-DAG: @"\01?NoInit_Ref at S@@2HB" = external dso_local constant i32
 
 // Inline initialization, no real definiton, not referenced.
 // CHECK-NOT: @"\01?Inline_NotDef_NotRef at S@@2HB" = {{.*}} constant i32 5
 
 // Inline initialization, no real definiton, referenced.
-// CHECK-DAG: @"\01?Inline_NotDef_Ref at S@@2HB" = linkonce_odr constant i32 5, comdat, align 4
+// CHECK-DAG: @"\01?Inline_NotDef_Ref at S@@2HB" = linkonce_odr dso_local constant i32 5, comdat, align 4
 
 // Inline initialization, real definiton, not referenced.
-// CHECK-NOT: @"\01?Inline_Def_NotRef at S@@2HB" = constant i32 5, align 4
+// CHECK-NOT: @"\01?Inline_Def_NotRef at S@@2HB" = dso_local constant i32 5, align 4
 
 // Inline initialization, real definiton, referenced.
-// CHECK-DAG: @"\01?Inline_Def_Ref at S@@2HB" = linkonce_odr constant i32 5, comdat, align 4
+// CHECK-DAG: @"\01?Inline_Def_Ref at S@@2HB" = linkonce_odr dso_local constant i32 5, comdat, align 4
 
 // Out-of-line initialization.
-// CHECK-DAG: @"\01?OutOfLine_Def_NotRef at S@@2HB" = constant i32 5, align 4
-// CHECK-DAG: @"\01?OutOfLine_Def_Ref at S@@2HB" = constant i32 5, align 4
+// CHECK-DAG: @"\01?OutOfLine_Def_NotRef at S@@2HB" = dso_local constant i32 5, align 4
+// CHECK-DAG: @"\01?OutOfLine_Def_Ref at S@@2HB" = dso_local constant i32 5, align 4

Modified: cfe/trunk/test/CodeGenCXX/ms-property.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/ms-property.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/ms-property.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/ms-property.cpp Fri Feb 23 11:30:48 2018
@@ -102,7 +102,7 @@ int main(int argc, char **argv) {
   return Test1::GetTest1()->X;
 }
 
-// CHECK: define linkonce_odr void @"\01??$foo at H@@YAXHH at Z"(i32 %{{.+}}, i32 %{{.+}})
+// CHECK: define linkonce_odr dso_local void @"\01??$foo at H@@YAXHH at Z"(i32 %{{.+}}, i32 %{{.+}})
 // CHECK: call i32 @"\01?GetX@?$St at H@@QEAAHHH at Z"(%class.St{{.+}}* [[BAR:%.+]], i32 %{{.+}} i32 %{{.+}})
 // CHECK: call i32 @"\01?PutX@?$St at H@@QEAAHHHH at Z"(%class.St{{.+}}* [[BAR]], i32 %{{.+}}, i32 %{{.+}}, i32 %{{.+}})
 // CHECK: call i32 @"\01?GetX@?$St at H@@QEAAHHH at Z"(%class.St{{.+}}* [[BAR]], i32 %{{.+}} i32 %{{.+}})

Modified: cfe/trunk/test/CodeGenCXX/ms-thread_local.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/ms-thread_local.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/ms-thread_local.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/ms-thread_local.cpp Fri Feb 23 11:30:48 2018
@@ -6,12 +6,12 @@ struct A {
 };
 
 // CHECK-DAG: $"\01??$a at X@@3UA@@A" = comdat any
-// CHECK-DAG: @"\01??$a at X@@3UA@@A" = linkonce_odr thread_local global %struct.A zeroinitializer, comdat, align 1
+// CHECK-DAG: @"\01??$a at X@@3UA@@A" = linkonce_odr dso_local thread_local global %struct.A zeroinitializer, comdat, align 1
 // CHECK-DAG: @"\01??__E?$a at X@@YAXXZ$initializer$" = internal constant void ()* @"\01??__E?$a at X@@YAXXZ", section ".CRT$XDU", comdat($"\01??$a at X@@3UA@@A")
 template <typename T>
 thread_local A a = A();
 
-// CHECK-DAG: @"\01?b@@3UA@@A" = thread_local global %struct.A zeroinitializer, align 1
+// CHECK-DAG: @"\01?b@@3UA@@A" = dso_local thread_local global %struct.A zeroinitializer, align 1
 // CHECK-DAG: @"__tls_init$initializer$" = internal constant void ()* @__tls_init, section ".CRT$XDU"
 thread_local A b;
 

Modified: cfe/trunk/test/CodeGenCXX/naked.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/naked.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/naked.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/naked.cpp Fri Feb 23 11:30:48 2018
@@ -7,7 +7,7 @@ public:
 };
 
 __attribute__((naked)) void TestNaked::NakedFunction() {
-  // CHECK-LABEL: define {{(x86_thiscallcc )?}}void @
+  // CHECK-LABEL: define {{(dso_local )?}}{{(x86_thiscallcc )?}}void @
   // CHECK: call void asm sideeffect
   asm("");
 }

Modified: cfe/trunk/test/CodeGenCXX/pr20897.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pr20897.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/pr20897.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/pr20897.cpp Fri Feb 23 11:30:48 2018
@@ -3,7 +3,7 @@ struct Base {};
 
 // __declspec(dllexport) causes us to export the implicit constructor.
 struct __declspec(dllexport) Derived : virtual Base {
-// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc %struct.Derived* @"\01??0Derived@@QAE at ABU0@@Z"
+// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc %struct.Derived* @"\01??0Derived@@QAE at ABU0@@Z"
 // CHECK:      %[[this:.*]] = load %struct.Derived*, %struct.Derived** {{.*}}
 // CHECK-NEXT: store %struct.Derived* %[[this]], %struct.Derived** %[[retval:.*]]
 // CHECK:      %[[dest_a_gep:.*]] = getelementptr inbounds %struct.Derived, %struct.Derived* %[[this]], i32 0, i32 1
@@ -18,7 +18,7 @@ struct __declspec(dllexport) Derived : v
 
 // __declspec(dllexport) causes us to export the implicit copy constructor.
 struct __declspec(dllexport) Derived2 : virtual Base {
-// CHECK-LABEL: define weak_odr dllexport x86_thiscallcc %struct.Derived2* @"\01??0Derived2@@QAE at ABU0@@Z"
+// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc %struct.Derived2* @"\01??0Derived2@@QAE at ABU0@@Z"
 // CHECK:      %[[this:.*]] = load %struct.Derived2*, %struct.Derived2** {{.*}}
 // CHECK-NEXT: store %struct.Derived2* %[[this]], %struct.Derived2** %[[retval:.*]]
 // CHECK:      %[[dest_a_gep:.*]] = getelementptr inbounds %struct.Derived2, %struct.Derived2* %[[this]], i32 0, i32 1

Modified: cfe/trunk/test/CodeGenCXX/pr27030.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pr27030.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/pr27030.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/pr27030.cpp Fri Feb 23 11:30:48 2018
@@ -5,7 +5,7 @@ extern "C" {
 extern int B::*a;
 void test1() { (int A::*)(a); }
 }
-// CHECK-LABEL: define void @test1(
+// CHECK-LABEL: define dso_local void @test1(
 // CHECK: %[[load:.*]]       = load i32, i32* @a
 // CHECK: %[[memptr_cmp:.*]] = icmp ne i32 %[[load]], -1
 // CHECK: br i1 %[[memptr_cmp]]

Modified: cfe/trunk/test/CodeGenCXX/pr28360.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pr28360.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/pr28360.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/pr28360.cpp Fri Feb 23 11:30:48 2018
@@ -10,7 +10,7 @@ void Bar(const MpTy &);
 
 void Baz() { Bar(&A::Foo); }
 
-// CHECK-LABEL: define void @"\01?Baz@@YAXXZ"(
+// CHECK-LABEL: define dso_local void @"\01?Baz@@YAXXZ"(
 // CHECK:  %[[ref_tmp:.*]] = alloca i8*, align 4
 // CHECK: store i8* bitcast (void (%struct.A*)* @"\01?Foo at A@@QAEXXZ" to i8*), i8** %[[ref_tmp]], align 4
 // CHECK: call void @"\01?Bar@@YAXABQ8A@@AEXXZ at Z"(i8** dereferenceable(4) %[[ref_tmp]])

Modified: cfe/trunk/test/CodeGenCXX/pr30731.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pr30731.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/pr30731.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/pr30731.cpp Fri Feb 23 11:30:48 2018
@@ -16,6 +16,6 @@ struct S : A, virtual B, C {
 
 void f(S* s) { s->f(); }
 
-// CHECK-LABEL: define void @"\01?f@@YAXPAUS@@@Z"
+// CHECK-LABEL: define dso_local void @"\01?f@@YAXPAUS@@@Z"
 // CHECK: call
 // CHECK: ret void

Modified: cfe/trunk/test/CodeGenCXX/pr33080.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pr33080.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/pr33080.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/pr33080.cpp Fri Feb 23 11:30:48 2018
@@ -1,25 +1,25 @@
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fms-extensions -emit-llvm -o- %s | FileCheck %s
 
 void fa(__unaligned struct A *) {}
-// CHECK: define void @_Z2faPU11__unaligned1A(
+// CHECK: define {{(dso_local )?}}void @_Z2faPU11__unaligned1A(
 
 void ga(struct A *, struct A *) {}
-// CHECK: define void @_Z2gaP1AS0_(
+// CHECK: define {{(dso_local )?}}void @_Z2gaP1AS0_(
 
 void gb(__unaligned struct A *, struct A *) {}
-// CHECK: define void @_Z2gbPU11__unaligned1APS_(
+// CHECK: define {{(dso_local )?}}void @_Z2gbPU11__unaligned1APS_(
 
 void gc(struct A *, __unaligned struct A *) {}
-// CHECK: define void @_Z2gcP1APU11__unalignedS_(
+// CHECK: define {{(dso_local )?}}void @_Z2gcP1APU11__unalignedS_(
 
 void gd(__unaligned struct A *, __unaligned struct A *) {}
-// CHECK: define void @_Z2gdPU11__unaligned1AS1_(
+// CHECK: define {{(dso_local )?}}void @_Z2gdPU11__unaligned1AS1_(
 
 void hb(__unaligned struct A *, __unaligned const struct A *) {}
-// CHECK: define void @_Z2hbPU11__unaligned1APU11__unalignedKS_(
+// CHECK: define {{(dso_local )?}}void @_Z2hbPU11__unaligned1APU11__unalignedKS_(
 
 void ja(__unaligned struct A *, __unaligned struct A *__unaligned *, __unaligned struct A *__unaligned *__unaligned *) {}
-// CHECK: define void @_Z2jaPU11__unaligned1APU11__unalignedS1_PU11__unalignedS3_(
+// CHECK: define {{(dso_local )?}}void @_Z2jaPU11__unaligned1APU11__unalignedS1_PU11__unalignedS3_(
 
 void jb(__unaligned struct A *, __unaligned struct A **, __unaligned struct A *__unaligned *__unaligned *) {}
 // CHECK: @_Z2jbPU11__unaligned1APS1_PU11__unalignedPU11__unalignedS1_(

Modified: cfe/trunk/test/CodeGenCXX/pragma-init_seg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pragma-init_seg.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/pragma-init_seg.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/pragma-init_seg.cpp Fri Feb 23 11:30:48 2018
@@ -9,17 +9,17 @@ int f();
 namespace simple_init {
 #pragma init_seg(compiler)
 int x = f();
-// CHECK: @"\01?x at simple_init@@3HA" = global i32 0, align 4
+// CHECK: @"\01?x at simple_init@@3HA" = dso_local global i32 0, align 4
 // CHECK: @__cxx_init_fn_ptr = private constant void ()* @"\01??__Ex at simple_init@@YAXXZ", section ".CRT$XCC"
 
 #pragma init_seg(lib)
 int y = f();
-// CHECK: @"\01?y at simple_init@@3HA" = global i32 0, align 4
+// CHECK: @"\01?y at simple_init@@3HA" = dso_local global i32 0, align 4
 // CHECK: @__cxx_init_fn_ptr.1 = private constant void ()* @"\01??__Ey at simple_init@@YAXXZ", section ".CRT$XCL"
 
 #pragma init_seg(user)
 int z = f();
-// CHECK: @"\01?z at simple_init@@3HA" = global i32 0, align 4
+// CHECK: @"\01?z at simple_init@@3HA" = dso_local global i32 0, align 4
 // No function pointer!  This one goes on @llvm.global_ctors.
 }
 
@@ -35,7 +35,7 @@ int x = f();
 
 namespace selectany_init {
 int __declspec(selectany) x = f();
-// CHECK: @"\01?x at selectany_init@@3HA" = weak_odr global i32 0, comdat, align 4
+// CHECK: @"\01?x at selectany_init@@3HA" = weak_odr dso_local global i32 0, comdat, align 4
 // CHECK: @__cxx_init_fn_ptr.3 = private constant void ()* @"\01??__Ex at selectany_init@@YAXXZ", section ".asdf", comdat($"\01?x at selectany_init@@3HA")
 }
 
@@ -43,7 +43,7 @@ namespace explicit_template_instantiatio
 template <typename T> struct A { static const int x; };
 template <typename T> const int A<T>::x = f();
 template struct A<int>;
-// CHECK: @"\01?x@?$A at H@explicit_template_instantiation@@2HB" = weak_odr global i32 0, comdat, align 4
+// CHECK: @"\01?x@?$A at H@explicit_template_instantiation@@2HB" = weak_odr dso_local global i32 0, comdat, align 4
 // CHECK: @__cxx_init_fn_ptr.4 = private constant void ()* @"\01??__Ex@?$A at H@explicit_template_instantiation@@2HB at YAXXZ", section ".asdf", comdat($"\01?x@?$A at H@explicit_template_instantiation@@2HB")
 }
 
@@ -51,7 +51,7 @@ namespace implicit_template_instantiatio
 template <typename T> struct A { static const int x; };
 template <typename T> const int A<T>::x = f();
 int g() { return A<int>::x; }
-// CHECK: @"\01?x@?$A at H@implicit_template_instantiation@@2HB" = linkonce_odr global i32 0, comdat, align 4
+// CHECK: @"\01?x@?$A at H@implicit_template_instantiation@@2HB" = linkonce_odr dso_local global i32 0, comdat, align 4
 // CHECK: @__cxx_init_fn_ptr.5 = private constant void ()* @"\01??__Ex@?$A at H@implicit_template_instantiation@@2HB at YAXXZ", section ".asdf", comdat($"\01?x@?$A at H@implicit_template_instantiation@@2HB")
 }
 

Modified: cfe/trunk/test/CodeGenCXX/pragma-weak.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pragma-weak.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/pragma-weak.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/pragma-weak.cpp Fri Feb 23 11:30:48 2018
@@ -5,7 +5,7 @@ int zex;
 // GCC produces a weak symbol for this because it matches mangled names.
 // Different c++ ABIs may or may not mangle this, so we produce a strong
 // symbol.
-// CHECK: @zex = global i32
+// CHECK: @zex = {{(dso_local )?}}global i32
 
 #pragma weak foo
 struct S {  void foo(); };

Modified: cfe/trunk/test/CodeGenCXX/reference-init.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/reference-init.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/reference-init.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/reference-init.cpp Fri Feb 23 11:30:48 2018
@@ -31,6 +31,6 @@ const int &s2 = s.bitfield;
 struct SelfReference { SelfReference &r; };
 extern SelfReference self_reference_1;
 SelfReference self_reference_2 = {self_reference_1};
-// CHECK-CXX98: @self_reference_2 = global %[[SELF_REF:.*]] { %[[SELF_REF]]* @self_reference_1 }
-// CHECK-CXX11: @self_reference_2 = global %[[SELF_REF:.*]] zeroinitializer
+// CHECK-CXX98: @self_reference_2 = {{.*}}global %[[SELF_REF:.*]] { %[[SELF_REF]]* @self_reference_1 }
+// CHECK-CXX11: @self_reference_2 = {{(dso_local )?}}global %[[SELF_REF:.*]] zeroinitializer
 // CHECK-CXX11: call {{.*}}memcpy{{.*}} @self_reference_2 {{.*}} @self_reference_1

Modified: cfe/trunk/test/CodeGenCXX/regcall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/regcall.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/regcall.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/regcall.cpp Fri Feb 23 11:30:48 2018
@@ -22,8 +22,8 @@ int __regcall foo (int i){
   return i;
 }
 // CHECK-LIN: define x86_regcallcc {{.+}}@_Z15__regcall3__foo
-// CHECK-WIN64: define x86_regcallcc {{.+}}@"\01?foo@@YwHH at Z"
-// CHECK-WIN32: define x86_regcallcc {{.+}}@"\01?foo@@YwHH at Z"
+// CHECK-WIN64: define dso_local x86_regcallcc {{.+}}@"\01?foo@@YwHH at Z"
+// CHECK-WIN32: define dso_local x86_regcallcc {{.+}}@"\01?foo@@YwHH at Z"
 
 // used to give a body to test_class functions
 static int x = 0;
@@ -37,8 +37,8 @@ public:
   // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_classC1Ev
   // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_classC2Ev
   // Windows ignores calling convention on constructor/destructors.
-  // CHECK-WIN64-DAG: define linkonce_odr %class.test_class* @"\01??0test_class@@QEAA at XZ"
-  // CHECK-WIN32-DAG: define linkonce_odr x86_thiscallcc %class.test_class* @"\01??0test_class@@QAE at XZ"
+  // CHECK-WIN64-DAG: define linkonce_odr dso_local %class.test_class* @"\01??0test_class@@QEAA at XZ"
+  // CHECK-WIN32-DAG: define linkonce_odr dso_local x86_thiscallcc %class.test_class* @"\01??0test_class@@QAE at XZ"
 
 #ifndef WIN_TEST
   __regcall 
@@ -47,31 +47,31 @@ public:
   // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_classD2Ev
   // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_classD1Ev
   // Windows ignores calling convention on constructor/destructors.
-  // CHECK-WIN64-DAG: define linkonce_odr void @"\01??_Dtest_class@@QEAAXXZ"
-  // CHECK-WIN32-DAG: define linkonce_odr x86_thiscallcc void @"\01??_Dtest_class@@QAEXXZ"
+  // CHECK-WIN64-DAG: define linkonce_odr dso_local void @"\01??_Dtest_class@@QEAAXXZ"
+  // CHECK-WIN32-DAG: define linkonce_odr dso_local x86_thiscallcc void @"\01??_Dtest_class@@QAEXXZ"
   
   test_class& __regcall operator+=(const test_class&){
     return *this;
   }
   // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc dereferenceable(4) %class.test_class* @_ZN10test_classpLERKS_
-  // CHECK-WIN64-DAG: define linkonce_odr x86_regcallcc dereferenceable(4) %class.test_class* @"\01??Ytest_class@@QEAwAEAV0 at AEBV0@@Z"
-  // CHECK-WIN32-DAG: define linkonce_odr x86_regcallcc dereferenceable(4) %class.test_class* @"\01??Ytest_class@@QAwAAV0 at ABV0@@Z"
+  // CHECK-WIN64-DAG: define linkonce_odr dso_local x86_regcallcc dereferenceable(4) %class.test_class* @"\01??Ytest_class@@QEAwAEAV0 at AEBV0@@Z"
+  // CHECK-WIN32-DAG: define linkonce_odr dso_local x86_regcallcc dereferenceable(4) %class.test_class* @"\01??Ytest_class@@QAwAAV0 at ABV0@@Z"
   void __regcall do_thing(){}
   // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_class20__regcall3__do_thingEv
-  // CHECK-WIN64-DAG: define linkonce_odr x86_regcallcc void @"\01?do_thing at test_class@@QEAwXXZ"
-  // CHECK-WIN32-DAG: define linkonce_odr x86_regcallcc void @"\01?do_thing at test_class@@QAwXXZ"
+  // CHECK-WIN64-DAG: define linkonce_odr dso_local x86_regcallcc void @"\01?do_thing at test_class@@QEAwXXZ"
+  // CHECK-WIN32-DAG: define linkonce_odr dso_local x86_regcallcc void @"\01?do_thing at test_class@@QAwXXZ"
   
   template<typename T>
   void __regcall tempFunc(T i){}
   // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_class20__regcall3__tempFuncIiEEvT_
-  // CHECK-WIN64-DAG: define linkonce_odr x86_regcallcc void @"\01??$freeTempFunc at H@@YwXH at Z"
-  // CHECK-WIN32-DAG: define linkonce_odr x86_regcallcc void @"\01??$freeTempFunc at H@@YwXH at Z"
+  // CHECK-WIN64-DAG: define linkonce_odr dso_local x86_regcallcc void @"\01??$freeTempFunc at H@@YwXH at Z"
+  // CHECK-WIN32-DAG: define linkonce_odr dso_local x86_regcallcc void @"\01??$freeTempFunc at H@@YwXH at Z"
 };
 
 bool __regcall operator ==(const test_class&, const test_class&){ --x; return false;}
 // CHECK-LIN-DAG: define x86_regcallcc zeroext i1 @_ZeqRK10test_classS1_
-// CHECK-WIN64-DAG: define x86_regcallcc zeroext i1 @"\01??8 at Yw_NAEBVtest_class@@0 at Z"
-// CHECK-WIN32-DAG: define x86_regcallcc zeroext i1 @"\01??8 at Yw_NABVtest_class@@0 at Z"
+// CHECK-WIN64-DAG: define dso_local x86_regcallcc zeroext i1 @"\01??8 at Yw_NAEBVtest_class@@0 at Z"
+// CHECK-WIN32-DAG: define dso_local x86_regcallcc zeroext i1 @"\01??8 at Yw_NABVtest_class@@0 at Z"
 
 test_class __regcall operator""_test_class (unsigned long long) { ++x; return test_class{};}
 // CHECK-LIN64-DAG: define x86_regcallcc void @_Zli11_test_classy(%class.test_class* noalias sret %agg.result, i64)
@@ -82,8 +82,8 @@ test_class __regcall operator""_test_cla
 template<typename T>
 void __regcall freeTempFunc(T i){}
 // CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_Z24__regcall3__freeTempFuncIiEvT_
-// CHECK-WIN64-DAG: define linkonce_odr x86_regcallcc void @"\01??$freeTempFunc at H@@YwXH at Z"
-// CHECK-WIN32-DAG: define linkonce_odr x86_regcallcc void @"\01??$freeTempFunc at H@@YwXH at Z"
+// CHECK-WIN64-DAG: define linkonce_odr dso_local x86_regcallcc void @"\01??$freeTempFunc at H@@YwXH at Z"
+// CHECK-WIN32-DAG: define linkonce_odr dso_local x86_regcallcc void @"\01??$freeTempFunc at H@@YwXH at Z"
 
 // class to force generation of functions
 void force_gen() {
@@ -101,5 +101,5 @@ long double _Complex __regcall foo(long
 }
 // CHECK-LIN64-DAG: define x86_regcallcc void @_Z15__regcall3__fooCe({ x86_fp80, x86_fp80 }* noalias sret %agg.result, { x86_fp80, x86_fp80 }* byval align 16 %f)
 // CHECK-LIN32-DAG: define x86_regcallcc void @_Z15__regcall3__fooCe({ x86_fp80, x86_fp80 }* inreg noalias sret %agg.result, { x86_fp80, x86_fp80 }* byval align 4 %f)
-// CHECK-WIN64-DAG: define x86_regcallcc { double, double } @"\01?foo@@YwU?$_Complex at O@__clang@@U12@@Z"(double %f.0, double %f.1)
-// CHECK-WIN32-DAG: define x86_regcallcc { double, double } @"\01?foo@@YwU?$_Complex at O@__clang@@U12@@Z"(double %f.0, double %f.1)
+// CHECK-WIN64-DAG: define dso_local x86_regcallcc { double, double } @"\01?foo@@YwU?$_Complex at O@__clang@@U12@@Z"(double %f.0, double %f.1)
+// CHECK-WIN32-DAG: define dso_local x86_regcallcc { double, double } @"\01?foo@@YwU?$_Complex at O@__clang@@U12@@Z"(double %f.0, double %f.1)

Modified: cfe/trunk/test/CodeGenCXX/rtti-mingw64.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/rtti-mingw64.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/rtti-mingw64.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/rtti-mingw64.cpp Fri Feb 23 11:30:48 2018
@@ -7,8 +7,8 @@ class C {
 };
 C::~C() {}
 
-// CHECK: @_ZTI1C = linkonce_odr
-// CHECK: @_ZTI1B = linkonce_odr constant { i8*, i8*, i32, i32, i8*, i64 }
+// CHECK: @_ZTI1C = linkonce_odr dso_local
+// CHECK: @_ZTI1B = linkonce_odr dso_local constant { i8*, i8*, i32, i32, i8*, i64 }
 // CHECK-SAME:  i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv121__vmi_class_type_infoE, i64 2) to i8*),
 // CHECK-SAME:  i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1B, i32 0, i32 0),
 // CHECK-SAME:  i32 0,

Modified: cfe/trunk/test/CodeGenCXX/runtime-dllstorage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/runtime-dllstorage.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/runtime-dllstorage.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/runtime-dllstorage.cpp Fri Feb 23 11:30:48 2018
@@ -110,7 +110,7 @@ void l() {
 // CHECK-MS-DAG: declare i32 @atexit(void ()*)
 // CHECK-MS-DYNAMIC-DAG: declare dllimport {{.*}} void @_CxxThrowException
 // CHECK-MS-STATIC-DAG: declare {{.*}} void @_CxxThrowException
-// CHECK-MS-DAG: declare noalias i8* @"\01??2 at YAPAXI@Z"
+// CHECK-MS-DAG: declare dso_local noalias i8* @"\01??2 at YAPAXI@Z"
 // CHECK-MS-DAG: declare void @_Init_thread_header(i32*)
 // CHECK-MS-DAG: declare void @_Init_thread_footer(i32*)
 
@@ -128,7 +128,7 @@ void l() {
 // CHECK-DYNAMIC-NODECL-IA-DAG: declare dllimport i32 @__cxa_guard_acquire(i64*)
 // CHECK-DYNAMIC-IMPORT-IA-DAG: declare dllimport i32 @__cxa_guard_acquire(i64*)
 // CHECK-DYNAMIC-EXPORT-IA-DAG: declare dllexport i32 @__cxa_guard_acquire(i64*)
-// CHECK-IA-DAG: declare noalias i8* @_Znwj(i32)
+// CHECK-IA-DAG: declare dso_local noalias i8* @_Znwj(i32)
 // CHECK-DYNAMIC-DECL-IA-DAG: declare dllimport void @__cxa_guard_release(i64*)
 // CHECK-DYNAMIC-NODECL-IA-DAG: declare dllimport void @__cxa_guard_release(i64*)
 // CHECK-DYNAMIC-IMPORT-IA-DAG: declare dllimport void @__cxa_guard_release(i64*)
@@ -136,7 +136,7 @@ void l() {
 // CHECK-DYANMIC-IA-DAG: declare dllimport void @_ZSt9terminatev()
 // CHECK-DYNAMIC-NODECL-IA-DAG: declare void @_ZSt9terminatev()
 // CHECK-DYNAMIC-IMPORT-IA-DAG: declare dllimport void @_ZSt9terminatev()
-// CHECK-DYNAMIC-EXPORT-IA-DAG: declare dllexport void @_ZSt9terminatev()
+// CHECK-DYNAMIC-EXPORT-IA-DAG: declare dso_local dllexport void @_ZSt9terminatev()
 
 // CHECK-STATIC-IA-DAG: declare i32 @__cxa_thread_atexit(void (i8*)*, i8*, i8*)
 // CHECK-STATIC-IA-DAG: declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*)
@@ -145,14 +145,14 @@ void l() {
 // CHECK-STATIC-DECL-IA-DAG: declare i32 @__cxa_guard_acquire(i64*)
 // CHECK-STATIC-NODECL-IA-DAG: declare i32 @__cxa_guard_acquire(i64*)
 // CHECK-STATIC-IMPORT-IA-DAG: declare i32 @__cxa_guard_acquire(i64*)
-// CHECK-STATIC-EXPORT-IA-DAG: declare i32 @__cxa_guard_acquire(i64*)
-// CHECK-IA-DAG: declare noalias i8* @_Znwj(i32)
+// CHECK-STATIC-EXPORT-IA-DAG: declare dso_local i32 @__cxa_guard_acquire(i64*)
+// CHECK-IA-DAG: declare dso_local noalias i8* @_Znwj(i32)
 // CHECK-STATIC-DECL-IA-DAG: declare void @__cxa_guard_release(i64*)
 // CHECK-STATIC-NODECL-IA-DAG: declare void @__cxa_guard_release(i64*)
 // CHECK-STATIC-IMPORT-IA-DAG: declare void @__cxa_guard_release(i64*)
-// CHECK-STATIC-EXPORT-IA-DAG: declare void @__cxa_guard_release(i64*)
+// CHECK-STATIC-EXPORT-IA-DAG: declare dso_local void @__cxa_guard_release(i64*)
 // CHECK-STATIC-IA-DAG: declare void @_ZSt9terminatev()
 // CHECK-STATIC-NODECL-IA-DAG: declare void @_ZSt9terminatev()
 // CHECK-STATIC-IMPORT-IA-DAG: declare void @_ZSt9terminatev()
-// CHECK-STATIC-EXPORT-IA-DAG: declare dllexport void @_ZSt9terminatev()
+// CHECK-STATIC-EXPORT-IA-DAG: declare dso_local dllexport void @_ZSt9terminatev()
 

Modified: cfe/trunk/test/CodeGenCXX/sections.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/sections.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/sections.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/sections.cpp Fri Feb 23 11:30:48 2018
@@ -76,26 +76,26 @@ __declspec(allocate("long_section")) lon
 __declspec(allocate("short_section")) short short_var = 42;
 }
 
-//CHECK: @D = global i32 1
-//CHECK: @a = global i32 1, section ".data"
-//CHECK: @b = constant i32 1, section ".my_const"
+//CHECK: @D = dso_local global i32 1
+//CHECK: @a = dso_local global i32 1, section ".data"
+//CHECK: @b = dso_local constant i32 1, section ".my_const"
 //CHECK: @[[MYSTR:.*]] = {{.*}} unnamed_addr constant [11 x i8] c"my string!\00"
-//CHECK: @s = global i8* getelementptr inbounds ([11 x i8], [11 x i8]* @[[MYSTR]], i32 0, i32 0), section ".data2"
-//CHECK: @c = global i32 1, section ".my_seg"
-//CHECK: @d = global i32 1, section ".data"
-//CHECK: @e = global i32 0, section ".my_bss"
-//CHECK: @f = global i32 0, section ".c"
-//CHECK: @i = global i32 0
-//CHECK: @TEST1 = global i32 0
-//CHECK: @TEST2 = global i32 0, section ".bss1"
-//CHECK: @TEST3 = global i32 0, section ".bss1"
-//CHECK: @d2 = global i32 1, section ".data"
-//CHECK: @b2 = constant i32 1, section ".my_const"
-//CHECK: @unreferenced = constant i32 0, section "read_flag_section"
-//CHECK: @referenced = constant i32 42, section "read_flag_section"
-//CHECK: @implicitly_read_write = global i32 42, section "no_section_attributes"
-//CHECK: @long_var = global i32 42, section "long_section"
-//CHECK: @short_var = global i16 42, section "short_section"
-//CHECK: define void @g()
-//CHECK: define void @h() {{.*}} section ".my_code"
-//CHECK: define void @h2() {{.*}} section ".my_code"
+//CHECK: @s = dso_local global i8* getelementptr inbounds ([11 x i8], [11 x i8]* @[[MYSTR]], i32 0, i32 0), section ".data2"
+//CHECK: @c = dso_local global i32 1, section ".my_seg"
+//CHECK: @d = dso_local global i32 1, section ".data"
+//CHECK: @e = dso_local global i32 0, section ".my_bss"
+//CHECK: @f = dso_local global i32 0, section ".c"
+//CHECK: @i = dso_local global i32 0
+//CHECK: @TEST1 = dso_local global i32 0
+//CHECK: @TEST2 = dso_local global i32 0, section ".bss1"
+//CHECK: @TEST3 = dso_local global i32 0, section ".bss1"
+//CHECK: @d2 = dso_local global i32 1, section ".data"
+//CHECK: @b2 = dso_local constant i32 1, section ".my_const"
+//CHECK: @unreferenced = dso_local constant i32 0, section "read_flag_section"
+//CHECK: @referenced = dso_local constant i32 42, section "read_flag_section"
+//CHECK: @implicitly_read_write = dso_local global i32 42, section "no_section_attributes"
+//CHECK: @long_var = dso_local global i32 42, section "long_section"
+//CHECK: @short_var = dso_local global i16 42, section "short_section"
+//CHECK: define dso_local void @g()
+//CHECK: define dso_local void @h() {{.*}} section ".my_code"
+//CHECK: define dso_local void @h2() {{.*}} section ".my_code"

Modified: cfe/trunk/test/CodeGenCXX/specialized-static-data-mem-init.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/specialized-static-data-mem-init.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/specialized-static-data-mem-init.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/specialized-static-data-mem-init.cpp Fri Feb 23 11:30:48 2018
@@ -2,8 +2,8 @@
 // rdar: // 8562966
 // pr8409
 
-// CHECK: @_ZN1CIiE11needs_guardE = linkonce_odr global
-// CHECK: @_ZGVN1CIiE11needs_guardE = linkonce_odr global
+// CHECK: @_ZN1CIiE11needs_guardE = linkonce_odr {{(dso_local )?}}global
+// CHECK: @_ZGVN1CIiE11needs_guardE = linkonce_odr {{(dso_local )?}}global
 
 struct K
 {

Modified: cfe/trunk/test/CodeGenCXX/trap-fnattr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/trap-fnattr.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/trap-fnattr.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/trap-fnattr.cpp Fri Feb 23 11:30:48 2018
@@ -1,10 +1,10 @@
 // RUN: %clang_cc1 -O0 -emit-llvm -ftrapv -ftrap-function=mytrap %s -o - | FileCheck %s -check-prefix=TRAPFUNC
 // RUN: %clang_cc1 -O0 -emit-llvm -ftrapv %s -o - | FileCheck %s -check-prefix=NOOPTION
 
-// TRAPFUNC-LABEL: define void @{{_Z12test_builtinv|\"\\01\?test_builtin@@YAXXZ\"}}
+// TRAPFUNC-LABEL: define {{(dso_local )?}}void @{{_Z12test_builtinv|\"\\01\?test_builtin@@YAXXZ\"}}
 // TRAPFUNC: call void @llvm.trap() [[ATTR0:#[0-9]+]]
 
-// NOOPTION-LABEL: define void @{{_Z12test_builtinv|\"\\01\?test_builtin@@YAXXZ\"}}
+// NOOPTION-LABEL: define {{(dso_local )?}}void @{{_Z12test_builtinv|\"\\01\?test_builtin@@YAXXZ\"}}
 // NOOPTION: call void @llvm.trap(){{$}}
 
 void test_builtin(void) {

Modified: cfe/trunk/test/CodeGenCXX/type-metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/type-metadata.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/type-metadata.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/type-metadata.cpp Fri Feb 23 11:30:48 2018
@@ -104,7 +104,7 @@ void D::h() {
 }
 
 // ITANIUM: define hidden void @_Z2afP1A
-// MS: define void @"\01?af@@YAXPEAUA@@@Z"
+// MS: define dso_local void @"\01?af@@YAXPEAUA@@@Z"
 void af(A *a) {
   // TT-ITANIUM: [[P:%[^ ]*]] = call i1 @llvm.type.test(i8* [[VT:%[^ ]*]], metadata !"_ZTS1A")
   // TT-MS: [[P:%[^ ]*]] = call i1 @llvm.type.test(i8* [[VT:%[^ ]*]], metadata !"?AUA@@")
@@ -214,7 +214,7 @@ struct D : C {
 };
 
 // ITANIUM: define hidden void @_ZN5test21fEPNS_1DE
-// MS: define void @"\01?f at test2@@YAXPEAUD at 1@@Z"
+// MS: define dso_local void @"\01?f at test2@@YAXPEAUD at 1@@Z"
 void f(D *d) {
   // TT-ITANIUM: {{%[^ ]*}} = call i1 @llvm.type.test(i8* {{%[^ ]*}}, metadata !"_ZTSN5test21DE")
   // TT-MS: {{%[^ ]*}} = call i1 @llvm.type.test(i8* {{%[^ ]*}}, metadata !"?AUA at test2@@")

Modified: cfe/trunk/test/CodeGenCXX/ubsan-devirtualized-calls.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/ubsan-devirtualized-calls.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/ubsan-devirtualized-calls.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/ubsan-devirtualized-calls.cpp Fri Feb 23 11:30:48 2018
@@ -32,7 +32,7 @@ struct Derived4 final : Base1 {
 // CHECK: [[UBSAN_TI_DERIVED4_1:@[0-9]+]] = private unnamed_addr global {{.*}} i8* bitcast {{.*}} @_ZTI8Derived4 to i8*
 // CHECK: [[UBSAN_TI_DERIVED4_2:@[0-9]+]] = private unnamed_addr global {{.*}} i8* bitcast {{.*}} @_ZTI8Derived4 to i8*
 
-// CHECK-LABEL: define void @_Z2t1v
+// CHECK-LABEL: define {{(dso_local )?}}void @_Z2t1v
 void t1() {
   Derived1 d1;
   static_cast<Base1 *>(&d1)->f1(); //< Devirt Base1::f1 to Derived1::f1.
@@ -40,7 +40,7 @@ void t1() {
   // CHECK-NEXT: call void @__ubsan_handle_dynamic_type_cache{{[_a-z]*}}({{.*}} [[UBSAN_TI_DERIVED1_1]] {{.*}}, i{{[0-9]+}} %[[D1]]
 }
 
-// CHECK-LABEL: define void @_Z2t2v
+// CHECK-LABEL: define {{(dso_local )?}}void @_Z2t2v
 void t2() {
   Derived2 d2;
   static_cast<Base1 *>(&d2)->f1(); //< Devirt Base1::f1 to Derived2::f1.
@@ -48,7 +48,7 @@ void t2() {
   // CHECK-NEXT: call void @__ubsan_handle_dynamic_type_cache{{[_a-z]*}}({{.*}} [[UBSAN_TI_DERIVED2_1]] {{.*}}, i{{[0-9]+}} %[[D2_1]]
 }
 
-// CHECK-LABEL: define void @_Z2t3v
+// CHECK-LABEL: define {{(dso_local )?}}void @_Z2t3v
 void t3() {
   Derived2 d2;
   static_cast<Base2 *>(&d2)->f1(); //< Devirt Base2::f1 to Derived2::f1.
@@ -56,7 +56,7 @@ void t3() {
   // CHECK-NEXT: call void @__ubsan_handle_dynamic_type_cache{{[_a-z]*}}({{.*}} [[UBSAN_TI_DERIVED2_2]] {{.*}}, i{{[0-9]+}} %[[D2_2]]
 }
 
-// CHECK-LABEL: define void @_Z2t4v
+// CHECK-LABEL: define {{(dso_local )?}}void @_Z2t4v
 void t4() {
   Base1 p;
   Derived3 *badp = static_cast<Derived3 *>(&p); //< Check that &p isa Derived3.
@@ -73,7 +73,7 @@ void t4() {
   // CHECK-NEXT: call void @__ubsan_handle_dynamic_type_cache{{[_a-z]*}}({{.*}} [[UBSAN_TI_BASE1]] {{.*}}, i{{[0-9]+}} %[[BADP1]]
 }
 
-// CHECK-LABEL: define void @_Z2t5v
+// CHECK-LABEL: define {{(dso_local )?}}void @_Z2t5v
 void t5() {
   Base1 p;
   Derived4 *badp = static_cast<Derived4 *>(&p); //< Check that &p isa Derived4.

Modified: cfe/trunk/test/CodeGenCXX/ubsan-vtable-checks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/ubsan-vtable-checks.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/ubsan-vtable-checks.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/ubsan-vtable-checks.cpp Fri Feb 23 11:30:48 2018
@@ -15,7 +15,7 @@ struct U : T {
 U::~U() {}
 
 // ITANIUM: define i32 @_Z5get_vP1T
-// MSABI: define i32 @"\01?get_v
+// MSABI: define dso_local i32 @"\01?get_v
 int get_v(T* t) {
   // First, we check that vtable is not loaded before a type check.
   // CHECK-NULL-NOT: load {{.*}} (%struct.T*{{.*}})**, {{.*}} (%struct.T*{{.*}})***
@@ -28,7 +28,7 @@ int get_v(T* t) {
 }
 
 // ITANIUM: define void @_Z9delete_itP1T
-// MSABI: define void @"\01?delete_it
+// MSABI: define dso_local void @"\01?delete_it
 void delete_it(T *t) {
   // First, we check that vtable is not loaded before a type check.
   // CHECK-VPTR-NOT: load {{.*}} (%struct.T*{{.*}})**, {{.*}} (%struct.T*{{.*}})***
@@ -40,7 +40,7 @@ void delete_it(T *t) {
 }
 
 // ITANIUM: define %struct.U* @_Z7dyncastP1T
-// MSABI: define %struct.U* @"\01?dyncast
+// MSABI: define dso_local %struct.U* @"\01?dyncast
 U* dyncast(T *t) {
   // First, we check that dynamic_cast is not called before a type check.
   // CHECK-VPTR-NOT: call i8* @__{{dynamic_cast|RTDynamicCast}}

Modified: cfe/trunk/test/CodeGenCXX/unaligned-member-qualifier.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/unaligned-member-qualifier.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/unaligned-member-qualifier.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/unaligned-member-qualifier.cpp Fri Feb 23 11:30:48 2018
@@ -8,13 +8,13 @@ struct A {
 };
 
 void A::foo() __unaligned {}
-// CHECK: define [[THISCALL:(x86_thiscallcc )?]]void @_ZNU11__unaligned1A3fooEv(
+// CHECK: define {{(dso_local )?}}[[THISCALL:(x86_thiscallcc )?]]void @_ZNU11__unaligned1A3fooEv(
 
 void A::foo() const __unaligned {}
-// CHECK: define [[THISCALL]]void @_ZNU11__unalignedK1A3fooEv(
+// CHECK: define {{(dso_local )?}}[[THISCALL]]void @_ZNU11__unalignedK1A3fooEv(
 
 void A::foo() volatile __unaligned {}
-// CHECK: define [[THISCALL]]void @_ZNU11__unalignedV1A3fooEv(
+// CHECK: define {{(dso_local )?}}[[THISCALL]]void @_ZNU11__unalignedV1A3fooEv(
 
 void A::foo() const volatile __unaligned {}
-// CHECK: define [[THISCALL]]void @_ZNU11__unalignedVK1A3fooEv(
+// CHECK: define {{(dso_local )?}}[[THISCALL]]void @_ZNU11__unalignedVK1A3fooEv(

Modified: cfe/trunk/test/CodeGenCXX/uncopyable-args.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/uncopyable-args.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/uncopyable-args.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/uncopyable-args.cpp Fri Feb 23 11:30:48 2018
@@ -19,7 +19,7 @@ void bar() {
 // CHECK: call void @_ZN7trivial3fooENS_1AE(i8* %{{.*}})
 // CHECK-LABEL: declare void @_ZN7trivial3fooENS_1AE(i8*)
 
-// WIN64-LABEL: declare void @"\01?foo at trivial@@YAXUA at 1@@Z"(i64)
+// WIN64-LABEL: declare dso_local void @"\01?foo at trivial@@YAXUA at 1@@Z"(i64)
 }
 
 namespace default_ctor {
@@ -40,7 +40,7 @@ void bar() {
 // CHECK: call void @_ZN12default_ctor3fooENS_1AE(i8* %{{.*}})
 // CHECK-LABEL: declare void @_ZN12default_ctor3fooENS_1AE(i8*)
 
-// WIN64-LABEL: declare void @"\01?foo at default_ctor@@YAXUA at 1@@Z"(i64)
+// WIN64-LABEL: declare dso_local void @"\01?foo at default_ctor@@YAXUA at 1@@Z"(i64)
 }
 
 namespace move_ctor {
@@ -63,7 +63,7 @@ void bar() {
 // NEWABI-LABEL: declare void @_ZN9move_ctor3fooENS_1AE(%"struct.move_ctor::A"*)
 // OLDABI-LABEL: declare void @_ZN9move_ctor3fooENS_1AE(i8*)
 
-// WIN64-LABEL: declare void @"\01?foo at move_ctor@@YAXUA at 1@@Z"(%"struct.move_ctor::A"*)
+// WIN64-LABEL: declare dso_local void @"\01?foo at move_ctor@@YAXUA at 1@@Z"(%"struct.move_ctor::A"*)
 }
 
 namespace all_deleted {
@@ -85,7 +85,7 @@ void bar() {
 // NEWABI-LABEL: declare void @_ZN11all_deleted3fooENS_1AE(%"struct.all_deleted::A"*)
 // OLDABI-LABEL: declare void @_ZN11all_deleted3fooENS_1AE(i8*)
 
-// WIN64-LABEL: declare void @"\01?foo at all_deleted@@YAXUA at 1@@Z"(%"struct.all_deleted::A"*)
+// WIN64-LABEL: declare dso_local void @"\01?foo at all_deleted@@YAXUA at 1@@Z"(%"struct.all_deleted::A"*)
 }
 
 namespace implicitly_deleted {
@@ -107,8 +107,8 @@ void bar() {
 // OLDABI-LABEL: declare void @_ZN18implicitly_deleted3fooENS_1AE(i8*)
 
 // In MSVC 2013, the copy ctor is not deleted by a move assignment. In MSVC 2015, it is.
-// WIN64-18-LABEL: declare void @"\01?foo at implicitly_deleted@@YAXUA at 1@@Z"(i64
-// WIN64-19-LABEL: declare void @"\01?foo at implicitly_deleted@@YAXUA at 1@@Z"(%"struct.implicitly_deleted::A"*)
+// WIN64-18-LABEL: declare dso_local void @"\01?foo at implicitly_deleted@@YAXUA at 1@@Z"(i64
+// WIN64-19-LABEL: declare dso_local void @"\01?foo at implicitly_deleted@@YAXUA at 1@@Z"(%"struct.implicitly_deleted::A"*)
 }
 
 namespace one_deleted {
@@ -129,7 +129,7 @@ void bar() {
 // NEWABI-LABEL: declare void @_ZN11one_deleted3fooENS_1AE(%"struct.one_deleted::A"*)
 // OLDABI-LABEL: declare void @_ZN11one_deleted3fooENS_1AE(i8*)
 
-// WIN64-LABEL: declare void @"\01?foo at one_deleted@@YAXUA at 1@@Z"(%"struct.one_deleted::A"*)
+// WIN64-LABEL: declare dso_local void @"\01?foo at one_deleted@@YAXUA at 1@@Z"(%"struct.one_deleted::A"*)
 }
 
 namespace copy_defaulted {
@@ -149,7 +149,7 @@ void bar() {
 // CHECK: call void @_ZN14copy_defaulted3fooENS_1AE(i8* %{{.*}})
 // CHECK-LABEL: declare void @_ZN14copy_defaulted3fooENS_1AE(i8*)
 
-// WIN64-LABEL: declare void @"\01?foo at copy_defaulted@@YAXUA at 1@@Z"(i64)
+// WIN64-LABEL: declare dso_local void @"\01?foo at copy_defaulted@@YAXUA at 1@@Z"(i64)
 }
 
 namespace move_defaulted {
@@ -169,7 +169,7 @@ void bar() {
 // CHECK: call void @_ZN14move_defaulted3fooENS_1AE(i8* %{{.*}})
 // CHECK-LABEL: declare void @_ZN14move_defaulted3fooENS_1AE(i8*)
 
-// WIN64-LABEL: declare void @"\01?foo at move_defaulted@@YAXUA at 1@@Z"(%"struct.move_defaulted::A"*)
+// WIN64-LABEL: declare dso_local void @"\01?foo at move_defaulted@@YAXUA at 1@@Z"(%"struct.move_defaulted::A"*)
 }
 
 namespace trivial_defaulted {
@@ -188,7 +188,7 @@ void bar() {
 // CHECK: call void @_ZN17trivial_defaulted3fooENS_1AE(i8* %{{.*}})
 // CHECK-LABEL: declare void @_ZN17trivial_defaulted3fooENS_1AE(i8*)
 
-// WIN64-LABEL: declare void @"\01?foo at trivial_defaulted@@YAXUA at 1@@Z"(i64)
+// WIN64-LABEL: declare dso_local void @"\01?foo at trivial_defaulted@@YAXUA at 1@@Z"(i64)
 }
 
 namespace two_copy_ctors {
@@ -211,7 +211,7 @@ void bar() {
 // NEWABI-LABEL: declare void @_ZN14two_copy_ctors3fooENS_1BE(%"struct.two_copy_ctors::B"*)
 // OLDABI-LABEL: declare void @_ZN14two_copy_ctors3fooENS_1BE(%"struct.two_copy_ctors::B"* byval
 
-// WIN64-LABEL: declare void @"\01?foo at two_copy_ctors@@YAXUB at 1@@Z"(%"struct.two_copy_ctors::B"*)
+// WIN64-LABEL: declare dso_local void @"\01?foo at two_copy_ctors@@YAXUB at 1@@Z"(%"struct.two_copy_ctors::B"*)
 }
 
 namespace definition_only {
@@ -223,7 +223,7 @@ struct A {
 void *foo(A a) { return a.p; }
 // NEWABI-LABEL: define i8* @_ZN15definition_only3fooENS_1AE(%"struct.definition_only::A"*
 // OLDABI-LABEL: define i8* @_ZN15definition_only3fooENS_1AE(i8*
-// WIN64-LABEL: define i8* @"\01?foo at definition_only@@YAPEAXUA at 1@@Z"(%"struct.definition_only::A"*
+// WIN64-LABEL: define dso_local i8* @"\01?foo at definition_only@@YAPEAXUA at 1@@Z"(%"struct.definition_only::A"*
 }
 
 namespace deleted_by_member {
@@ -239,7 +239,7 @@ struct A {
 void *foo(A a) { return a.b.p; }
 // NEWABI-LABEL: define i8* @_ZN17deleted_by_member3fooENS_1AE(%"struct.deleted_by_member::A"*
 // OLDABI-LABEL: define i8* @_ZN17deleted_by_member3fooENS_1AE(i8*
-// WIN64-LABEL: define i8* @"\01?foo at deleted_by_member@@YAPEAXUA at 1@@Z"(%"struct.deleted_by_member::A"*
+// WIN64-LABEL: define dso_local i8* @"\01?foo at deleted_by_member@@YAPEAXUA at 1@@Z"(%"struct.deleted_by_member::A"*
 }
 
 namespace deleted_by_base {
@@ -254,7 +254,7 @@ struct A : B {
 void *foo(A a) { return a.p; }
 // NEWABI-LABEL: define i8* @_ZN15deleted_by_base3fooENS_1AE(%"struct.deleted_by_base::A"*
 // OLDABI-LABEL: define i8* @_ZN15deleted_by_base3fooENS_1AE(i8*
-// WIN64-LABEL: define i8* @"\01?foo at deleted_by_base@@YAPEAXUA at 1@@Z"(%"struct.deleted_by_base::A"*
+// WIN64-LABEL: define dso_local i8* @"\01?foo at deleted_by_base@@YAPEAXUA at 1@@Z"(%"struct.deleted_by_base::A"*
 }
 
 namespace deleted_by_member_copy {
@@ -270,7 +270,7 @@ struct A {
 void *foo(A a) { return a.b.p; }
 // NEWABI-LABEL: define i8* @_ZN22deleted_by_member_copy3fooENS_1AE(%"struct.deleted_by_member_copy::A"*
 // OLDABI-LABEL: define i8* @_ZN22deleted_by_member_copy3fooENS_1AE(i8*
-// WIN64-LABEL: define i8* @"\01?foo at deleted_by_member_copy@@YAPEAXUA at 1@@Z"(%"struct.deleted_by_member_copy::A"*
+// WIN64-LABEL: define dso_local i8* @"\01?foo at deleted_by_member_copy@@YAPEAXUA at 1@@Z"(%"struct.deleted_by_member_copy::A"*
 }
 
 namespace deleted_by_base_copy {
@@ -285,7 +285,7 @@ struct A : B {
 void *foo(A a) { return a.p; }
 // NEWABI-LABEL: define i8* @_ZN20deleted_by_base_copy3fooENS_1AE(%"struct.deleted_by_base_copy::A"*
 // OLDABI-LABEL: define i8* @_ZN20deleted_by_base_copy3fooENS_1AE(i8*
-// WIN64-LABEL: define i8* @"\01?foo at deleted_by_base_copy@@YAPEAXUA at 1@@Z"(%"struct.deleted_by_base_copy::A"*
+// WIN64-LABEL: define dso_local i8* @"\01?foo at deleted_by_base_copy@@YAPEAXUA at 1@@Z"(%"struct.deleted_by_base_copy::A"*
 }
 
 namespace explicit_delete {
@@ -296,7 +296,7 @@ struct A {
 };
 // NEWABI-LABEL: define i8* @_ZN15explicit_delete3fooENS_1AE(%"struct.explicit_delete::A"*
 // OLDABI-LABEL: define i8* @_ZN15explicit_delete3fooENS_1AE(i8*
-// WIN64-LABEL: define i8* @"\01?foo at explicit_delete@@YAPEAXUA at 1@@Z"(%"struct.explicit_delete::A"*
+// WIN64-LABEL: define dso_local i8* @"\01?foo at explicit_delete@@YAPEAXUA at 1@@Z"(%"struct.explicit_delete::A"*
 void *foo(A a) { return a.p; }
 }
 

Modified: cfe/trunk/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp Fri Feb 23 11:30:48 2018
@@ -10,7 +10,7 @@ struct X {
 void vararg(...);
 
 void test(X x) {
-  // CHECK-LABEL: define void @"\01?test@@YAXUX@@@Z"
+  // CHECK-LABEL: define dso_local void @"\01?test@@YAXUX@@@Z"
 
   // X86: %[[argmem:[^ ]*]] = alloca inalloca <{ %struct.X }>
   // X86: call void (<{ %struct.X }>*, ...) bitcast (void (...)* @"\01?vararg@@YAXZZ" to void (<{ %struct.X }>*, ...)*)(<{ %struct.X }>* inalloca %[[argmem]])

Modified: cfe/trunk/test/CodeGenCXX/virt-template-vtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/virt-template-vtable.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/virt-template-vtable.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/virt-template-vtable.cpp Fri Feb 23 11:30:48 2018
@@ -16,10 +16,10 @@ extern template class A<short>;
 template class A<short>;
 
 
-// CHECK: @_ZTV1B = linkonce_odr unnamed_addr constant
-// CHECK: @_ZTV1AIlE = weak_odr unnamed_addr constant
-// CHECK: @_ZTV1AIsE = weak_odr unnamed_addr constant
-// CHECK: @_ZTV1AIiE = linkonce_odr unnamed_addr constant
+// CHECK: @_ZTV1B = linkonce_odr {{(dso_local )?}}unnamed_addr constant
+// CHECK: @_ZTV1AIlE = weak_odr {{(dso_local )?}}unnamed_addr constant
+// CHECK: @_ZTV1AIsE = weak_odr {{(dso_local )?}}unnamed_addr constant
+// CHECK: @_ZTV1AIiE = linkonce_odr {{(dso_local )?}}unnamed_addr constant
 
 template<class T> struct C {
   virtual void c() {}

Modified: cfe/trunk/test/CodeGenCXX/virtual-base-ctor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/virtual-base-ctor.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/virtual-base-ctor.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/virtual-base-ctor.cpp Fri Feb 23 11:30:48 2018
@@ -8,4 +8,4 @@ struct A { int a; A() { y = ((size_t)thi
 struct B : virtual A { void* x; };    
 B x;
 
-// CHECK: @y = local_unnamed_addr global i8 2
+// CHECK: @y = {{(dso_local )?}}local_unnamed_addr global i8 2

Modified: cfe/trunk/test/CodeGenCXX/virtual-function-attrs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/virtual-function-attrs.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/virtual-function-attrs.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/virtual-function-attrs.cpp Fri Feb 23 11:30:48 2018
@@ -8,7 +8,7 @@ class A {
 
 void A::f() {}
 
-// CHECK: define [[CC:(x86_thiscallcc )?]]void @_ZN1A1fEv({{.*}}) unnamed_addr
-// CHECK: declare [[CC]]void @_ZN1A1gEv({{.*}}) unnamed_addr
+// CHECK: define {{(dso_local )?}}[[CC:(x86_thiscallcc )?]]void @_ZN1A1fEv({{.*}}) unnamed_addr
+// CHECK: declare {{(dso_local )?}}[[CC]]void @_ZN1A1gEv({{.*}}) unnamed_addr
 // CHECK: declare {{.*}} @_ZN1AD1Ev({{.*}}) unnamed_addr
-// CHECK: declare [[CC]]void @_ZN1AD0Ev({{.*}}) unnamed_addr
+// CHECK: declare {{(dso_local )?}}[[CC]]void @_ZN1AD0Ev({{.*}}) unnamed_addr

Modified: cfe/trunk/test/CodeGenCXX/virtual-function-calls.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/virtual-function-calls.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/virtual-function-calls.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/virtual-function-calls.cpp Fri Feb 23 11:30:48 2018
@@ -44,7 +44,7 @@ namespace VirtualNoreturn {
   };
 
   // CHECK-LABEL: @_ZN15VirtualNoreturn1f
-  // CHECK-INVARIANT-LABEL: define void @_ZN15VirtualNoreturn1f
+  // CHECK-INVARIANT-LABEL: define {{(dso_local )?}}void @_ZN15VirtualNoreturn1f
   void f(A *p) {
     p->f();
     // CHECK: call {{.*}}void %{{[^#]*$}}

Modified: cfe/trunk/test/CodeGenCXX/volatile-1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/volatile-1.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/volatile-1.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/volatile-1.cpp Fri Feb 23 11:30:48 2018
@@ -1,11 +1,11 @@
 // RUN: %clang_cc1 -Wno-unused-value -triple %itanium_abi_triple -emit-llvm %s -std=c++98 -o - | FileCheck %s
 // RUN: %clang_cc1 -Wno-unused-value -triple %itanium_abi_triple -emit-llvm %s -std=c++11 -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK11 %s
 
-// CHECK: @i = global [[INT:i[0-9]+]] 0
+// CHECK: @i = {{(dso_local )?}}global [[INT:i[0-9]+]] 0
 volatile int i, j, k;
 volatile int ar[5];
 volatile char c;
-// CHECK: @ci = global [[CINT:.*]] zeroinitializer
+// CHECK: @ci = {{(dso_local )?}}global [[CINT:.*]] zeroinitializer
 volatile _Complex int ci;
 volatile struct S {
 #ifdef __cplusplus

Modified: cfe/trunk/test/CodeGenCXX/vtable-assume-load.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vtable-assume-load.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/vtable-assume-load.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/vtable-assume-load.cpp Fri Feb 23 11:30:48 2018
@@ -163,7 +163,7 @@ struct __declspec(novtable) S {
 void g(S &s) { s.foo(); }
 
 // if struct has novtable specifier, then we can't generate assumes
-// CHECK-MS-LABEL: define void @"\01?test at testMS@@YAXXZ"()
+// CHECK-MS-LABEL: define dso_local void @"\01?test at testMS@@YAXXZ"()
 // CHECK-MS: call x86_thiscallcc %"struct.testMS::S"* @"\01??0S at testMS@@QAE at XZ"(
 // CHECK-MS-NOT: @llvm.assume
 // CHECK-MS-LABEL: {{^}}}

Modified: cfe/trunk/test/CodeGenCXX/vtable-key-function-ios.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vtable-key-function-ios.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/vtable-key-function-ios.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/vtable-key-function-ios.cpp Fri Feb 23 11:30:48 2018
@@ -28,8 +28,8 @@ struct Test0a {
 
 // V-table should be defined externally.
 Test0a::Test0a() { use(typeid(Test0a)); }
-// CHECK: @_ZTV6Test0a = external unnamed_addr constant 
-// CHECK: @_ZTI6Test0a = external constant
+// CHECK: @_ZTV6Test0a = external {{(dso_local )?}}unnamed_addr constant 
+// CHECK: @_ZTI6Test0a = external {{(dso_local )?}}constant
 
 // This is not a key function.
 void Test0a::foo() {}
@@ -47,8 +47,8 @@ void Test0b::foo() {}
 
 // V-table should be defined externally.
 Test0b::Test0b() { use(typeid(Test0b)); }
-// CHECK: @_ZTV6Test0b = external unnamed_addr constant 
-// CHECK: @_ZTI6Test0b = external constant
+// CHECK: @_ZTV6Test0b = external {{(dso_local )?}}unnamed_addr constant 
+// CHECK: @_ZTI6Test0b = external {{(dso_local )?}}constant
 
 /*** Test1a ******************************************************************/
 
@@ -60,9 +60,9 @@ struct Test1a {
 
 // V-table needs to be defined weakly.
 Test1a::Test1a() { use(typeid(Test1a)); }
-// CHECK:      @_ZTV6Test1a = linkonce_odr unnamed_addr constant 
-// CHECK-LATE: @_ZTS6Test1a = linkonce_odr constant
-// CHECK-LATE: @_ZTI6Test1a = linkonce_odr constant
+// CHECK:      @_ZTV6Test1a = linkonce_odr {{(dso_local )?}}unnamed_addr constant 
+// CHECK-LATE: @_ZTS6Test1a = linkonce_odr {{(dso_local )?}}constant
+// CHECK-LATE: @_ZTI6Test1a = linkonce_odr {{(dso_local )?}}constant
 
 // This defines the key function.
 inline void Test1a::foo() {}
@@ -80,9 +80,9 @@ inline void Test1b::foo() {}
 
 // V-table should be defined weakly..
 Test1b::Test1b() { use(typeid(Test1b)); }
-// CHECK: @_ZTV6Test1b = linkonce_odr unnamed_addr constant 
-// CHECK: @_ZTS6Test1b = linkonce_odr constant
-// CHECK: @_ZTI6Test1b = linkonce_odr constant
+// CHECK: @_ZTV6Test1b = linkonce_odr {{(dso_local )?}}unnamed_addr constant 
+// CHECK: @_ZTS6Test1b = linkonce_odr {{(dso_local )?}}constant
+// CHECK: @_ZTI6Test1b = linkonce_odr {{(dso_local )?}}constant
 
 /*** Test2a ******************************************************************/
 
@@ -94,9 +94,9 @@ struct Test2a {
 
 // V-table should be defined with weak linkage.
 Test2a::Test2a() { use(typeid(Test2a)); }
-// CHECK:      @_ZTV6Test2a = linkonce_odr unnamed_addr constant
-// CHECK-LATE: @_ZTS6Test2a = linkonce_odr constant
-// CHECK-LATE: @_ZTI6Test2a = linkonce_odr constant
+// CHECK:      @_ZTV6Test2a = linkonce_odr {{(dso_local )?}}unnamed_addr constant
+// CHECK-LATE: @_ZTS6Test2a = linkonce_odr {{(dso_local )?}}constant
+// CHECK-LATE: @_ZTI6Test2a = linkonce_odr {{(dso_local )?}}constant
 
 void Test2a::bar() {}
 inline void Test2a::foo() {}
@@ -113,9 +113,9 @@ void Test2b::bar() {}
 
 // V-table should be defined with weak linkage.
 Test2b::Test2b() { use(typeid(Test2b)); }
-// CHECK:      @_ZTV6Test2b = linkonce_odr unnamed_addr constant
-// CHECK-LATE: @_ZTS6Test2b = linkonce_odr constant
-// CHECK-LATE: @_ZTI6Test2b = linkonce_odr constant
+// CHECK:      @_ZTV6Test2b = linkonce_odr {{(dso_local )?}}unnamed_addr constant
+// CHECK-LATE: @_ZTS6Test2b = linkonce_odr {{(dso_local )?}}constant
+// CHECK-LATE: @_ZTI6Test2b = linkonce_odr {{(dso_local )?}}constant
 
 inline void Test2b::foo() {}
 
@@ -132,9 +132,9 @@ inline void Test2c::foo() {}
 
 // V-table should be defined with weak linkage.
 Test2c::Test2c() { use(typeid(Test2c)); }
-// CHECK: @_ZTV6Test2c = linkonce_odr unnamed_addr constant
-// CHECK: @_ZTS6Test2c = linkonce_odr constant
-// CHECK: @_ZTI6Test2c = linkonce_odr constant
+// CHECK: @_ZTV6Test2c = linkonce_odr {{(dso_local )?}}unnamed_addr constant
+// CHECK: @_ZTS6Test2c = linkonce_odr {{(dso_local )?}}constant
+// CHECK: @_ZTI6Test2c = linkonce_odr {{(dso_local )?}}constant
 
 /*** Test3a ******************************************************************/
 
@@ -146,9 +146,9 @@ struct Test3a {
 
 // V-table should be defined with weak linkage.
 Test3a::Test3a() { use(typeid(Test3a)); }
-// CHECK:      @_ZTV6Test3a = linkonce_odr unnamed_addr constant
-// CHECK-LATE: @_ZTS6Test3a = linkonce_odr constant
-// CHECK-LATE: @_ZTI6Test3a = linkonce_odr constant
+// CHECK:      @_ZTV6Test3a = linkonce_odr {{(dso_local )?}}unnamed_addr constant
+// CHECK-LATE: @_ZTS6Test3a = linkonce_odr {{(dso_local )?}}constant
+// CHECK-LATE: @_ZTI6Test3a = linkonce_odr {{(dso_local )?}}constant
 
 // This defines the key function.
 inline void Test3a::bar() {}
@@ -166,9 +166,9 @@ inline void Test3b::bar() {}
 
 // V-table should be defined with weak linkage.
 Test3b::Test3b() { use(typeid(Test3b)); }
-// CHECK:      @_ZTV6Test3b = linkonce_odr unnamed_addr constant
-// CHECK-LATE: @_ZTS6Test3b = linkonce_odr constant
-// CHECK-LATE: @_ZTI6Test3b = linkonce_odr constant
+// CHECK:      @_ZTV6Test3b = linkonce_odr {{(dso_local )?}}unnamed_addr constant
+// CHECK-LATE: @_ZTS6Test3b = linkonce_odr {{(dso_local )?}}constant
+// CHECK-LATE: @_ZTI6Test3b = linkonce_odr {{(dso_local )?}}constant
 
 // This defines the key function.
 inline void Test3b::foo() {}
@@ -187,6 +187,6 @@ inline void Test3c::foo() {}
 
 // V-table should be defined with weak linkage.
 Test3c::Test3c() { use(typeid(Test3c)); }
-// CHECK: @_ZTV6Test3c = linkonce_odr unnamed_addr constant
-// CHECK: @_ZTS6Test3c = linkonce_odr constant
-// CHECK: @_ZTI6Test3c = linkonce_odr constant
+// CHECK: @_ZTV6Test3c = linkonce_odr {{(dso_local )?}}unnamed_addr constant
+// CHECK: @_ZTS6Test3c = linkonce_odr {{(dso_local )?}}constant
+// CHECK: @_ZTI6Test3c = linkonce_odr {{(dso_local )?}}constant

Modified: cfe/trunk/test/CodeGenCXX/vtable-key-function-win-comdat.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vtable-key-function-win-comdat.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/vtable-key-function-win-comdat.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/vtable-key-function-win-comdat.cpp Fri Feb 23 11:30:48 2018
@@ -20,6 +20,6 @@ inline void Test1a::foo() {}
 // CHECK-NOT: $_ZTS6Test1a.1 = comdat any
 // CHECK-NOT: $_ZTI6Test1a.1 = comdat any
 
-// CHECK: @_ZTV6Test1a = linkonce_odr unnamed_addr constant {{.*}} ({ i8*, i8* }* @_ZTI6Test1a to i8*)
-// CHECK: @_ZTS6Test1a = linkonce_odr constant
-// CHECK: @_ZTI6Test1a = linkonce_odr constant {{.*}} [8 x i8]* @_ZTS6Test1a
+// CHECK: @_ZTV6Test1a = linkonce_odr dso_local unnamed_addr constant {{.*}} ({ i8*, i8* }* @_ZTI6Test1a to i8*)
+// CHECK: @_ZTS6Test1a = linkonce_odr dso_local constant
+// CHECK: @_ZTI6Test1a = linkonce_odr dso_local constant {{.*}} [8 x i8]* @_ZTS6Test1a

Modified: cfe/trunk/test/CodeGenCXX/weak-extern-typeinfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/weak-extern-typeinfo.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/weak-extern-typeinfo.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/weak-extern-typeinfo.cpp Fri Feb 23 11:30:48 2018
@@ -31,17 +31,17 @@ class V2 : public virtual V1 {
 void V1::foo() { }
 void V2::foo() { }
 
-// CHECK: @_ZTS1A = weak_odr constant
-// CHECK: @_ZTI1A = weak_odr constant
-// CHECK: @_ZTS1B = weak_odr constant
-// CHECK: @_ZTI1B = weak_odr constant
-// CHECK: @_ZTS1C = weak_odr constant
-// CHECK: @_ZTS2T1 = linkonce_odr constant
-// CHECK: @_ZTI2T1 = linkonce_odr constant
-// CHECK: @_ZTS1T = linkonce_odr constant
-// CHECK: @_ZTI1T = linkonce_odr constant
-// CHECK: @_ZTI1C = weak_odr constant
-// CHECK: @_ZTS2V1 = weak_odr constant
-// CHECK: @_ZTI2V1 = weak_odr constant
-// CHECK: @_ZTS2V2 = weak_odr constant
-// CHECK: @_ZTI2V2 = weak_odr constant
+// CHECK: @_ZTS1A = weak_odr {{(dso_local )?}}constant
+// CHECK: @_ZTI1A = weak_odr {{(dso_local )?}}constant
+// CHECK: @_ZTS1B = weak_odr {{(dso_local )?}}constant
+// CHECK: @_ZTI1B = weak_odr {{(dso_local )?}}constant
+// CHECK: @_ZTS1C = weak_odr {{(dso_local )?}}constant
+// CHECK: @_ZTS2T1 = linkonce_odr {{(dso_local )?}}constant
+// CHECK: @_ZTI2T1 = linkonce_odr {{(dso_local )?}}constant
+// CHECK: @_ZTS1T = linkonce_odr {{(dso_local )?}}constant
+// CHECK: @_ZTI1T = linkonce_odr {{(dso_local )?}}constant
+// CHECK: @_ZTI1C = weak_odr {{(dso_local )?}}constant
+// CHECK: @_ZTS2V1 = weak_odr {{(dso_local )?}}constant
+// CHECK: @_ZTI2V1 = weak_odr {{(dso_local )?}}constant
+// CHECK: @_ZTS2V2 = weak_odr {{(dso_local )?}}constant
+// CHECK: @_ZTI2V2 = weak_odr {{(dso_local )?}}constant

Modified: cfe/trunk/test/CodeGenCXX/windows-itanium-type-info.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/windows-itanium-type-info.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/windows-itanium-type-info.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/windows-itanium-type-info.cpp Fri Feb 23 11:30:48 2018
@@ -24,17 +24,17 @@ void f() {
   throw base();
 }
 
-// CHECK-DAG: @_ZTIi = dllexport constant
-// CHECK-DAG: @_ZTSi = dllexport constant
+// CHECK-DAG: @_ZTIi = dso_local dllexport constant
+// CHECK-DAG: @_ZTSi = dso_local dllexport constant
 
-// CHECK-DAG: @_ZTI7derived = dllexport constant
-// CHECK-DAG: @_ZTS7derived = dllexport constant
-// CHECK-DAG: @_ZTV7derived = dllexport unnamed_addr constant
+// CHECK-DAG: @_ZTI7derived = dso_local dllexport constant
+// CHECK-DAG: @_ZTS7derived = dso_local dllexport constant
+// CHECK-DAG: @_ZTV7derived = dso_local dllexport unnamed_addr constant
 
 // CHECK-DAG: @_ZTI4base = external dllimport constant
 
-// CHECK-EH-IMPORT: @_ZTS4base = linkonce_odr constant
-// CHECK-EH-IMPORT: @_ZTI4base = linkonce_odr constant
+// CHECK-EH-IMPORT: @_ZTS4base = linkonce_odr dso_local constant
+// CHECK-EH-IMPORT: @_ZTI4base = linkonce_odr dso_local constant
 
 struct __declspec(dllimport) gatekeeper {};
 struct zuul : gatekeeper {
@@ -42,5 +42,5 @@ struct zuul : gatekeeper {
 };
 zuul::~zuul() {}
 
-// CHECK-DAG: @_ZTI10gatekeeper = linkonce_odr constant
-// CHECK-DAG: @_ZTS10gatekeeper = linkonce_odr constant
+// CHECK-DAG: @_ZTI10gatekeeper = linkonce_odr dso_local constant
+// CHECK-DAG: @_ZTS10gatekeeper = linkonce_odr dso_local constant

Modified: cfe/trunk/test/CodeGenCoroutines/coro-promise-dtor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCoroutines/coro-promise-dtor.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCoroutines/coro-promise-dtor.cpp (original)
+++ cfe/trunk/test/CodeGenCoroutines/coro-promise-dtor.cpp Fri Feb 23 11:30:48 2018
@@ -28,7 +28,7 @@ coro_t f() {
   co_return;
 }
 
-// CHECK-LABEL: define void @"\01?f@@YA?AUcoro_t@@XZ"(
+// CHECK-LABEL: define dso_local void @"\01?f@@YA?AUcoro_t@@XZ"(
 // CHECK:  %gro.active = alloca i1
 // CHECK:  store i1 false, i1* %gro.active
 

Modified: cfe/trunk/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm Fri Feb 23 11:30:48 2018
@@ -9,7 +9,7 @@ struct A {
 
 // Verify that we destruct things from left to right in the MS C++ ABI: a, b, c, d.
 //
-// CHECK-LABEL: define void @"\01?test_arc_order@@YAXUA@@PAUobjc_object@@01 at Z"
+// CHECK-LABEL: define dso_local void @"\01?test_arc_order@@YAXUA@@PAUobjc_object@@01 at Z"
 // CHECK:                       (<{ %struct.A, i8*, %struct.A, i8* }>* inalloca)
 void test_arc_order(A a, id __attribute__((ns_consumed)) b , A c, id __attribute__((ns_consumed)) d) {
   // CHECK: call x86_thiscallcc void @"\01??1A@@QAE at XZ"(%struct.A* %{{.*}})

Modified: cfe/trunk/test/CodeGenObjCXX/msabi-objc-types.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/msabi-objc-types.mm?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/msabi-objc-types.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/msabi-objc-types.mm Fri Feb 23 11:30:48 2018
@@ -3,13 +3,13 @@
 @class I;
 
 id kid;
-// CHECK: @"\01?kid@@3PAUobjc_object@@A" = global
+// CHECK: @"\01?kid@@3PAUobjc_object@@A" =  dso_local global
 
 Class klass;
-// CHECK: @"\01?klass@@3PAUobjc_class@@A" = global
+// CHECK: @"\01?klass@@3PAUobjc_class@@A" = dso_local global
 
 I *kI;
-// CHECK: @"\01?kI@@3PAUI@@A" = global
+// CHECK: @"\01?kI@@3PAUI@@A" = dso_local global
 
 void f(I *) {}
 // CHECK-LABEL: "\01?f@@YAXPAUI@@@Z"

Modified: cfe/trunk/test/CodeGenOpenCL/address-spaces.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/address-spaces.cl?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenOpenCL/address-spaces.cl (original)
+++ cfe/trunk/test/CodeGenOpenCL/address-spaces.cl Fri Feb 23 11:30:48 2018
@@ -13,13 +13,13 @@ struct S {
   int *z;
 };
 
-// CL20-DAG: @g_extern_var = external addrspace(1) global float
-// CL20-DAG: @l_extern_var = external addrspace(1) global float
+// CL20-DAG: @g_extern_var = external {{(dso_local )?}}addrspace(1) global float
+// CL20-DAG: @l_extern_var = external {{(dso_local )?}}addrspace(1) global float
 // CL20-DAG: @test_static.l_static_var = internal addrspace(1) global float 0.000000e+00
 // CL20-DAG: @g_static_var = internal addrspace(1) global float 0.000000e+00
 
 #ifdef CL20
-// CL20-DAG: @g_s = common addrspace(1) global %struct.S zeroinitializer
+// CL20-DAG: @g_s = common {{(dso_local )?}}addrspace(1) global %struct.S zeroinitializer
 struct S g_s;
 #endif
 
@@ -53,10 +53,10 @@ void fc(constant int *arg) {}
 
 #ifdef CL20
 int i;
-// CL20-DAG: @i = common addrspace(1) global i32 0
+// CL20-DAG: @i = common {{(dso_local )?}}addrspace(1) global i32 0
 int *ptr;
-// CL20SPIR-DAG: @ptr = common addrspace(1) global i32 addrspace(4)* null
-// CL20AMDGCN-DAG: @ptr = common addrspace(1) global i32* null
+// CL20SPIR-DAG: @ptr = common {{(dso_local )?}}addrspace(1) global i32 addrspace(4)* null
+// CL20AMDGCN-DAG: @ptr = common {{(dso_local )?}}addrspace(1) global i32* null
 #endif
 
 // SPIR: i32* %arg
@@ -79,13 +79,13 @@ void f(int *arg) {
 
 typedef int int_td;
 typedef int *intp_td;
-// SPIR: define void @test_typedef(i32 addrspace(1)* %x, i32 addrspace(2)* %y, i32* %z)
+// SPIR: define {{(dso_local )?}}void @test_typedef(i32 addrspace(1)* %x, i32 addrspace(2)* %y, i32* %z)
 void test_typedef(global int_td *x, constant int_td *y, intp_td z) {
   *x = *y;
   *z = 0;
 }
 
-// SPIR: define void @test_struct()
+// SPIR: define {{(dso_local )?}}void @test_struct()
 void test_struct() {
   // SPIR: %ps = alloca %struct.S*
   // CL20SPIR: %ps = alloca %struct.S addrspace(4)*
@@ -99,7 +99,7 @@ void test_struct() {
 #endif
 }
 
-// SPIR-LABEL: define void @test_void_par()
+// SPIR-LABEL: define {{(dso_local )?}}void @test_void_par()
 void test_void_par(void) {}
 
 // On ppc64 returns signext i32.

Modified: cfe/trunk/test/CodeGenOpenCL/kernel-attributes.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/kernel-attributes.cl?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenOpenCL/kernel-attributes.cl (original)
+++ cfe/trunk/test/CodeGenOpenCL/kernel-attributes.cl Fri Feb 23 11:30:48 2018
@@ -3,13 +3,13 @@
 typedef unsigned int uint4 __attribute__((ext_vector_type(4)));
 
 kernel  __attribute__((vec_type_hint(int))) __attribute__((reqd_work_group_size(1,2,4))) void kernel1(int a) {}
-// CHECK: define spir_kernel void @kernel1(i32 {{[^%]*}}%a) {{[^{]+}} !vec_type_hint ![[MD1:[0-9]+]] !reqd_work_group_size ![[MD2:[0-9]+]]
+// CHECK: define {{(dso_local )?}}spir_kernel void @kernel1(i32 {{[^%]*}}%a) {{[^{]+}} !vec_type_hint ![[MD1:[0-9]+]] !reqd_work_group_size ![[MD2:[0-9]+]]
 
 kernel __attribute__((vec_type_hint(uint4))) __attribute__((work_group_size_hint(8,16,32))) void kernel2(int a) {}
-// CHECK: define spir_kernel void @kernel2(i32 {{[^%]*}}%a) {{[^{]+}} !vec_type_hint ![[MD3:[0-9]+]] !work_group_size_hint ![[MD4:[0-9]+]]
+// CHECK: define {{(dso_local )?}}spir_kernel void @kernel2(i32 {{[^%]*}}%a) {{[^{]+}} !vec_type_hint ![[MD3:[0-9]+]] !work_group_size_hint ![[MD4:[0-9]+]]
 
 kernel __attribute__((intel_reqd_sub_group_size(8))) void kernel3(int a) {}
-// CHECK: define spir_kernel void @kernel3(i32 {{[^%]*}}%a) {{[^{]+}} !intel_reqd_sub_group_size ![[MD5:[0-9]+]]
+// CHECK: define {{(dso_local )?}}spir_kernel void @kernel3(i32 {{[^%]*}}%a) {{[^{]+}} !intel_reqd_sub_group_size ![[MD5:[0-9]+]]
 
 // CHECK: [[MD1]] = !{i32 undef, i32 1}
 // CHECK: [[MD2]] = !{i32 1, i32 2, i32 4}

Modified: cfe/trunk/test/CodeGenOpenCL/kernel-metadata.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/kernel-metadata.cl?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenOpenCL/kernel-metadata.cl (original)
+++ cfe/trunk/test/CodeGenOpenCL/kernel-metadata.cl Fri Feb 23 11:30:48 2018
@@ -6,5 +6,5 @@ void normal_function() {
 __kernel void kernel_function() {
 }
 
-// CHECK: define spir_kernel void @kernel_function() {{[^{]+}} !kernel_arg_addr_space ![[MD:[0-9]+]] !kernel_arg_access_qual ![[MD]] !kernel_arg_type ![[MD]] !kernel_arg_base_type ![[MD]] !kernel_arg_type_qual ![[MD]] {
+// CHECK: define {{.*}}spir_kernel void @kernel_function() {{[^{]+}} !kernel_arg_addr_space ![[MD:[0-9]+]] !kernel_arg_access_qual ![[MD]] !kernel_arg_type ![[MD]] !kernel_arg_base_type ![[MD]] !kernel_arg_type_qual ![[MD]] {
 // CHECK: ![[MD]] = !{}

Modified: cfe/trunk/test/CodeGenOpenCL/str_literals.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/str_literals.cl?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenOpenCL/str_literals.cl (original)
+++ cfe/trunk/test/CodeGenOpenCL/str_literals.cl Fri Feb 23 11:30:48 2018
@@ -5,5 +5,5 @@ __constant char * __constant y = "hello
 
 // CHECK: unnamed_addr addrspace(2) constant
 // CHECK-NOT: addrspace(2) unnamed_addr constant
-// CHECK: @x = addrspace(2) constant i8 addrspace(2)*
-// CHECK: @y = addrspace(2) constant i8 addrspace(2)*
+// CHECK: @x = {{(dso_local )?}}addrspace(2) constant i8 addrspace(2)*
+// CHECK: @y = {{(dso_local )?}}addrspace(2) constant i8 addrspace(2)*

Modified: cfe/trunk/test/Modules/cxx-irgen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/cxx-irgen.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/Modules/cxx-irgen.cpp (original)
+++ cfe/trunk/test/Modules/cxx-irgen.cpp Fri Feb 23 11:30:48 2018
@@ -12,15 +12,15 @@ CtorInit<int> x;
 
 // Keep these two namespace definitions separate; merging them hides the bug.
 namespace EmitInlineMethods {
-  // CHECK-DAG: define linkonce_odr [[CC:([0-9_a-z]*cc[ ]+)?]]void @_ZN17EmitInlineMethods1C1fEPNS_1AE(
-  // CHECK-DAG: declare [[CC]]void @_ZN17EmitInlineMethods1A1gEv(
+  // CHECK-DAG: define linkonce_odr {{(dso_local )?}}[[CC:([0-9_a-z]*cc[ ]+)?]]void @_ZN17EmitInlineMethods1C1fEPNS_1AE(
+  // CHECK-DAG: declare {{(dso_local )?}}[[CC]]void @_ZN17EmitInlineMethods1A1gEv(
   struct C {
     __attribute__((used)) void f(A *p) { p->g(); }
   };
 }
 namespace EmitInlineMethods {
-  // CHECK-DAG: define linkonce_odr [[CC]]void @_ZN17EmitInlineMethods1D1fEPNS_1BE(
-  // CHECK-DAG: define linkonce_odr [[CC]]void @_ZN17EmitInlineMethods1B1gEv(
+  // CHECK-DAG: define linkonce_odr {{(dso_local )?}}[[CC]]void @_ZN17EmitInlineMethods1D1fEPNS_1BE(
+  // CHECK-DAG: define linkonce_odr {{(dso_local )?}}[[CC]]void @_ZN17EmitInlineMethods1B1gEv(
   struct D {
     __attribute__((used)) void f(B *p) { p->g(); }
   };

Modified: cfe/trunk/test/OpenMP/for_private_codegen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_private_codegen.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_private_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/for_private_codegen.cpp Fri Feb 23 11:30:48 2018
@@ -47,7 +47,7 @@ T tmain() {
 int main() {
   static int svar;
 #ifdef LAMBDA
-  // LAMBDA: [[G:@.+]] = global double
+  // LAMBDA: [[G:@.+]] = {{(dso_local )?}}global double
   // LAMBDA-LABEL: @main
   // LAMBDA: call{{.*}} void [[OUTER_LAMBDA:@.+]](
   [&]() {
@@ -109,7 +109,7 @@ int main() {
   }();
   return 0;
 #elif defined(BLOCKS)
-  // BLOCKS: [[G:@.+]] = global double
+  // BLOCKS: [[G:@.+]] = {{(dso_local )?}}global double
   // BLOCKS-LABEL: @main
   // BLOCKS: call {{.*}}void {{%.+}}(i8
   ^{

Modified: cfe/trunk/test/OpenMP/parallel_copyin_codegen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_copyin_codegen.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_copyin_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_copyin_codegen.cpp Fri Feb 23 11:30:48 2018
@@ -56,18 +56,18 @@ struct S {
 // CHECK-DAG: [[VEC:@.+]] = internal global [2 x i{{[0-9]+}}] [i{{[0-9]+}} 1, i{{[0-9]+}} 2],
 // CHECK-DAG: [[S_ARR:@.+]] = internal global [2 x [[S_FLOAT_TY]]] zeroinitializer,
 // CHECK-DAG: [[VAR:@.+]] = internal global [[S_FLOAT_TY]] zeroinitializer,
-// CHECK-DAG: [[TMAIN_T_VAR:@.+]] = linkonce_odr global i{{[0-9]+}} 333,
-// CHECK-DAG: [[TMAIN_VEC:@.+]] = linkonce_odr global [2 x i{{[0-9]+}}] [i{{[0-9]+}} 3, i{{[0-9]+}} 3],
-// CHECK-DAG: [[TMAIN_S_ARR:@.+]] = linkonce_odr global [2 x [[S_INT_TY]]] zeroinitializer,
-// CHECK-DAG: [[TMAIN_VAR:@.+]] = linkonce_odr global [[S_INT_TY]] zeroinitializer,
+// CHECK-DAG: [[TMAIN_T_VAR:@.+]] = linkonce_odr {{(dso_local )?}}global i{{[0-9]+}} 333,
+// CHECK-DAG: [[TMAIN_VEC:@.+]] = linkonce_odr {{(dso_local )?}}global [2 x i{{[0-9]+}}] [i{{[0-9]+}} 3, i{{[0-9]+}} 3],
+// CHECK-DAG: [[TMAIN_S_ARR:@.+]] = linkonce_odr {{(dso_local )?}}global [2 x [[S_INT_TY]]] zeroinitializer,
+// CHECK-DAG: [[TMAIN_VAR:@.+]] = linkonce_odr {{(dso_local )?}}global [[S_INT_TY]] zeroinitializer,
 // TLS-CHECK-DAG: [[T_VAR:@.+]] = internal thread_local global i{{[0-9]+}} 1122,
 // TLS-CHECK-DAG: [[VEC:@.+]] = internal thread_local global [2 x i{{[0-9]+}}] [i{{[0-9]+}} 1, i{{[0-9]+}} 2],
 // TLS-CHECK-DAG: [[S_ARR:@.+]] = internal thread_local global [2 x [[S_FLOAT_TY]]] zeroinitializer,
 // TLS-CHECK-DAG: [[VAR:@.+]] = internal thread_local global [[S_FLOAT_TY]] zeroinitializer,
-// TLS-CHECK-DAG: [[TMAIN_T_VAR:@.+]] = linkonce_odr thread_local global i{{[0-9]+}} 333,
-// TLS-CHECK-DAG: [[TMAIN_VEC:@.+]] = linkonce_odr thread_local global [2 x i{{[0-9]+}}] [i{{[0-9]+}} 3, i{{[0-9]+}} 3],
-// TLS-CHECK-DAG: [[TMAIN_S_ARR:@.+]] = linkonce_odr thread_local global [2 x [[S_INT_TY]]] zeroinitializer,
-// TLS-CHECK-DAG: [[TMAIN_VAR:@.+]] = linkonce_odr thread_local global [[S_INT_TY]] zeroinitializer,
+// TLS-CHECK-DAG: [[TMAIN_T_VAR:@.+]] = linkonce_odr {{(dso_local )?}}thread_local global i{{[0-9]+}} 333,
+// TLS-CHECK-DAG: [[TMAIN_VEC:@.+]] = linkonce_odr {{(dso_local )?}}thread_local global [2 x i{{[0-9]+}}] [i{{[0-9]+}} 3, i{{[0-9]+}} 3],
+// TLS-CHECK-DAG: [[TMAIN_S_ARR:@.+]] = linkonce_odr {{(dso_local )?}}thread_local global [2 x [[S_INT_TY]]] zeroinitializer,
+// TLS-CHECK-DAG: [[TMAIN_VAR:@.+]] = linkonce_odr {{(dso_local )?}}thread_local global [[S_INT_TY]] zeroinitializer,
 
 template <typename T>
 T tmain() {
@@ -90,7 +90,7 @@ T tmain() {
 
 int main() {
 #ifdef LAMBDA
-  // LAMBDA: [[G:@.+]] = global i{{[0-9]+}} 1212,
+  // LAMBDA: [[G:@.+]] = {{(dso_local )?}}global i{{[0-9]+}} 1212,
   // LAMBDA-LABEL: @main
   // LAMBDA: call{{.*}} void [[OUTER_LAMBDA:@.+]](
   // TLS-LAMBDA: [[G:@.+]] = {{.*}}thread_local {{.*}}global i{{[0-9]+}} 1212,
@@ -152,7 +152,7 @@ int main() {
   }();
   return 0;
 #elif defined(BLOCKS)
-  // BLOCKS: [[G:@.+]] = global i{{[0-9]+}} 1212,
+  // BLOCKS: [[G:@.+]] = {{(dso_local )?}}global i{{[0-9]+}} 1212,
   // BLOCKS-LABEL: @main
   // BLOCKS: call {{.*}}void {{%.+}}(i8
 

Modified: cfe/trunk/test/OpenMP/parallel_private_codegen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_private_codegen.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_private_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_private_codegen.cpp Fri Feb 23 11:30:48 2018
@@ -103,7 +103,7 @@ int main() {
   static int sivar;
   SS ss(sivar);
 #ifdef LAMBDA
-  // LAMBDA: [[G:@.+]] = global i{{[0-9]+}} 1212,
+  // LAMBDA: [[G:@.+]] = {{(dso_local )?}}global i{{[0-9]+}} 1212,
   // LAMBDA-LABEL: @main
   // LAMBDA: alloca [[SS_TY]],
   // LAMBDA: alloca [[CAP_TY:%.+]],
@@ -175,7 +175,7 @@ int main() {
   }();
   return 0;
 #elif defined(BLOCKS)
-  // BLOCKS: [[G:@.+]] = global i{{[0-9]+}} 1212,
+  // BLOCKS: [[G:@.+]] = {{(dso_local )?}}global i{{[0-9]+}} 1212,
   // BLOCKS-LABEL: @main
   // BLOCKS: call
   // BLOCKS: call{{.*}} void {{%.+}}(i8

Modified: cfe/trunk/test/OpenMP/sections_private_codegen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/sections_private_codegen.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/sections_private_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/sections_private_codegen.cpp Fri Feb 23 11:30:48 2018
@@ -47,7 +47,7 @@ T tmain() {
 int main() {
   static int sivar;
 #ifdef LAMBDA
-  // LAMBDA: [[G:@.+]] = global double
+  // LAMBDA: [[G:@.+]] = {{(dso_local )?}}global double
   // LAMBDA-LABEL: @main
   // LAMBDA: call{{.*}} void [[OUTER_LAMBDA:@.+]](
   [&]() {
@@ -92,7 +92,7 @@ int main() {
   }();
   return 0;
 #elif defined(BLOCKS)
-  // BLOCKS: [[G:@.+]] = global double
+  // BLOCKS: [[G:@.+]] = {{(dso_local )?}}global double
   // BLOCKS-LABEL: @main
   // BLOCKS: call {{.*}}void {{%.+}}(i8
   ^{

Modified: cfe/trunk/test/OpenMP/single_private_codegen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/single_private_codegen.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/single_private_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/single_private_codegen.cpp Fri Feb 23 11:30:48 2018
@@ -46,7 +46,7 @@ T tmain() {
 int main() {
   static int sivar;
 #ifdef LAMBDA
-  // LAMBDA: [[G:@.+]] = global double
+  // LAMBDA: [[G:@.+]] = {{(dso_local )?}}global double
   // LAMBDA-LABEL: @main
   // LAMBDA: call{{.*}} void [[OUTER_LAMBDA:@.+]](
   [&]() {
@@ -86,7 +86,7 @@ int main() {
   }();
   return 0;
 #elif defined(BLOCKS)
-  // BLOCKS: [[G:@.+]] = global double
+  // BLOCKS: [[G:@.+]] = {{(dso_local )?}}global double
   // BLOCKS-LABEL: @main
   // BLOCKS: call {{.*}}void {{%.+}}(i8
   ^{

Modified: cfe/trunk/test/PCH/cxx-required-decls.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx-required-decls.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/PCH/cxx-required-decls.cpp (original)
+++ cfe/trunk/test/PCH/cxx-required-decls.cpp Fri Feb 23 11:30:48 2018
@@ -7,4 +7,4 @@
 
 // CHECK: @_ZL5globS = internal global %struct.S zeroinitializer
 // CHECK: @_ZL3bar = internal global i32 0, align 4
-// CHECK: @glob_var = global i32 0
+// CHECK: @glob_var = {{(dso_local )?}}global i32 0

Modified: cfe/trunk/test/PCH/pragma-weak.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/pragma-weak.c?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/PCH/pragma-weak.c (original)
+++ cfe/trunk/test/PCH/pragma-weak.c Fri Feb 23 11:30:48 2018
@@ -5,6 +5,6 @@
 // RUN: %clang_cc1 -x c-header -emit-pch -o %t %S/pragma-weak.h
 // RUN: not %clang_cc1 -include-pch %t %s -verify -emit-llvm -o - | FileCheck %s
 
-// CHECK: @weakvar = weak global i32 0
+// CHECK: @weakvar = weak {{(dso_local )?}}global i32 0
 int weakvar;
 // expected-warning {{weak identifier 'undeclaredvar' never declared}}

Modified: cfe/trunk/test/PCH/uses-seh.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/uses-seh.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/PCH/uses-seh.cpp (original)
+++ cfe/trunk/test/PCH/uses-seh.cpp Fri Feb 23 11:30:48 2018
@@ -19,7 +19,7 @@ inline int f() {
 }
 int x = f();
 
-// CHECK: define linkonce_odr i32 @"\01?f@@YAHXZ"()
+// CHECK: define linkonce_odr dso_local i32 @"\01?f@@YAHXZ"()
 // CHECK: define internal i32 @"\01?filt$0 at 0@f@@"({{.*}})
 
 #else

Modified: cfe/trunk/test/SemaCXX/typeid-ref.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/typeid-ref.cpp?rev=325940&r1=325939&r2=325940&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/typeid-ref.cpp (original)
+++ cfe/trunk/test/SemaCXX/typeid-ref.cpp Fri Feb 23 11:30:48 2018
@@ -6,7 +6,7 @@ namespace std {
 struct X { };
 
 void f() {
-  // CHECK: @_ZTS1X = linkonce_odr constant
-  // CHECK: @_ZTI1X = linkonce_odr constant 
+  // CHECK: @_ZTS1X = linkonce_odr {{(dso_local )?}}constant
+  // CHECK: @_ZTI1X = linkonce_odr {{(dso_local )?}}constant 
   (void)typeid(X&);
 }




More information about the cfe-commits mailing list