Index: lib/CodeGen/ItaniumCXXABI.cpp =================================================================== --- lib/CodeGen/ItaniumCXXABI.cpp +++ lib/CodeGen/ItaniumCXXABI.cpp @@ -1695,7 +1695,8 @@ // The ABI says: It is suggested that it be emitted in the same COMDAT group // as the associated data object - if (!D.isLocalVarDecl() && var->isWeakForLinker() && CGM.supportsCOMDAT()) { + if (!UseARMGuardVarABI && !D.isLocalVarDecl() && var->isWeakForLinker() + && CGM.supportsCOMDAT()) { llvm::Comdat *C = CGM.getModule().getOrInsertComdat(var->getName()); guard->setComdat(C); var->setComdat(C); Index: test/CodeGenCXX/static-data-member.cpp =================================================================== --- test/CodeGenCXX/static-data-member.cpp +++ test/CodeGenCXX/static-data-member.cpp @@ -1,6 +1,8 @@ // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -o - %s | FileCheck %s // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | \ // RUN: FileCheck --check-prefix=MACHO %s +// RUN: %clang_cc1 -triple arm-apple-darwin -emit-llvm -o - %s | \ +// RUN: FileCheck --check-prefix=ARM %s // CHECK: @_ZN5test11A1aE = constant i32 10, align 4 // CHECK: @_ZN5test212_GLOBAL__N_11AIiE1xE = internal global i32 0, align 4 @@ -8,6 +10,7 @@ // CHECK: @_ZGVN5test31AIiE1xE = weak_odr global i64 0, comdat $_ZN5test31AIiE1xE // MACHO: @_ZGVN5test31AIiE1xE = weak_odr global i64 0 // MACHO-NOT: comdat +// ARM-NOT: comdat // CHECK: _ZN5test51U2k0E = global i32 0 // CHECK: _ZN5test51U2k1E = global i32 0