File tree Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -3836,9 +3836,6 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
38363836 if (Global->hasAttr <CPUDispatchAttr>())
38373837 return emitCPUDispatchDefinition (GD);
38383838
3839- if (Global->hasAttr <SectionAttr>())
3840- printf (" here \n " );
3841-
38423839 // If this is CUDA, be selective about which declarations we emit.
38433840 // Non-constexpr non-lambda implicit host device functions are not emitted
38443841 // unless they are used on device side.
Original file line number Diff line number Diff line change @@ -102,6 +102,10 @@ __declspec(allocate("short_section")) short short_var = 42;
102102struct t2 { t2(); };
103103extern const t2 non_trivial_ctor;
104104__declspec (allocate(" non_trivial_ctor_section" )) const t2 non_trivial_ctor_var;
105+ #pragma section("mysec", shared)
106+ int j = 0 ;
107+ __declspec (allocate(" mysec" )) int k = 0;
108+ extern __declspec (allocate(" mysec" )) int var = 10;
105109}
106110
107111
@@ -130,6 +134,9 @@ __declspec(allocate("non_trivial_ctor_section")) const t2 non_trivial_ctor_var;
130134// CHECK: @long_var = dso_local global i32 42, section "long_section"
131135// CHECK: @short_var = dso_local global i16 42, section "short_section"
132136// CHECK: @non_trivial_ctor_var = internal global %struct.t2 zeroinitializer, section "non_trivial_ctor_section"
137+ // CHECK: @j = dso_local global i32 0, section ".data", align 4
138+ // CHECK: @k = dso_local constant i32 0, section "mysec", align 4
139+ // CHECK: @var = dso_local constant i32 10, section "mysec", align 4
133140// CHECK: define dso_local void @g()
134141// CHECK: define dso_local void @h() {{.*}} section ".my_code"
135142// CHECK: define dso_local void @h2() {{.*}} section ".my_code"
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments