Index: clang/docs/ClangCommandLineReference.rst =================================================================== --- clang/docs/ClangCommandLineReference.rst +++ clang/docs/ClangCommandLineReference.rst @@ -1307,6 +1307,10 @@ .. option:: -fcommon, -fno-common +Place definitions of variables with no storage class and no initializer +(tentative definitions) in a common block, or generate individual +zero-initialized definitions (default -fno-common). + .. option:: -fcompile-resource=, --resource , --resource= .. option:: -fconstant-cfstrings, -fno-constant-cfstrings Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -84,6 +84,7 @@ Modified Compiler Flags ----------------------- +- -fno-common has been enabled as the default for all targets. New Pragmas in Clang -------------------- Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -848,7 +848,8 @@ Group; def : Flag<["-"], "frecord-gcc-switches">, Alias; def : Flag<["-"], "fno-record-gcc-switches">, Alias; -def fcommon : Flag<["-"], "fcommon">, Group; +def fcommon : Flag<["-"], "fcommon">, Group, + Flags<[CoreOption, CC1Option]>, HelpText<"Place uninitialized global variables in a common block">; def fcompile_resource_EQ : Joined<["-"], "fcompile-resource=">, Group; def fcomplete_member_pointers : Flag<["-"], "fcomplete-member-pointers">, Group, Flags<[CoreOption, CC1Option]>, Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -1408,20 +1408,6 @@ } } -static bool isNoCommonDefault(const llvm::Triple &Triple) { - switch (Triple.getArch()) { - default: - if (Triple.isOSFuchsia()) - return true; - return false; - - case llvm::Triple::xcore: - case llvm::Triple::wasm32: - case llvm::Triple::wasm64: - return true; - } -} - static bool hasMultipleInvocations(const llvm::Triple &Triple, const ArgList &Args) { // Supported only on Darwin where we invoke the compiler multiple times @@ -5675,11 +5661,9 @@ if (!Args.hasFlag(options::OPT_Qy, options::OPT_Qn, true)) CmdArgs.push_back("-Qn"); - // -fcommon is the default unless compiling kernel code or the target says so - bool NoCommonDefault = KernelOrKext || isNoCommonDefault(RawTriple); - if (!Args.hasFlag(options::OPT_fcommon, options::OPT_fno_common, - !NoCommonDefault)) - CmdArgs.push_back("-fno-common"); + // -fno-common is the default, set -fcommon only when that flag is set. + if (Args.hasFlag(options::OPT_fcommon, options::OPT_fno_common, false)) + CmdArgs.push_back("-fcommon"); // -fsigned-bitfields is default, and clang doesn't yet support // -funsigned-bitfields. Index: clang/lib/Frontend/CompilerInvocation.cpp =================================================================== --- clang/lib/Frontend/CompilerInvocation.cpp +++ clang/lib/Frontend/CompilerInvocation.cpp @@ -809,7 +809,7 @@ Opts.RecordCommandLine = std::string(Args.getLastArgValue(OPT_record_command_line)); Opts.MergeAllConstants = Args.hasArg(OPT_fmerge_all_constants); - Opts.NoCommon = Args.hasArg(OPT_fno_common); + Opts.NoCommon = !Args.hasArg(OPT_fcommon); Opts.NoInlineLineTables = Args.hasArg(OPT_gno_inline_line_tables); Opts.NoImplicitFloat = Args.hasArg(OPT_no_implicit_float); Opts.OptimizeSize = getOptimizationLevelSize(Args); Index: clang/test/CodeGen/2008-07-21-mixed-var-fn-decl.c =================================================================== --- clang/test/CodeGen/2008-07-21-mixed-var-fn-decl.c +++ clang/test/CodeGen/2008-07-21-mixed-var-fn-decl.c @@ -3,6 +3,6 @@ int g0, f0(); int f1(), g1; -// CHECK: @g0 = common {{(dso_local )?}}global i32 0, align 4 -// CHECK: @g1 = common {{(dso_local )?}}global i32 0, align 4 +// CHECK: @g0 = {{(dso_local )?}}global i32 0, align 4 +// CHECK: @g1 = {{(dso_local )?}}global i32 0, align 4 Index: clang/test/CodeGen/2009-10-20-GlobalDebug.c =================================================================== --- clang/test/CodeGen/2009-10-20-GlobalDebug.c +++ clang/test/CodeGen/2009-10-20-GlobalDebug.c @@ -2,10 +2,10 @@ // RUN: %clang -target i386-apple-darwin10 -flto -S -g %s -o - | FileCheck %s // CHECK: @main.localstatic = internal global i32 0, align 4, !dbg [[L:![0-9]+]] -// CHECK: @global = common global i32 0, align 4, !dbg [[G:![0-9]+]] +// CHECK: @global = global i32 0, align 4, !dbg [[G:![0-9]+]] int global; -int main() { +int main() { static int localstatic; return 0; } Index: clang/test/CodeGen/aarch64-sve.c =================================================================== --- clang/test/CodeGen/aarch64-sve.c +++ clang/test/CodeGen/aarch64-sve.c @@ -16,7 +16,7 @@ // CHECK-DEBUG: cannot yet generate debug info for SVE type '__SVFloat64_t' // CHECK-DEBUG: cannot yet generate debug info for SVE type '__SVBool_t' -// CHECK: @ptr = common global * null, align 8 +// CHECK: @ptr = global * null, align 8 // CHECK: %s8 = alloca , align 16 // CHECK: %s16 = alloca , align 16 // CHECK: %s32 = alloca , align 16 Index: clang/test/CodeGen/address-space.c =================================================================== --- clang/test/CodeGen/address-space.c +++ clang/test/CodeGen/address-space.c @@ -1,13 +1,13 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm < %s | FileCheck -enable-var-scope -check-prefixes=CHECK,X86 %s // RUN: %clang_cc1 -triple amdgcn -emit-llvm < %s | FileCheck -enable-var-scope -check-prefixes=CHECK,AMDGCN %s -// CHECK: @foo = common addrspace(1) global +// CHECK: @foo = addrspace(1) global int foo __attribute__((address_space(1))); -// CHECK: @ban = common addrspace(1) global +// CHECK: @ban = addrspace(1) global int ban[10] __attribute__((address_space(1))); -// CHECK: @a = common global +// CHECK: @a = global int a __attribute__((address_space(0))); // CHECK-LABEL: define i32 @test1() Index: clang/test/CodeGen/alias.c =================================================================== --- clang/test/CodeGen/alias.c +++ clang/test/CodeGen/alias.c @@ -5,8 +5,13 @@ // RUN: %clang_cc1 -triple aarch64-linux-gnu -emit-llvm -o - %s | FileCheck -check-prefix=CHECKGLOBALS %s int g0; -// CHECKBASIC-DAG: @g0 = common global i32 0 -// CHECKASM-DAG: .comm g0,4,4 +// CHECKBASIC-DAG: @g0 = global i32 0 +// CHECKASM-DAG: .bss +// CHECKASM-DAG: .globl g0 +// CHECKASM-DAG: .p2align 2 +// CHECKASM-DAG: g0: +// CHECKASM-DAG: .long 0 +// CHECKASM-DAG: .size g0, 4 __thread int TL_WITH_ALIAS; // CHECKBASIC-DAG: @TL_WITH_ALIAS = thread_local global i32 0, align 4 // CHECKASM-DAG: .globl TL_WITH_ALIAS Index: clang/test/CodeGen/align-systemz.c =================================================================== --- clang/test/CodeGen/align-systemz.c +++ clang/test/CodeGen/align-systemz.c @@ -7,10 +7,10 @@ }; char c; -// CHECK-DAG: @c = common global i8 0, align 2 +// CHECK-DAG: @c = global i8 0, align 2 struct test s; -// CHECK-DAG: @s = common global %struct.test zeroinitializer, align 2 +// CHECK-DAG: @s = global %struct.test zeroinitializer, align 2 extern char ec; // CHECK-DAG: @ec = external global i8, align 2 Index: clang/test/CodeGen/alignment.c =================================================================== --- clang/test/CodeGen/alignment.c +++ clang/test/CodeGen/alignment.c @@ -7,7 +7,7 @@ // CHECK: @b = {{.*}}zeroinitializer, align 16 long long int test5[1024]; -// CHECK-DAG: @test5 = common global [1024 x i64] zeroinitializer, align 8 +// CHECK-DAG: @test5 = global [1024 x i64] zeroinitializer, align 8 // PR5279 - Reduced alignment on typedef. typedef int myint __attribute__((aligned(1))); Index: clang/test/CodeGen/asm-label.c =================================================================== --- clang/test/CodeGen/asm-label.c +++ clang/test/CodeGen/asm-label.c @@ -11,9 +11,9 @@ } // LINUX: @bar = internal global i32 0 -// LINUX: @foo = common global i32 0 +// LINUX: @foo = global i32 0 // LINUX: declare i8* @alias(i32) // DARWIN: @"\01bar" = internal global i32 0 -// DARWIN: @"\01foo" = common global i32 0 +// DARWIN: @"\01foo" = global i32 0 // DARWIN: declare i8* @"\01alias"(i32) Index: clang/test/CodeGen/attr-weak-import.c =================================================================== --- clang/test/CodeGen/attr-weak-import.c +++ clang/test/CodeGen/attr-weak-import.c @@ -20,7 +20,7 @@ // CHECK: @A = global i32 // CHECK-NOT: @B = -// CHECK: @C = common global i32 +// CHECK: @C = global i32 // CHECK: @D = global i32 // CHECK: @E = global i32 Index: clang/test/CodeGen/attr-weakref2.c =================================================================== --- clang/test/CodeGen/attr-weakref2.c +++ clang/test/CodeGen/attr-weakref2.c @@ -8,7 +8,7 @@ return test1_g; } -// CHECK: @test2_f = common global i32 0, align 4 +// CHECK: @test2_f = global i32 0, align 4 int test2_f; static int test2_g __attribute__((weakref("test2_f"))); int test2_h(void) { @@ -25,7 +25,7 @@ return test3_g; } -// CHECK: @test4_f = common global i32 0, align 4 +// CHECK: @test4_f = global i32 0, align 4 extern int test4_f; static int test4_g __attribute__((weakref("test4_f"))); int test4_h(void) { Index: clang/test/CodeGen/attributes.c =================================================================== --- clang/test/CodeGen/attributes.c +++ clang/test/CodeGen/attributes.c @@ -20,7 +20,7 @@ // CHECK: @t16 = extern_weak global i32 extern int t16 __attribute__((weak_import)); -// CHECK: @t6 = common protected global i32 0 +// CHECK: @t6 = protected global i32 0 int t6 __attribute__((visibility("protected"))); // CHECK: @t12 = global i32 0, section "SECT" Index: clang/test/CodeGen/blocks-windows.c =================================================================== --- clang/test/CodeGen/blocks-windows.c +++ clang/test/CodeGen/blocks-windows.c @@ -68,7 +68,7 @@ } // CHECK-BLOCKS-IN-BLOCKS-DECL: @_NSConcreteStackBlock = external dso_local dllexport global i8* -// CHECK-BLOCKS-IN-BLOCKS-DEFN: @_NSConcreteStackBlock = common dso_local dllexport global [5 x i32] +// CHECK-BLOCKS-IN-BLOCKS-DEFN: @_NSConcreteStackBlock = 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* Index: clang/test/CodeGen/bool-convert.c =================================================================== --- clang/test/CodeGen/bool-convert.c +++ clang/test/CodeGen/bool-convert.c @@ -2,16 +2,16 @@ // All of these should uses the memory representation of _Bool // CHECK-LABEL: %struct.teststruct1 = type { i8, i8 } -// CHECK-LABEL: @test1 = common global %struct.teststruct1 +// CHECK-LABEL: @test1 = global %struct.teststruct1 struct teststruct1 {_Bool a, b;} test1; -// CHECK-LABEL: @test2 = common global i8* null +// CHECK-LABEL: @test2 = global i8* null _Bool* test2; -// CHECK-LABEL: @test3 = common global [10 x i8] +// CHECK-LABEL: @test3 = global [10 x i8] _Bool test3[10]; -// CHECK-LABEL: @test4 = common global [0 x i8]* null +// CHECK-LABEL: @test4 = global [0 x i8]* null _Bool (*test4)[]; // CHECK-LABEL: define void @f(i32 %x) Index: clang/test/CodeGen/c11atomics.c =================================================================== --- clang/test/CodeGen/c11atomics.c +++ clang/test/CodeGen/c11atomics.c @@ -25,7 +25,7 @@ // CHECK-DAG: %struct.elem = type { %struct.ptr } struct ptr object; -// CHECK-DAG: @object = common global %struct.ptr zeroinitializer +// CHECK-DAG: @object = global %struct.ptr zeroinitializer // CHECK-DAG: @testStructGlobal = global {{.*}} { i16 1, i16 2, i16 3, i16 4 } // CHECK-DAG: @testPromotedStructGlobal = global {{.*}} { %{{.*}} { i16 1, i16 2, i16 3 }, [2 x i8] zeroinitializer } Index: clang/test/CodeGen/cfstring-elf-cfbuild-x86_64.c =================================================================== --- clang/test/CodeGen/cfstring-elf-cfbuild-x86_64.c +++ clang/test/CodeGen/cfstring-elf-cfbuild-x86_64.c @@ -30,7 +30,7 @@ // CHECK-CF-IN-CF-DECL: @__CFConstantStringClassReference = external global [0 x i32] -// CHECK-CF-IN-CF-DEFN: @__CFConstantStringClassReference = common global [32 x i64] zeroinitializer, align 16 -// CHECK-CF: @__CFConstantStringClassReference = common global [1 x i64] zeroinitializer, align 8 +// CHECK-CF-IN-CF-DEFN: @__CFConstantStringClassReference = global [32 x i64] zeroinitializer, align 16 +// CHECK-CF: @__CFConstantStringClassReference = global [1 x i64] zeroinitializer, align 8 // CHECK-CF-EXTERN: @__CFConstantStringClassReference = external global [0 x i32] // CHECK-CF-EXTERN: @.str = private unnamed_addr constant [7 x i8] c"string\00", section ".rodata", align 1 Index: clang/test/CodeGen/cfstring-windows.c =================================================================== --- clang/test/CodeGen/cfstring-windows.c +++ clang/test/CodeGen/cfstring-windows.c @@ -32,7 +32,7 @@ const CFStringRef string = (CFStringRef)__builtin___CFStringMakeConstantString("string"); // CHECK-CF-IN-CF-DECL: @__CFConstantStringClassReference = external dso_local dllexport global [0 x i32] -// CHECK-CF-IN-CF-DEFN: @__CFConstantStringClassReference = common dso_local dllexport global [32 x i32] +// CHECK-CF-IN-CF-DEFN: @__CFConstantStringClassReference = 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] Index: clang/test/CodeGen/default-address-space.c =================================================================== --- clang/test/CodeGen/default-address-space.c +++ clang/test/CodeGen/default-address-space.c @@ -1,13 +1,13 @@ // RUN: %clang_cc1 -triple amdgcn---amdgiz -emit-llvm < %s | FileCheck -check-prefixes=CHECK,COM %s -// CHECK-DAG: @foo = common addrspace(1) global i32 0 +// CHECK-DAG: @foo = addrspace(1) global i32 0 int foo; -// CHECK-DAG: @ban = common addrspace(1) global [10 x i32] zeroinitializer +// CHECK-DAG: @ban = addrspace(1) global [10 x i32] zeroinitializer int ban[10]; -// CHECK-DAG: @A = common addrspace(1) global i32* null -// CHECK-DAG: @B = common addrspace(1) global i32* null +// CHECK-DAG: @A = addrspace(1) global i32* null +// CHECK-DAG: @B = addrspace(1) global i32* null int *A; int *B; Index: clang/test/CodeGen/dllexport-1.c =================================================================== --- clang/test/CodeGen/dllexport-1.c +++ clang/test/CodeGen/dllexport-1.c @@ -9,8 +9,8 @@ // CHECK-MSVC: @z = dso_local constant i32 4, align 4 // CHECK-LNX: @z = constant i32 4, align 4 -// CHECK-MSVC: @y = common dso_local dllexport global i32 0, align 4 -// CHECK-LNX: @y = common global i32 0, align 4 +// CHECK-MSVC: @y = dso_local dllexport constant i32 0, align 4 +// CHECK-LNX: @y = constant i32 0, align 4 __declspec(dllexport) int const x = 3; __declspec(dllexport) const int y; Index: clang/test/CodeGen/dllexport.c =================================================================== --- clang/test/CodeGen/dllexport.c +++ clang/test/CodeGen/dllexport.c @@ -14,7 +14,7 @@ __declspec(dllexport) extern int ExternGlobalDecl; // dllexport implies a definition. -// CHECK-DAG: @GlobalDef = common dso_local dllexport global i32 0, align 4 +// CHECK-DAG: @GlobalDef = dso_local dllexport global i32 0, align 4 __declspec(dllexport) int GlobalDef; // Export definition. @@ -27,11 +27,11 @@ int GlobalDeclInit = 1; // Redeclarations -// CHECK-DAG: @GlobalRedecl1 = common dso_local dllexport global i32 0, align 4 +// CHECK-DAG: @GlobalRedecl1 = dso_local dllexport global i32 0, align 4 __declspec(dllexport) extern int GlobalRedecl1; __declspec(dllexport) int GlobalRedecl1; -// CHECK-DAG: @GlobalRedecl2 = common dso_local dllexport global i32 0, align 4 +// CHECK-DAG: @GlobalRedecl2 = dso_local dllexport global i32 0, align 4 __declspec(dllexport) extern int GlobalRedecl2; int GlobalRedecl2; @@ -70,13 +70,13 @@ //===----------------------------------------------------------------------===// // dllexport takes precedence over the dllimport if both are specified. -// CHECK-DAG: @PrecedenceGlobal1A = common dso_local dllexport global i32 0, align 4 -// CHECK-DAG: @PrecedenceGlobal1B = common dso_local dllexport global i32 0, align 4 +// CHECK-DAG: @PrecedenceGlobal1A = dso_local dllexport global i32 0, align 4 +// CHECK-DAG: @PrecedenceGlobal1B = dso_local dllexport global i32 0, align 4 __attribute__((dllimport, dllexport)) int PrecedenceGlobal1A; __declspec(dllimport) __declspec(dllexport) int PrecedenceGlobal1B; -// CHECK-DAG: @PrecedenceGlobal2A = common dso_local dllexport global i32 0, align 4 -// CHECK-DAG: @PrecedenceGlobal2B = common dso_local dllexport global i32 0, align 4 +// CHECK-DAG: @PrecedenceGlobal2A = dso_local dllexport global i32 0, align 4 +// CHECK-DAG: @PrecedenceGlobal2B = dso_local dllexport global i32 0, align 4 __attribute__((dllexport, dllimport)) int PrecedenceGlobal2A; __declspec(dllexport) __declspec(dllimport) int PrecedenceGlobal2B; @@ -84,7 +84,7 @@ __declspec(dllexport) extern int PrecedenceGlobalRedecl1; __declspec(dllimport) int PrecedenceGlobalRedecl1 = 0; -// CHECK-DAG: @PrecedenceGlobalRedecl2 = common dso_local dllexport global i32 0, align 4 +// CHECK-DAG: @PrecedenceGlobalRedecl2 = dso_local dllexport global i32 0, align 4 __declspec(dllimport) extern int PrecedenceGlobalRedecl2; __declspec(dllexport) int PrecedenceGlobalRedecl2; @@ -92,7 +92,7 @@ __attribute__((dllexport)) extern int PrecedenceGlobalMixed1; __declspec(dllimport) int PrecedenceGlobalMixed1 = 1; -// CHECK-DAG: @PrecedenceGlobalMixed2 = common dso_local dllexport global i32 0, align 4 +// CHECK-DAG: @PrecedenceGlobalMixed2 = dso_local dllexport global i32 0, align 4 __attribute__((dllimport)) extern int PrecedenceGlobalMixed2; __declspec(dllexport) int PrecedenceGlobalMixed2; Index: clang/test/CodeGen/dllimport.c =================================================================== --- clang/test/CodeGen/dllimport.c +++ clang/test/CodeGen/dllimport.c @@ -46,8 +46,8 @@ USEVAR(GlobalRedecl3) // Make sure this works even if the decl has been used before it's defined (PR20792). -// MS: @GlobalRedecl4 = common dso_local dllexport global i32 -// GNU: @GlobalRedecl4 = common dso_local global i32 +// MS: @GlobalRedecl4 = dso_local dllexport global i32 +// GNU: @GlobalRedecl4 = dso_local global i32 __declspec(dllimport) extern int GlobalRedecl4; USEVAR(GlobalRedecl4) int GlobalRedecl4; // dllimport ignored Index: clang/test/CodeGen/microsoft-no-common-align.c =================================================================== --- clang/test/CodeGen/microsoft-no-common-align.c +++ clang/test/CodeGen/microsoft-no-common-align.c @@ -5,7 +5,7 @@ TooLargeAlignment TooBig; // CHECK: @TooBig = dso_local global <16 x float> zeroinitializer, align 64 NormalAlignment JustRight; -// CHECK: @JustRight = common dso_local global <1 x float> zeroinitializer, align 4 +// CHECK: @JustRight = dso_local global <1 x float> zeroinitializer, align 4 TooLargeAlignment *IsAPointer; -// CHECK: @IsAPointer = common dso_local global <16 x float>* null, align 8 +// CHECK: @IsAPointer = dso_local global <16 x float>* null, align 8 Index: clang/test/CodeGen/no-common.c =================================================================== --- clang/test/CodeGen/no-common.c +++ clang/test/CodeGen/no-common.c @@ -1,15 +1,16 @@ // 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 +// RUN: %clang_cc1 %s -fno-common -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-DEFAULT +// RUN: %clang_cc1 %s -fcommon -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-COMMON -// CHECK-DEFAULT: @x = common {{(dso_local )?}}global -// CHECK-NOCOMMON: @x = {{(dso_local )?}}global +// CHECK-COMMON: @x = common {{(dso_local )?}}global +// CHECK-DEFAULT: @x = {{(dso_local )?}}global int x; +// CHECK-COMMON: @ABC = {{(dso_local )?}}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-COMMON: @y = common {{(dso_local )?}}global // CHECK-DEFAULT: @y = common {{(dso_local )?}}global -// CHECK-NOCOMMON: @y = common {{(dso_local )?}}global int y __attribute__((common)); Index: clang/test/CodeGen/pr25786.c =================================================================== --- clang/test/CodeGen/pr25786.c +++ clang/test/CodeGen/pr25786.c @@ -4,8 +4,8 @@ void (__attribute__((regparm(3), stdcall)) *pf) (); void (__attribute__((regparm(2), stdcall)) foo)(int a) { } -// CHECK: @pf = common global void (...)* null +// CHECK: @pf = global void (...)* null // CHECK: define void @foo(i32 %a) -// CHECK-OK: @pf = common global void (...)* null +// CHECK-OK: @pf = global void (...)* null // CHECK-OK: define x86_stdcallcc void @foo(i32 inreg %a) Index: clang/test/CodeGen/pragma-pack-1.c =================================================================== --- clang/test/CodeGen/pragma-pack-1.c +++ clang/test/CodeGen/pragma-pack-1.c @@ -64,5 +64,5 @@ // CHECK: %struct.S4 = type { [3 x i8], %struct.T4, i32 } // CHECK: %struct.T4 = type <{ i8, i32 }> -// CHECK: @refs = common global [[struct_ref]] -// CHECK: @ss = common global [[struct_S]] +// CHECK: @refs = global [[struct_ref]] +// CHECK: @ss = global [[struct_S]] Index: clang/test/CodeGen/pragma-weak.c =================================================================== --- clang/test/CodeGen/pragma-weak.c +++ clang/test/CodeGen/pragma-weak.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm %s -o - -verify | FileCheck %s // CHECK: @weakvar = weak global -// CHECK: @__weakvar_alias = common global +// CHECK: @__weakvar_alias = global // CHECK: @correct_linkage = weak global Index: clang/test/CodeGen/private-extern-redef.c =================================================================== --- clang/test/CodeGen/private-extern-redef.c +++ clang/test/CodeGen/private-extern-redef.c @@ -34,6 +34,6 @@ // CHECK: @M = hidden global // CHECK: @O = hidden global // CHECK: @I = external hidden -// CHECK: @N = common hidden global +// CHECK: @N = hidden global // CHECK-NOT: @P Index: clang/test/CodeGen/tentative-decls.c =================================================================== --- clang/test/CodeGen/tentative-decls.c +++ clang/test/CodeGen/tentative-decls.c @@ -1,16 +1,16 @@ // RUN: %clang_cc1 -emit-llvm -w -o - %s | FileCheck %s -// CHECK-DAG: @r = common {{(dso_local )?}}global [1 x {{.*}}] zeroinitializer +// CHECK-DAG: @r = {{(dso_local )?}}global [1 x {{.*}}] zeroinitializer int r[]; int (*a)[] = &r; struct s0; struct s0 x; -// CHECK-DAG: @x = common {{(dso_local )?}}global %struct.s0 zeroinitializer +// CHECK-DAG: @x = {{(dso_local )?}}global %struct.s0 zeroinitializer struct s0 y; -// CHECK-DAG: @y = common {{(dso_local )?}}global %struct.s0 zeroinitializer +// CHECK-DAG: @y = {{(dso_local )?}}global %struct.s0 zeroinitializer struct s0 *f0() { return &y; } @@ -19,14 +19,14 @@ int x; }; -// CHECK-DAG: @b = common {{(dso_local )?}}global [1 x {{.*}}] zeroinitializer +// CHECK-DAG: @b = {{(dso_local )?}}global [1 x {{.*}}] zeroinitializer int b[]; int *f1() { return b; } // Check that the most recent tentative definition wins. -// CHECK-DAG: @c = common {{(dso_local )?}}global [4 x {{.*}}] zeroinitializer +// CHECK-DAG: @c = {{(dso_local )?}}global [4 x {{.*}}] zeroinitializer int c[]; int c[4]; Index: clang/test/CodeGen/tls-model.c =================================================================== --- clang/test/CodeGen/tls-model.c +++ clang/test/CodeGen/tls-model.c @@ -21,24 +21,24 @@ // CHECK-GD: @z1 = global i32 0 // CHECK-GD: @f.y = internal thread_local global i32 0 -// CHECK-GD: @z2 = common global i32 0 +// CHECK-GD: @z2 = global i32 0 // CHECK-GD: @x = thread_local global i32 0 // CHECK-GD: @z = thread_local(initialexec) global i32 0 // CHECK-LD: @z1 = global i32 0 // CHECK-LD: @f.y = internal thread_local(localdynamic) global i32 0 -// CHECK-LD: @z2 = common global i32 0 +// CHECK-LD: @z2 = global i32 0 // CHECK-LD: @x = thread_local(localdynamic) global i32 0 // CHECK-LD: @z = thread_local(initialexec) global i32 0 // CHECK-IE: @z1 = global i32 0 // CHECK-IE: @f.y = internal thread_local(initialexec) global i32 0 -// CHECK-IE: @z2 = common global i32 0 +// CHECK-IE: @z2 = global i32 0 // CHECK-IE: @x = thread_local(initialexec) global i32 0 // CHECK-IE: @z = thread_local(initialexec) global i32 0 // CHECK-LE: @z1 = global i32 0 // CHECK-LE: @f.y = internal thread_local(localexec) global i32 0 -// CHECK-LE: @z2 = common global i32 0 +// CHECK-LE: @z2 = global i32 0 // CHECK-LE: @x = thread_local(localexec) global i32 0 // CHECK-LE: @z = thread_local(initialexec) global i32 0 Index: clang/test/CodeGen/visibility.c =================================================================== --- clang/test/CodeGen/visibility.c +++ clang/test/CodeGen/visibility.c @@ -3,15 +3,15 @@ // RUN: %clang_cc1 %s -triple i386-unknown-unknown -fvisibility hidden -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-HIDDEN // CHECK-DEFAULT: @g_def = global i32 0 -// CHECK-DEFAULT: @g_com = common global i32 0 +// CHECK-DEFAULT: @g_com = global i32 0 // CHECK-DEFAULT: @g_ext = external global i32 // CHECK-DEFAULT: @g_deferred = internal global // CHECK-PROTECTED: @g_def = protected global i32 0 -// CHECK-PROTECTED: @g_com = common protected global i32 0 +// CHECK-PROTECTED: @g_com = protected global i32 0 // CHECK-PROTECTED: @g_ext = external global i32 // CHECK-PROTECTED: @g_deferred = internal global // CHECK-HIDDEN: @g_def = hidden global i32 0 -// CHECK-HIDDEN: @g_com = common hidden global i32 0 +// CHECK-HIDDEN: @g_com = hidden global i32 0 // CHECK-HIDDEN: @g_ext = external global i32 // CHECK-HIDDEN: @g_deferred = internal global int g_com; Index: clang/test/CodeGen/vlt_to_pointer.c =================================================================== --- clang/test/CodeGen/vlt_to_pointer.c +++ clang/test/CodeGen/vlt_to_pointer.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s int c[1][3*2]; -// CHECK: @{{.+}} = {{.*}} global [1 x [6 x {{i[0-9]+}}]] zeroinitializer +// CHECK: @{{.+}} = global [1 x [6 x {{i[0-9]+}}]] zeroinitializer // CHECK-LABEL: @f int f(int * const m, int (**v)[*m * 2]) Index: clang/test/CodeGen/volatile-1.c =================================================================== --- clang/test/CodeGen/volatile-1.c +++ clang/test/CodeGen/volatile-1.c @@ -1,10 +1,10 @@ // RUN: %clang_cc1 -Wno-return-type -Wno-unused-value -emit-llvm %s -w -o - | FileCheck %s -// CHECK: @i = common {{(dso_local )?}}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 = common {{(dso_local )?}}global [[CINT:.*]] zeroinitializer +// CHECK: @ci = {{(dso_local )?}}global [[CINT:.*]] zeroinitializer volatile _Complex int ci; volatile struct S { #ifdef __cplusplus Index: clang/test/CodeGen/weak-global.c =================================================================== --- clang/test/CodeGen/weak-global.c +++ /dev/null @@ -1,3 +0,0 @@ -// RUN: %clang_cc1 -emit-llvm < %s | grep common - -int i; Index: clang/test/CodeGen/windows-on-arm-dllimport-dllexport.c =================================================================== --- clang/test/CodeGen/windows-on-arm-dllimport-dllexport.c +++ clang/test/CodeGen/windows-on-arm-dllimport-dllexport.c @@ -17,7 +17,7 @@ } // CHECK: @import_int = external dllimport global i32 -// CHECK: @export_int = common dso_local dllexport global i32 0, align 4 +// CHECK: @export_int = dso_local dllexport global i32 0, align 4 // CHECK: define dso_local dllexport arm_aapcs_vfpcc void @export_implemented_function() Index: clang/test/CodeGenCXX/clang-sections-tentative.c =================================================================== --- clang/test/CodeGenCXX/clang-sections-tentative.c +++ clang/test/CodeGenCXX/clang-sections-tentative.c @@ -30,7 +30,7 @@ // CHECK: @x = global i32 0, align 4 #0 // CHECK: @y = global i32 0, align 4 #1 -// CHECK: @z = common global i32 0, align 4 +// CHECK: @z = global i32 0, align 4 // CHECK: @cx = constant i32 0, align 4 #2 // CHECK: @cy = constant i32 0, align 4 #3 // CHECK: @cz = constant i32 0, align 4 #1 Index: clang/test/CodeGenObjC/constant-string-class.m =================================================================== --- clang/test/CodeGenObjC/constant-string-class.m +++ clang/test/CodeGenObjC/constant-string-class.m @@ -30,6 +30,6 @@ return 0; } -// CHECK-FRAGILE: @_FooClassReference = common global +// CHECK-FRAGILE: @_FooClassReference = global // CHECK-NONFRAGILE: @"OBJC_CLASS_$_Object" = external global // CHECK-NONFRAGILE: "OBJC_CLASS_$_Foo" = global Index: clang/test/CodeGenObjC/tentative-cfconstantstring.m =================================================================== --- clang/test/CodeGenObjC/tentative-cfconstantstring.m +++ clang/test/CodeGenObjC/tentative-cfconstantstring.m @@ -31,7 +31,7 @@ } @end -// CHECK: @__CFConstantStringClassReference = common global [24 x i32] zeroinitializer, align 16 +// CHECK: @__CFConstantStringClassReference = global [24 x i32] zeroinitializer, align 16 // CHECK: @_unnamed_cfstring_{{.*}} = private global %struct.__NSConstantString_tag { i32* getelementptr inbounds ([24 x i32], [24 x i32]* @__CFConstantStringClassReference, i32 0, i32 0) // CHECK-LABEL: define internal void @_inlineFunction() Index: clang/test/CodeGenOpenCL/address-spaces.cl =================================================================== --- clang/test/CodeGenOpenCL/address-spaces.cl +++ clang/test/CodeGenOpenCL/address-spaces.cl @@ -53,10 +53,10 @@ #ifdef CL20 int i; -// CL20-DAG: @i = common {{(dso_local )?}}addrspace(1) global i32 0 +// CL20-DAG: @i = {{(dso_local )?}}addrspace(1) global i32 0 int *ptr; // CL20SPIR-DAG: @ptr = {{(common )?}}{{(dso_local )?}}addrspace(1) global i32 addrspace(4)* null -// CL20AMDGCN-DAG: @ptr = common {{(dso_local )?}}addrspace(1) global i32* null +// CL20AMDGCN-DAG: @ptr = {{(dso_local )?}}addrspace(1) global i32* null #endif // SPIR: i32* %arg Index: clang/test/CodeGenOpenCL/amdgpu-nullptr.cl =================================================================== --- clang/test/CodeGenOpenCL/amdgpu-nullptr.cl +++ clang/test/CodeGenOpenCL/amdgpu-nullptr.cl @@ -16,9 +16,6 @@ generic char *p5; } StructTy2; -// LLVM requests global variable with common linkage to be initialized with zeroinitializer, therefore use -fno-common -// to suppress common linkage for tentative definition. - // Test 0 as initializer. // CHECK: @private_p = local_unnamed_addr addrspace(1) global i8 addrspace(5)* null, align 4 @@ -183,34 +180,34 @@ // cannot have common linkage since common linkage requires zero initialization // and does not have explicit section. -// CHECK: @p1 = common local_unnamed_addr addrspace(1) global i8 addrspace(5)* null, align 4 +// CHECK: @p1 = local_unnamed_addr addrspace(1) global i8 addrspace(5)* null, align 4 private char *p1; -// CHECK: @p2 = weak local_unnamed_addr addrspace(1) global i8 addrspace(3)* addrspacecast (i8* null to i8 addrspace(3)*), align 4 +// CHECK: @p2 = local_unnamed_addr addrspace(1) global i8 addrspace(3)* addrspacecast (i8* null to i8 addrspace(3)*), align 4 local char *p2; -// CHECK: @p3 = common local_unnamed_addr addrspace(1) global i8 addrspace(4)* null, align 8 +// CHECK: @p3 = local_unnamed_addr addrspace(1) global i8 addrspace(4)* null, align 8 constant char *p3; -// CHECK: @p4 = common local_unnamed_addr addrspace(1) global i8 addrspace(1)* null, align 8 +// CHECK: @p4 = local_unnamed_addr addrspace(1) global i8 addrspace(1)* null, align 8 global char *p4; -// CHECK: @p5 = common local_unnamed_addr addrspace(1) global i8* null, align 8 +// CHECK: @p5 = local_unnamed_addr addrspace(1) global i8* null, align 8 generic char *p5; // Test default initialization of structure. -// CHECK: @S1 = weak local_unnamed_addr addrspace(1) global %struct.StructTy1 { i8 addrspace(5)* null, i8 addrspace(3)* addrspacecast (i8* null to i8 addrspace(3)*), i8 addrspace(4)* null, i8 addrspace(1)* null, i8* null }, align 8 +// CHECK: @S1 = local_unnamed_addr addrspace(1) global %struct.StructTy1 { i8 addrspace(5)* null, i8 addrspace(3)* addrspacecast (i8* null to i8 addrspace(3)*), i8 addrspace(4)* null, i8 addrspace(1)* null, i8* null }, align 8 StructTy1 S1; -// CHECK: @S2 = common local_unnamed_addr addrspace(1) global %struct.StructTy2 zeroinitializer, align 8 +// CHECK: @S2 = local_unnamed_addr addrspace(1) global %struct.StructTy2 zeroinitializer, align 8 StructTy2 S2; // Test default initialization of array. -// CHECK: @A1 = weak local_unnamed_addr addrspace(1) global [2 x %struct.StructTy1] [%struct.StructTy1 { i8 addrspace(5)* null, i8 addrspace(3)* addrspacecast (i8* null to i8 addrspace(3)*), i8 addrspace(4)* null, i8 addrspace(1)* null, i8* null }, %struct.StructTy1 { i8 addrspace(5)* null, i8 addrspace(3)* addrspacecast (i8* null to i8 addrspace(3)*), i8 addrspace(4)* null, i8 addrspace(1)* null, i8* null }], align 8 +// CHECK: @A1 = local_unnamed_addr addrspace(1) global [2 x %struct.StructTy1] [%struct.StructTy1 { i8 addrspace(5)* null, i8 addrspace(3)* addrspacecast (i8* null to i8 addrspace(3)*), i8 addrspace(4)* null, i8 addrspace(1)* null, i8* null }, %struct.StructTy1 { i8 addrspace(5)* null, i8 addrspace(3)* addrspacecast (i8* null to i8 addrspace(3)*), i8 addrspace(4)* null, i8 addrspace(1)* null, i8* null }], align 8 StructTy1 A1[2]; -// CHECK: @A2 = common local_unnamed_addr addrspace(1) global [2 x %struct.StructTy2] zeroinitializer, align 8 +// CHECK: @A2 = local_unnamed_addr addrspace(1) global [2 x %struct.StructTy2] zeroinitializer, align 8 StructTy2 A2[2]; // Test comparison with 0. Index: clang/test/Driver/apple-kext-mkernel.c =================================================================== --- clang/test/Driver/apple-kext-mkernel.c +++ clang/test/Driver/apple-kext-mkernel.c @@ -4,7 +4,6 @@ // CHECK-X86: "-disable-red-zone" // CHECK-X86: "-fno-builtin" // CHECK-X86: "-fno-rtti" -// CHECK-X86: "-fno-common" // RUN: %clang -target x86_64-apple-darwin10 -mkernel -### -fsyntax-only -fbuiltin -fcommon %s 2>&1 | FileCheck --check-prefix=CHECK-X86-2 %s @@ -21,7 +20,6 @@ // CHECK-ARM-NOT: "-target-feature" "+strict-align" // CHECK-ARM: "-fno-builtin" // CHECK-ARM: "-fno-rtti" -// CHECK-ARM: "-fno-common" // RUN: %clang -target x86_64-apple-darwin10 \ // RUN: -Werror -fno-builtin -fno-exceptions -fno-common -fno-rtti \ Index: clang/test/Driver/clang_f_opts.c =================================================================== --- clang/test/Driver/clang_f_opts.c +++ clang/test/Driver/clang_f_opts.c @@ -12,7 +12,6 @@ // CHECK-OPTIONS2: -fno-gnu-keywords // CHECK-OPTIONS2: -fno-builtin // CHECK-OPTIONS2: -fshort-enums -// CHECK-OPTIONS2: -fno-common // CHECK-OPTIONS2: -fno-show-source-location // RUN: %clang -### -S -Wwrite-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS1 %s Index: clang/test/Driver/fuchsia.c =================================================================== --- clang/test/Driver/fuchsia.c +++ clang/test/Driver/fuchsia.c @@ -22,7 +22,6 @@ // CHECK-AARCH64: "-fsanitize=shadow-call-stack" // CHECK-X86_64: "-fsanitize=safe-stack" // CHECK: "-stack-protector" "2" -// CHECK: "-fno-common" // CHECK: {{.*}}ld.lld{{.*}}" "-z" "now" "-z" "rodynamic" "-z" "separate-loadable-segments" // CHECK: "--sysroot=[[SYSROOT]]" // CHECK: "-pie" Index: clang/test/Driver/no-common.c =================================================================== --- /dev/null +++ clang/test/Driver/no-common.c @@ -0,0 +1,9 @@ +// RUN: %clang -target %itanium_abi_triple -### -c %s 2>&1 | \ +// RUN: FileCheck %s --check-prefix=DEFAULT +// RUN: %clang -target %itanium_abi_triple -fno-common -### -c %s 2>&1 | \ +// RUN: FileCheck %s --check-prefix=DEFAULT +// RUN: %clang -target %itanium_abi_triple -fno-common -fcommon -### -c %s 2>&1 | \ +// RUN: FileCheck %s --check-prefix=COMMON + +// DEFAULT-NOT: "-fcommon" +// COMMON: "-fcommon" Index: clang/test/Driver/xcore-opts.c =================================================================== --- clang/test/Driver/xcore-opts.c +++ clang/test/Driver/xcore-opts.c @@ -9,7 +9,6 @@ // CHECK: "-fno-use-cxa-atexit" // CHECK-NOT: "-fcxx-exceptions" // CHECK-NOT: "-fexceptions" -// CHECK: "-fno-common" // CHECK: xcc" "-o" // CHECK-NOT: "-fexceptions" // CHECK: "-c" "-v" "-g" "-fverbose-asm" "A1Arg" "A2Arg" @@ -21,7 +20,6 @@ // CHECK-EXCEP: "-fno-use-cxa-atexit" // CHECK-EXCEP: "-fcxx-exceptions" // CHECK-EXCEP: "-fexceptions" -// CHECK-EXCEP: "-fno-common" // CHECK-EXCEP: xcc" "-o" // CHECK-EXCEP-NOT: "-fexceptions" // CHECK-EXCEP: xcc" "-o" Index: clang/test/Frontend/ast-codegen.c =================================================================== --- clang/test/Frontend/ast-codegen.c +++ clang/test/Frontend/ast-codegen.c @@ -5,7 +5,7 @@ // CHECK: module asm "foo" __asm__("foo"); -// CHECK: @g0 = common dso_local global i32 0, align 4 +// CHECK: @g0 = dso_local global i32 0, align 4 int g0; // CHECK: define dso_local i32 @f0() Index: clang/test/Headers/xmmintrin.c =================================================================== --- clang/test/Headers/xmmintrin.c +++ clang/test/Headers/xmmintrin.c @@ -7,7 +7,7 @@ // REQUIRES: x86-registered-target #include -// CHECK: @c = common global i8 0, align 16 +// CHECK: @c = global i8 0, align 16 _MM_ALIGN16 char c; // Make sure the last step of _mm_cvtps_pi16 converts <4 x i32> to <4 x i16> by Index: clang/test/PCH/chain-external-defs.c =================================================================== --- clang/test/PCH/chain-external-defs.c +++ clang/test/PCH/chain-external-defs.c @@ -16,11 +16,11 @@ // Z-NOT: @z -// XA: @x = common global i32 0 -// XA-NOT: @x = common global i32 0 +// XA: @x = global i32 0 +// XA-NOT: @x = global i32 0 -// YA: @y = common global i32 0 -// YA-NOT: @y = common global i32 0 +// YA: @y = global i32 0 +// YA-NOT: @y = global i32 0 // XB: @x2 = global i32 19 // XB-NOT: @x2 = global i32 19 @@ -29,17 +29,17 @@ // YB-NOT: @y2 = global i32 18 int y2 = 18; -// AA: @incomplete_array = common global [1 x i32] -// AA-NOT: @incomplete_array = common global [1 x i32] -// AB: @incomplete_array2 = common global [17 x i32] -// AB-NOT: @incomplete_array2 = common global [17 x i32] +// AA: @incomplete_array = global [1 x i32] +// AA-NOT: @incomplete_array = global [1 x i32] +// AB: @incomplete_array2 = global [17 x i32] +// AB-NOT: @incomplete_array2 = global [17 x i32] int incomplete_array2[17]; -// AC: @incomplete_array3 = common global [1 x i32] -// AC-NOT: @incomplete_array3 = common global [1 x i32] +// AC: @incomplete_array3 = global [1 x i32] +// AC-NOT: @incomplete_array3 = global [1 x i32] int incomplete_array3[]; -// S: @s = common global %struct.S -// S-NOT: @s = common global %struct.S +// S: @s = global %struct.S +// S-NOT: @s = global %struct.S struct S { int x, y; }; Index: clang/test/PCH/external-defs.c =================================================================== --- clang/test/PCH/external-defs.c +++ clang/test/PCH/external-defs.c @@ -3,16 +3,16 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/external-defs.h // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -include-pch %t.pch -emit-llvm -o %t %s -// RUN: grep "@x = common global i32 0" %t | count 1 +// RUN: grep "@x = global i32 0" %t | count 1 // RUN: not grep "@z" %t // RUN: grep "@x2 = global i32 19" %t | count 1 int x2 = 19; -// RUN: grep "@incomplete_array = common global .*1 x i32" %t | count 1 -// RUN: grep "@incomplete_array2 = common global .*17 x i32" %t | count 1 +// RUN: grep "@incomplete_array = global .*1 x i32" %t | count 1 +// RUN: grep "@incomplete_array2 = global .*17 x i32" %t | count 1 int incomplete_array2[17]; -// RUN: grep "@incomplete_array3 = common global .*1 x i32" %t | count 1 +// RUN: grep "@incomplete_array3 = global .*1 x i32" %t | count 1 int incomplete_array3[]; struct S { Index: clang/test/PCH/tentative-defs.c =================================================================== --- clang/test/PCH/tentative-defs.c +++ clang/test/PCH/tentative-defs.c @@ -1,6 +1,6 @@ // Test with pch. -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/tentative-defs.h -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -include-pch %t.pch -verify -emit-llvm -o %t %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fcommon -emit-pch -o %t.pch %S/tentative-defs.h +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fcommon -include-pch %t.pch -verify -emit-llvm -o %t %s // REQUIRES: x86-registered-target // RUN: grep "@variable = common global i32 0" %t | count 1 Index: clang/test/Parser/pragma-visibility2.c =================================================================== --- clang/test/Parser/pragma-visibility2.c +++ clang/test/Parser/pragma-visibility2.c @@ -6,14 +6,14 @@ #pragma GCC visibility push(hidden) int v1; -// CHECK: @v1 = common hidden global i32 0, align 4 +// CHECK: @v1 = hidden global i32 0, align 4 #pragma GCC visibility pop int v2; -// CHECK: @v2 = common global i32 0, align 4 +// CHECK: @v2 = global i32 0, align 4 _Pragma("GCC visibility push(hidden)"); int v3; -// CHECK: @v3 = common hidden global i32 0, align 4 +// CHECK: @v3 = hidden global i32 0, align 4