Skip to content

Commit 65eeea3

Browse files
committed
Mark a function or global variable as dso_local if possible
dso_local allows the compiler to assume a function or global variable will resolve to a symbol within the same linkage unit. reference: https://llvm.org/docs/LangRef.html#runtime-preemption-specifiers
1 parent a8d98fc commit 65eeea3

15 files changed

+90
-27
lines changed

gen/functions.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,12 @@ void DtoDefineFunction(FuncDeclaration *fd, bool linkageAvailableExternally) {
13861386
global.params.targetTriple->isWindowsMSVCEnvironment()) {
13871387
emulateWeakAnyLinkageForMSVC(func, fd->linkage);
13881388
}
1389+
1390+
// Assume func marked as dso_local, which will resolve to a symbol
1391+
// within the same linkage unit.
1392+
if (gTargetMachine->shouldAssumeDSOLocal(gIR->module, func)) {
1393+
func->setDSOLocal(true);
1394+
}
13891395
}
13901396

13911397
////////////////////////////////////////////////////////////////////////////////

gen/irstate.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "gen/tollvm.h"
2121
#include "ir/irfunction.h"
2222
#include <cstdarg>
23+
#include "llvm/Target/TargetMachine.h"
2324

2425
IRState *gIR = nullptr;
2526
llvm::TargetMachine *gTargetMachine = nullptr;
@@ -137,6 +138,11 @@ IRState::setGlobalVarInitializer(LLGlobalVariable *&globalVar,
137138
Dsymbol *symbolForLinkageAndVisibility) {
138139
if (initializer->getType() == globalVar->getType()->getContainedType(0)) {
139140
defineGlobal(globalVar, initializer, symbolForLinkageAndVisibility);
141+
// Assume globalVar marked as dso_local, which will resolve to a symbol
142+
// within the same linkage unit.
143+
if (gTargetMachine->shouldAssumeDSOLocal(gIR->module, globalVar)) {
144+
globalVar->setDSOLocal(true);
145+
}
140146
return globalVar;
141147
}
142148

@@ -164,6 +170,12 @@ IRState::setGlobalVarInitializer(LLGlobalVariable *&globalVar,
164170
// Reset globalVar to the helper variable.
165171
globalVar = globalHelperVar;
166172

173+
// Assume globalVar marked as dso_local, which will resolve to a symbol
174+
// within the same linkage unit.
175+
if (gTargetMachine->shouldAssumeDSOLocal(gIR->module, globalVar)) {
176+
globalVar->setDSOLocal(true);
177+
}
178+
167179
return castHelperVar;
168180
}
169181

tests/PGO/reset_counters.d

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
// RUN: && FileCheck %s < %t2.ll
99

1010
extern(C) void foo(int N) {
11-
// CHECK-LABEL: define void @foo(
11+
// CHECK-LABEL: define{{( dso_local)?}} void @foo(
1212
// CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[FOO:[0-9]+]]
1313
if (N) {}
1414
}
1515

16-
// CHECK-LABEL: define i32 @_Dmain(
16+
// CHECK-LABEL: define{{( dso_local)?}} i32 @_Dmain(
1717
void main() {
1818
import ldc.profile;
1919
foo(0);

tests/PGO/unrolledloopstatement_gh3375.d

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void main() {
1414
foofoofoo(i);
1515
}
1616

17-
// PROFUSE-LABEL: define void @foofoofoo(
17+
// PROFUSE-LABEL: define{{( dso_local)?}} void @foofoofoo(
1818
// PROFUSE-SAME: !prof ![[FUNCENTRY:[0-9]+]]
1919
extern(C) void foofoofoo(int i)
2020
{
@@ -81,4 +81,3 @@ extern(C) void foofoofoo(int i)
8181
// PROFUSE-DAG: ![[IF2_2]] = !{!"branch_weights", i32 51, i32 26}
8282
// PROFUSE-DAG: ![[IF2_3]] = !{!"branch_weights", i32 2, i32 25}
8383
// PROFUSE-DAG: ![[IFEXIT]] = !{!"branch_weights", i32 399, i32 1}
84-

tests/codegen/align.d

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// XFAIL: Windows_x86
55

66
align(32) struct Outer { int a = 1; }
7-
// CHECK-DAG: _D5align5Outer6__initZ = constant %align.Outer {{.*}}, align 32
7+
// CHECK-DAG: _D5align5Outer6__initZ ={{( dso_local)?}} constant %align.Outer {{.*}}, align 32
88
struct Inner { align(32) int a = 1; }
9-
// CHECK-DAG: _D5align5Inner6__initZ = constant %align.Inner {{.*}}, align 32
9+
// CHECK-DAG: _D5align5Inner6__initZ ={{( dso_local)?}} constant %align.Inner {{.*}}, align 32
1010

1111
align(1) ubyte globalByte1;
1212
// CHECK-DAG: _D5align11globalByte1h = {{.*}} align 1

tests/codegen/avr.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ version (D_SoftFloat) {} else static assert(0);
77

88
// make sure TLS globals are emitted as regular __gshared globals:
99

10-
// CHECK: @_D3avr13definedGlobali = global i32 123
10+
// CHECK: @_D3avr13definedGlobali ={{( dso_local)?}} global i32 123
1111
int definedGlobal = 123;
1212
// CHECK: @_D3avr14declaredGlobali = external global i32
1313
extern int declaredGlobal;

tests/codegen/dso_local.d

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// RUN: %ldc -mtriple=x86_64-linux-gnu --relocation-model=static --output-ll -of=%t.ll %s && FileCheck --check-prefix=ELF_STATIC_RELOC %s < %t.ll
2+
// RUN: %ldc -mtriple=x86_64-linux-gnu --relocation-model=pic --output-ll -of=%t.ll %s && FileCheck --check-prefix=ELF_PIC_DEFAULT %s < %t.ll
3+
// RUN: %ldc -mtriple=x86_64-linux-gnu -fvisibility=hidden --relocation-model=pic --output-ll -of=%t.ll %s && FileCheck --check-prefix=ELF_PIC_HIDDEN %s < %t.ll
4+
// RUN: %ldc -mtriple=x86_64-apple-darwin --relocation-model=static --output-ll -of=%t.ll %s && FileCheck --check-prefix=MACHO_STATIC_RELOC %s < %t.ll
5+
// RUN: %ldc -mtriple=x86_64-apple-darwin --relocation-model=pic --output-ll -of=%t.ll %s && FileCheck --check-prefix=MACHO_PIC %s < %t.ll
6+
// RUN: %ldc -mtriple=x86_64-windows-coff -output-ll -of=%t.ll %s && FileCheck --check-prefix=COFF %s < %t.ll
7+
8+
import ldc.attributes : weak;
9+
10+
// ELF_STATIC_RELOC: define{{( dso_local)?}} i32 @{{.*}}3foo
11+
// ELF_PIC_DEFAULT: define i32 @{{.*}}3foo
12+
// ELF_PIC_HIDDEN: define{{( dso_local)?}} hidden i32 @{{.*}}3foo
13+
// MACHO_STATIC_RELOC: define dso_local i32 @{{.*}}3foo
14+
// MACHO_PIC: define dso_local i32 @{{.*}}3foo
15+
// COFF: define dso_local {{.*}} i32 @{{.*}}3foo
16+
private int foo() { return 42; }
17+
18+
19+
// ELF_STATIC_RELOC: define{{( dso_local)?}} i32 @{{.*}}3bar
20+
// ELF_PIC_DEFAULT: define i32 @{{.*}}3bar
21+
// ELF_PIC_HIDDEN: define hidden i32 @{{.*}}3bar
22+
// MACHO_STATIC_RELOC: define dso_local i32 @{{.*}}3bar
23+
// MACHO_PIC: define dso_local i32 @{{.*}}3bar
24+
// COFF: define dso_local {{.*}} i32 @{{.*}}3bar
25+
public int bar() { return foo(); }
26+
27+
28+
// ELF_STATIC_RELOC: define weak{{( dso_local)?}} i32 @{{.*}}3baz
29+
// ELF_PIC_DEFAULT: define weak i32 @{{.*}}3baz
30+
// ELF_PIC_HIDDEN: define weak hidden i32 @{{.*}}3baz
31+
// MACHO_STATIC_RELOC: define weak i32 @{{.*}}3baz
32+
// MACHO_PIC: define weak i32 @{{.*}}3baz
33+
// COFF: define x86_vectorcallcc i32 @{{.*}}3baz
34+
@weak int baz() { return 42; }
35+
36+
37+
version(Windows)
38+
{
39+
// COFF: declare extern_weak void @weakreffunction
40+
pragma(LDC_extern_weak) extern(C) void weakreffunction();
41+
42+
void piyo()
43+
{
44+
auto a = &weakreffunction;
45+
}
46+
}

tests/codegen/export.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export
1111
// CHECK-DAG: @{{.*}}importedGlobal{{.*}} = external dllimport
1212
extern(C) extern __gshared void* importedGlobal;
1313

14-
// CHECK-DAG: define dllexport {{.*}}_D6export11exportedFooFZv
14+
// CHECK-DAG: define{{( dso_local)?}} dllexport {{.*}}_D6export11exportedFooFZv
1515
void exportedFoo() {}
1616

1717
// CHECK-DAG: declare dllimport {{.*}}_D6export11importedFooFZv

tests/codegen/gh3221.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ union U
88
uint b;
99
}
1010

11-
// CHECK: @{{.*}}_D6gh32211uSQk1U{{.*}} = global { i32 } { i32 12345 }
11+
// CHECK: @{{.*}}_D6gh32211uSQk1U{{.*}} ={{( dso_local)?}} global { i32 } { i32 12345 }
1212
// CHECK: @llvm.used = appending global
1313
// CHECK-SAME: _D6gh32211uSQk1U
1414
@assumeUsed __gshared U u = { b: 12345 };

tests/codegen/lambdas_gh3648.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ void foo()
2626
}
2727

2828
// the global variables should be defined as linkonce_odr:
29-
// CHECK: _D14lambdas_gh36489__lambda5FZ10global_bari{{.*}} = linkonce_odr thread_local global
30-
// CHECK: _D14lambdas_gh36489__lambda6FZ18global_bar_inlinedOi{{.*}} = linkonce_odr global
31-
// CHECK: _D14lambdas_gh36483fooFZ__T9__lambda1TiZQnFiZ12lambda_templi{{.*}} = linkonce_odr global
29+
// CHECK: _D14lambdas_gh36489__lambda5FZ10global_bari{{.*}} ={{( dso_local)?}} linkonce_odr thread_local global
30+
// CHECK: _D14lambdas_gh36489__lambda6FZ18global_bar_inlinedOi{{.*}} ={{( dso_local)?}} linkonce_odr global
31+
// CHECK: _D14lambdas_gh36483fooFZ__T9__lambda1TiZQnFiZ12lambda_templi{{.*}} ={{( dso_local)?}} linkonce_odr global
3232

3333
// foo() should only call two lambdas:
3434
// CHECK: define {{.*}}_D14lambdas_gh36483fooFZv

tests/codegen/lambdas_gh3648b.d

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ void foo()
1111
}
1212

1313
// the global variables should be defined as linkonce_odr:
14-
// CHECK: _D14lambdas_gh36489__lambda5FZ10global_bari{{.*}} = linkonce_odr thread_local global
15-
// CHECK: _D14lambdas_gh36489__lambda6FZ18global_bar_inlinedOi{{.*}} = linkonce_odr global
14+
// CHECK: _D14lambdas_gh36489__lambda5FZ10global_bari{{.*}} ={{( dso_local)?}} linkonce_odr thread_local global
15+
// CHECK: _D14lambdas_gh36489__lambda6FZ18global_bar_inlinedOi{{.*}} ={{( dso_local)?}} linkonce_odr global
1616

1717
// foo() should only call one lambda:
1818
// CHECK: define {{.*}}_D15lambdas_gh3648b3fooFZv

tests/codegen/simd_alignment.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ int4 globalIntFour;
1717
S17237 globalStruct;
1818
// CHECK-DAG: @{{.*}}globalStruct{{.*}}S17237{{\"?}} = {{.*}} zeroinitializer{{(, comdat)?}}, align 32
1919

20-
// CHECK-LABEL: define <8 x i32> @foo(
20+
// CHECK-LABEL: define{{( dso_local)?}} <8 x i32> @foo(
2121
extern(C) int8 foo(S17237* s)
2222
{
2323
// CHECK: %[[GEP:[0-9]]] = getelementptr {{.*}}S17237* %s_arg

tests/codegen/static_typeid_gh1540.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ struct S
1616
}
1717

1818
// CHECK-DAG: _D{{.*}}1C7__ClassZ{{\"?}} = global %object.TypeInfo_Class
19-
// CHECK-DAG: _D{{.*}}classvarC14TypeInfo_Class{{\"?}} = thread_local global %object.TypeInfo_Class* {{.*}}1C7__ClassZ
19+
// CHECK-DAG: _D{{.*}}classvarC14TypeInfo_Class{{\"?}} ={{( dso_local)?}} thread_local global %object.TypeInfo_Class* {{.*}}1C7__ClassZ
2020
auto classvar = typeid(C);
2121

2222
// CHECK-DAG: _D{{.*}}TypeInfo_C{{.*}}1I6__initZ{{\"?}} = linkonce_odr global %object.TypeInfo_Interface
23-
// CHECK-DAG: _D{{.*}}interfacevarC18TypeInfo_Interface{{\"?}} = thread_local global %object.TypeInfo_Interface* {{.*}}TypeInfo_C{{.*}}1I6__initZ
23+
// CHECK-DAG: _D{{.*}}interfacevarC18TypeInfo_Interface{{\"?}} ={{( dso_local)?}} thread_local global %object.TypeInfo_Interface* {{.*}}TypeInfo_C{{.*}}1I6__initZ
2424
auto interfacevar = typeid(I);
2525

2626
// CHECK-DAG: _D{{.*}}TypeInfo_S{{.*}}1S6__initZ{{\"?}} = linkonce_odr global %object.TypeInfo_Struct
27-
// CHECK-DAG: _D{{.*}}structvarC15TypeInfo_Struct{{\"?}} = thread_local global %object.TypeInfo_Struct* {{.*}}TypeInfo_S{{.*}}1S6__initZ
27+
// CHECK-DAG: _D{{.*}}structvarC15TypeInfo_Struct{{\"?}} ={{( dso_local)?}} thread_local global %object.TypeInfo_Struct* {{.*}}TypeInfo_S{{.*}}1S6__initZ
2828
auto structvar = typeid(S);

tests/codegen/union.d

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ struct S
1313
char[2][1] multidim; // multidimensional init based on a single 0xff char
1414
}
1515
// CHECK-DAG: %union.S = type { i8, [3 x i8], i32, [2 x i8], i8, [1 x [2 x i8]], [3 x i8] }
16-
// CHECK-DAG: @{{.*}}_D5union1S6__initZ{{\"?}} = constant %union.S { i8 -1, [3 x i8] zeroinitializer, i32 0, [2 x i8] zeroinitializer, i8 1, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }
16+
// CHECK-DAG: @{{.*}}_D5union1S6__initZ{{\"?}} ={{( dso_local)?}} constant %union.S { i8 -1, [3 x i8] zeroinitializer, i32 0, [2 x i8] zeroinitializer, i8 1, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }
1717

18-
// CHECK-DAG: @{{.*}}_D5union8defaultSSQq1S{{\"?}} = global %union.S { i8 -1, [3 x i8] zeroinitializer, i32 0, [2 x i8] zeroinitializer, i8 1, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }
18+
// CHECK-DAG: @{{.*}}_D5union8defaultSSQq1S{{\"?}} ={{( dso_local)?}} global %union.S { i8 -1, [3 x i8] zeroinitializer, i32 0, [2 x i8] zeroinitializer, i8 1, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }
1919
__gshared S defaultS;
2020

21-
// CHECK-DAG: @{{.*}}_D5union9explicitSSQr1S{{\"?}} = global %union.S { i8 3, [3 x i8] zeroinitializer, i32 56, [2 x i8] c"\00\01", i8 0, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }
21+
// CHECK-DAG: @{{.*}}_D5union9explicitSSQr1S{{\"?}} ={{( dso_local)?}} global %union.S { i8 3, [3 x i8] zeroinitializer, i32 56, [2 x i8] c"\00\01", i8 0, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }
2222
__gshared S explicitS = { 3, 56, [false, true], false /* implicit multidim */ };
2323

2424

@@ -35,17 +35,17 @@ struct SWithUnion
3535
}
3636
}
3737
// CHECK-DAG: %union.SWithUnion = type { i8, [3 x i8], %union.S, [4 x i8], i8, [1 x i8], i16, i32, i64, i64 }
38-
// CHECK-DAG: @{{.*}}_D5union10SWithUnion6__initZ{{\"?}} = constant %union.SWithUnion { i8 -1, [3 x i8] zeroinitializer, %union.S { i8 -1, [3 x i8] zeroinitializer, i32 0, [2 x i8] zeroinitializer, i8 1, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }, [4 x i8] zeroinitializer, i8 6, [1 x i8] zeroinitializer, i16 33, i32 84, i64 666, i64 123 }
38+
// CHECK-DAG: @{{.*}}_D5union10SWithUnion6__initZ{{\"?}} ={{( dso_local)?}} constant %union.SWithUnion { i8 -1, [3 x i8] zeroinitializer, %union.S { i8 -1, [3 x i8] zeroinitializer, i32 0, [2 x i8] zeroinitializer, i8 1, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }, [4 x i8] zeroinitializer, i8 6, [1 x i8] zeroinitializer, i16 33, i32 84, i64 666, i64 123 }
3939

40-
// CHECK-DAG: @{{.*}}_D5union17defaultSWithUnionSQBa10SWithUnion{{\"?}} = global %union.SWithUnion { i8 -1, [3 x i8] zeroinitializer, %union.S { i8 -1, [3 x i8] zeroinitializer, i32 0, [2 x i8] zeroinitializer, i8 1, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }, [4 x i8] zeroinitializer, i8 6, [1 x i8] zeroinitializer, i16 33, i32 84, i64 666, i64 123 }
40+
// CHECK-DAG: @{{.*}}_D5union17defaultSWithUnionSQBa10SWithUnion{{\"?}} ={{( dso_local)?}} global %union.SWithUnion { i8 -1, [3 x i8] zeroinitializer, %union.S { i8 -1, [3 x i8] zeroinitializer, i32 0, [2 x i8] zeroinitializer, i8 1, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }, [4 x i8] zeroinitializer, i8 6, [1 x i8] zeroinitializer, i16 33, i32 84, i64 666, i64 123 }
4141
__gshared SWithUnion defaultSWithUnion;
4242

43-
// CHECK-DAG: @{{.*}}_D5union28explicitCompatibleSWithUnionSQBl10SWithUnion{{\"?}} = global %union.SWithUnion { i8 -1, [3 x i8] zeroinitializer, %union.S { i8 -1, [3 x i8] zeroinitializer, i32 0, [2 x i8] zeroinitializer, i8 1, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }, [4 x i8] zeroinitializer, i8 6, [1 x i8] zeroinitializer, i16 33, i32 84, i64 53, i64 123 }
43+
// CHECK-DAG: @{{.*}}_D5union28explicitCompatibleSWithUnionSQBl10SWithUnion{{\"?}} ={{( dso_local)?}} global %union.SWithUnion { i8 -1, [3 x i8] zeroinitializer, %union.S { i8 -1, [3 x i8] zeroinitializer, i32 0, [2 x i8] zeroinitializer, i8 1, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }, [4 x i8] zeroinitializer, i8 6, [1 x i8] zeroinitializer, i16 33, i32 84, i64 53, i64 123 }
4444
__gshared SWithUnion explicitCompatibleSWithUnion = { ul_dummy: 53 }; // ul_dummy is an alias for dominant ul
4545

4646
// If a dominated union field is initialized and it isn't an alias for a dominant field,
4747
// the regular LL type cannot be used, and an anonymous one is used instead.
48-
// CHECK-DAG: @{{.*}}_D5union30explicitIncompatibleSWithUnionSQBn10SWithUnion{{\"?}} = global { i8, [3 x i8], %union.S, [4 x i8], i32, i32, i64, i64 } { i8 -1, [3 x i8] zeroinitializer, %union.S { i8 -1, [3 x i8] zeroinitializer, i32 0, [2 x i8] zeroinitializer, i8 1, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }, [4 x i8] zeroinitializer, i32 23, i32 84, i64 666, i64 123 }
48+
// CHECK-DAG: @{{.*}}_D5union30explicitIncompatibleSWithUnionSQBn10SWithUnion{{\"?}} ={{( dso_local)?}} global { i8, [3 x i8], %union.S, [4 x i8], i32, i32, i64, i64 } { i8 -1, [3 x i8] zeroinitializer, %union.S { i8 -1, [3 x i8] zeroinitializer, i32 0, [2 x i8] zeroinitializer, i8 1, [1 x [2 x i8]] {{\[}}[2 x i8] c"\FF\FF"], [3 x i8] zeroinitializer }, [4 x i8] zeroinitializer, i32 23, i32 84, i64 666, i64 123 }
4949
__gshared SWithUnion explicitIncompatibleSWithUnion = { ui1: 23 }; // // ui1 dominated by ub and us
5050

5151

@@ -70,7 +70,7 @@ struct Quat
7070

7171
// T.init may feature explicit initializers for dominated members in nested unions (GitHub issue #2108).
7272
// In that case, the init constant has an anonymous LL type as well.
73-
// CHECK-DAG: @{{.*}}_D5union33QuatContainerWithIncompatibleInit6__initZ{{\"?}} = constant { { float } } { { float } { float 1.000000e+00 } }
73+
// CHECK-DAG: @{{.*}}_D5union33QuatContainerWithIncompatibleInit6__initZ{{\"?}} ={{( dso_local)?}} constant { { float } } { { float } { float 1.000000e+00 } }
7474
struct QuatContainerWithIncompatibleInit
7575
{
7676
Quat q = Quat.identity;

tests/codegen/wasi.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ version (CRuntime_WASI) {} else static assert(0);
1313

1414
// make sure TLS globals are emitted as regular __gshared globals:
1515

16-
// CHECK: @_D4wasi13definedGlobali = global i32 123
16+
// CHECK: @_D4wasi13definedGlobali ={{( dso_local)?}} global i32 123
1717
int definedGlobal = 123;
1818
// CHECK: @_D4wasi14declaredGlobali = external global i32
1919
extern int declaredGlobal;

0 commit comments

Comments
 (0)