Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Revert "Start setting dso_local for COFF."
Browse files Browse the repository at this point in the history
This reverts commit r325915.

It will take some time to fix the failures on a windows host.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325929 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
espindola committed Feb 23, 2018
1 parent c853ce6 commit 5626325
Show file tree
Hide file tree
Showing 147 changed files with 1,788 additions and 1,838 deletions.
3 changes: 1 addition & 2 deletions lib/CodeGen/CGDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ llvm::Constant *CodeGenModule::getOrCreateStaticVarDecl(
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()));
Expand All @@ -254,8 +255,6 @@ llvm::Constant *CodeGenModule::getOrCreateStaticVarDecl(
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;
Expand Down
14 changes: 1 addition & 13 deletions lib/CodeGen/CodeGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,20 +713,8 @@ void CodeGenModule::setGlobalVisibility(llvm::GlobalValue *GV,

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();
// 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.
// Only handle ELF for now.
if (!TT.isOSBinFormatELF())
return false;

Expand Down
3 changes: 0 additions & 3 deletions lib/CodeGen/CodeGenModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,6 @@ class CodeGenModule : public CodeGenTypeCache {

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
Expand Down
3 changes: 1 addition & 2 deletions lib/CodeGen/ItaniumCXXABI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1641,14 +1641,13 @@ llvm::GlobalVariable *ItaniumCXXABI::getAddrOfVTable(const CXXRecordDecl *RD,
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;
}

Expand Down
2 changes: 1 addition & 1 deletion test/CodeGen/aarch64-varargs-ms.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <stdarg.h>

int simple_int(va_list ap) {
// CHECK-LABEL: define dso_local i32 @simple_int
// CHECK-LABEL: define 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]]
Expand Down
8 changes: 4 additions & 4 deletions test/CodeGen/attr-x86-interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ __attribute__((interrupt)) void foo8(int *a) {}
// 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 dso_local x86_intrcc void @foo7(i32* %{{.+}}, i64 %{{.+}})
// X86_64_WIN: define dso_local x86_intrcc void @foo8(i32* %{{.+}})
// X86_64_WIN: define x86_intrcc void @foo7(i32* %{{.+}}, i64 %{{.+}})
// X86_64_WIN: define 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 dso_local x86_intrcc void @foo7(i32* %{{.+}}, i32 %{{.+}})
// X86_WIN: define dso_local x86_intrcc void @foo8(i32* %{{.+}})
// X86_WIN: define x86_intrcc void @foo7(i32* %{{.+}}, i32 %{{.+}})
// X86_WIN: define x86_intrcc void @foo8(i32* %{{.+}})
// X86_Win: "disable-tail-calls"="true"
// X86_Win-NOT: "disable-tail-calls"="false"
2 changes: 1 addition & 1 deletion test/CodeGen/blocks-windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 dso_local dllexport global [5 x i32]
// CHECK-BLOCKS-IN-BLOCKS-DEFN: @_NSConcreteStackBlock = common 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*
Expand Down
4 changes: 2 additions & 2 deletions test/CodeGen/builtins-ms.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// RUN: %clang_cc1 %s -emit-llvm -o - -fms-extensions -triple i686-pc-win32 | FileCheck %s

// CHECK-LABEL: define dso_local void @test_alloca(
// CHECK-LABEL: define void @test_alloca(
void capture(void *);
void test_alloca(int n) {
capture(_alloca(n));
// CHECK: %[[arg:.*]] = alloca i8, i32 %{{.*}}, align 16
// CHECK: call void @capture(i8* %[[arg]])
}

// CHECK-LABEL: define dso_local void @test_alloca_with_align(
// CHECK-LABEL: define 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
Expand Down
18 changes: 9 additions & 9 deletions test/CodeGen/builtins-overflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {{(dso_local )?}}i32 @test_add_overflow_uint_uint_uint
// CHECK-LABEL: define 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
Expand All @@ -28,7 +28,7 @@ unsigned test_add_overflow_uint_uint_uint(unsigned x, unsigned y) {
}

int test_add_overflow_int_int_int(int x, int y) {
// CHECK-LABEL: define {{(dso_local )?}}i32 @test_add_overflow_int_int_int
// CHECK-LABEL: define 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
Expand All @@ -42,7 +42,7 @@ int test_add_overflow_int_int_int(int x, int y) {
}

unsigned test_sub_overflow_uint_uint_uint(unsigned x, unsigned y) {
// CHECK-LABEL: define {{(dso_local )?}}i32 @test_sub_overflow_uint_uint_uint
// CHECK-LABEL: define 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
Expand All @@ -56,7 +56,7 @@ unsigned test_sub_overflow_uint_uint_uint(unsigned x, unsigned y) {
}

int test_sub_overflow_int_int_int(int x, int y) {
// CHECK-LABEL: define {{(dso_local )?}}i32 @test_sub_overflow_int_int_int
// CHECK-LABEL: define 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
Expand All @@ -70,7 +70,7 @@ int test_sub_overflow_int_int_int(int x, int y) {
}

unsigned test_mul_overflow_uint_uint_uint(unsigned x, unsigned y) {
// CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_uint_uint_uint
// CHECK-LABEL: define 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
Expand All @@ -84,7 +84,7 @@ unsigned test_mul_overflow_uint_uint_uint(unsigned x, unsigned y) {
}

int test_mul_overflow_int_int_int(int x, int y) {
// CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_int_int_int
// CHECK-LABEL: define 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
Expand All @@ -98,7 +98,7 @@ int test_mul_overflow_int_int_int(int x, int y) {
}

int test_add_overflow_uint_int_int(unsigned x, int y) {
// CHECK-LABEL: define {{(dso_local )?}}i32 @test_add_overflow_uint_int_int
// CHECK-LABEL: define 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]])
Expand Down Expand Up @@ -136,7 +136,7 @@ _Bool test_add_overflow_uint_uint_bool(unsigned x, unsigned y) {
}

unsigned test_add_overflow_bool_bool_uint(_Bool x, _Bool y) {
// CHECK-LABEL: define {{(dso_local )?}}i32 @test_add_overflow_bool_bool_uint
// CHECK-LABEL: define 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]])
Expand Down Expand Up @@ -165,7 +165,7 @@ _Bool test_add_overflow_bool_bool_bool(_Bool x, _Bool y) {
}

int test_add_overflow_volatile(int x, int y) {
// CHECK-LABEL: define {{(dso_local )?}}i32 @test_add_overflow_volatile
// CHECK-LABEL: define 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
Expand Down
4 changes: 2 additions & 2 deletions test/CodeGen/c-strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Should be 3 hello strings, two global (of different sizes), the rest are
// shared.

// CHECK: @align = {{(dso_local )?}}global i8 [[ALIGN:[0-9]+]]
// CHECK: @align = global i8 [[ALIGN:[0-9]+]]
// ITANIUM: @.str = private unnamed_addr constant [6 x i8] c"hello\00"
// MSABI: @"\01??_C@_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)
Expand All @@ -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@_05CJBACGMB@hello?$AA@", i32 0, i32 0) }
// CHECK: @x = {{(dso_local )?}}global [3 x i8] c"ola", align [[ALIGN]]
// CHECK: @x = global [3 x i8] c"ola", align [[ALIGN]]

// XFAIL: hexagon
// Hexagon aligns arrays of size 8+ bytes to a 64-bit boundary, which
Expand Down
6 changes: 3 additions & 3 deletions test/CodeGen/cfi-icall-cross-dso.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {{(dso_local )?}}void @h({{[^!]*$}}
// CHECK: declare void @h({{[^!]*$}}
void h(void);

typedef void (*Fn)(void);
Expand All @@ -60,9 +60,9 @@ Fn h1() {
return &h;
}

// CHECK: define {{(dso_local )?}}void @bar({{.*}} !type [[TNOPROTO:![0-9]+]] !type [[TNOPROTO_GENERALIZED:![0-9]+]] !type [[TNOPROTO_ID:![0-9]+]]
// CHECK: define 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 dso_local void @foo({{.*}} !type [[TNOPROTO]] !type [[TNOPROTO_GENERALIZED:![0-9]+]] !type [[TNOPROTO_ID]]
// MS: define linkonce_odr void @foo({{.*}} !type [[TNOPROTO]] !type [[TNOPROTO_GENERALIZED:![0-9]+]] !type [[TNOPROTO_ID]]
inline void foo() {}
void bar() { foo(); }

Expand Down
6 changes: 3 additions & 3 deletions test/CodeGen/cfi-icall.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@

// Tests that we assign appropriate identifiers to unprototyped functions.

// CHECK: define {{(dso_local )?}}void @f({{.*}} !type [[TVOID:![0-9]+]] !type [[TVOID_GENERALIZED:![0-9]+]]
// CHECK: define void @f({{.*}} !type [[TVOID:![0-9]+]] !type [[TVOID_GENERALIZED:![0-9]+]]
void f() {
}

void xf();

// CHECK: define {{(dso_local )?}}void @g({{.*}} !type [[TINT:![0-9]+]] !type [[TINT_GENERALIZED:![0-9]+]]
// CHECK: define 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]] {{(dso_local )?}}void @xf({{.*}}
// CHECK: declare !type [[TVOID]] !type [[TVOID_GENERALIZED]] void @xf({{.*}}

// ITANIUM-DAG: [[TVOID]] = !{i64 0, !"_ZTSFvE"}
// ITANIUM-DAG: [[TVOID_GENERALIZED]] = !{i64 0, !"_ZTSFvE.generalized"}
Expand Down
2 changes: 1 addition & 1 deletion test/CodeGen/cfstring-windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 dso_local dllexport global [32 x i32]
// CHECK-CF-IN-CF-DEFN: @__CFConstantStringClassReference = common 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]
Expand Down
48 changes: 24 additions & 24 deletions test/CodeGen/dllexport.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
__declspec(dllexport) extern int ExternGlobalDecl;

// dllexport implies a definition.
// CHECK-DAG: @GlobalDef = common dso_local dllexport global i32 0, align 4
// CHECK-DAG: @GlobalDef = common dllexport global i32 0, align 4
__declspec(dllexport) int GlobalDef;

// Export definition.
// CHECK-DAG: @GlobalInit = dso_local dllexport global i32 1, align 4
// CHECK-DAG: @GlobalInit = dllexport global i32 1, align 4
__declspec(dllexport) int GlobalInit = 1;

// Declare, then export definition.
// CHECK-DAG: @GlobalDeclInit = dso_local dllexport global i32 1, align 4
// CHECK-DAG: @GlobalDeclInit = dllexport global i32 1, align 4
__declspec(dllexport) extern int GlobalDeclInit;
int GlobalDeclInit = 1;

// Redeclarations
// CHECK-DAG: @GlobalRedecl1 = common dso_local dllexport global i32 0, align 4
// CHECK-DAG: @GlobalRedecl1 = common 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 = common dllexport global i32 0, align 4
__declspec(dllexport) extern int GlobalRedecl2;
int GlobalRedecl2;

Expand All @@ -44,22 +44,22 @@ __declspec(dllexport) extern int GlobalRedecl2;
// Declarations are not exported.

// Export function definition.
// CHECK-DAG: define dso_local dllexport void @def()
// CHECK-DAG: define dllexport void @def()
__declspec(dllexport) void def(void) {}

// Export inline function.
// CHECK-DAG: define weak_odr dso_local dllexport void @inlineFunc()
// CHECK-DAG: define weak_odr dso_local dllexport void @externInlineFunc()
// CHECK-DAG: define weak_odr dllexport void @inlineFunc()
// CHECK-DAG: define weak_odr dllexport void @externInlineFunc()
__declspec(dllexport) inline void inlineFunc(void) {}
__declspec(dllexport) inline void externInlineFunc(void) {}
extern void externInlineFunc(void);

// Redeclarations
// CHECK-DAG: define dso_local dllexport void @redecl1()
// CHECK-DAG: define dllexport void @redecl1()
__declspec(dllexport) void redecl1(void);
__declspec(dllexport) void redecl1(void) {}

// CHECK-DAG: define dso_local dllexport void @redecl2()
// CHECK-DAG: define dllexport void @redecl2()
__declspec(dllexport) void redecl2(void);
void redecl2(void) {}

Expand All @@ -70,46 +70,46 @@ __declspec(dllexport) void redecl2(void);
//===----------------------------------------------------------------------===//

// 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 = common dllexport global i32 0, align 4
// CHECK-DAG: @PrecedenceGlobal1B = common 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 = common dllexport global i32 0, align 4
// CHECK-DAG: @PrecedenceGlobal2B = common dllexport global i32 0, align 4
__attribute__((dllexport, dllimport)) int PrecedenceGlobal2A;
__declspec(dllexport) __declspec(dllimport) int PrecedenceGlobal2B;

// CHECK-DAG: @PrecedenceGlobalRedecl1 = dso_local dllexport global i32 0, align 4
// CHECK-DAG: @PrecedenceGlobalRedecl1 = dllexport global i32 0, align 4
__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 = common dllexport global i32 0, align 4
__declspec(dllimport) extern int PrecedenceGlobalRedecl2;
__declspec(dllexport) int PrecedenceGlobalRedecl2;

// CHECK-DAG: @PrecedenceGlobalMixed1 = dso_local dllexport global i32 1, align 4
// CHECK-DAG: @PrecedenceGlobalMixed1 = dllexport global i32 1, align 4
__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 = common dllexport global i32 0, align 4
__attribute__((dllimport)) extern int PrecedenceGlobalMixed2;
__declspec(dllexport) int PrecedenceGlobalMixed2;

// CHECK-DAG: define dso_local dllexport void @precedence1A()
// CHECK-DAG: define dso_local dllexport void @precedence1B()
// CHECK-DAG: define dllexport void @precedence1A()
// CHECK-DAG: define dllexport void @precedence1B()
void __attribute__((dllimport, dllexport)) precedence1A(void) {}
void __declspec(dllimport) __declspec(dllexport) precedence1B(void) {}

// CHECK-DAG: define dso_local dllexport void @precedence2A()
// CHECK-DAG: define dso_local dllexport void @precedence2B()
// CHECK-DAG: define dllexport void @precedence2A()
// CHECK-DAG: define dllexport void @precedence2B()
void __attribute__((dllexport, dllimport)) precedence2A(void) {}
void __declspec(dllexport) __declspec(dllimport) precedence2B(void) {}

// CHECK-DAG: define dso_local dllexport void @precedenceRedecl1()
// CHECK-DAG: define dllexport void @precedenceRedecl1()
void __declspec(dllimport) precedenceRedecl1(void);
void __declspec(dllexport) precedenceRedecl1(void) {}

// CHECK-DAG: define dso_local dllexport void @precedenceRedecl2()
// CHECK-DAG: define dllexport void @precedenceRedecl2()
void __declspec(dllexport) precedenceRedecl2(void);
void __declspec(dllimport) precedenceRedecl2(void) {}
Loading

0 comments on commit 5626325

Please sign in to comment.