Fix multiple object storage. (#131)
This commit is contained in:
+2
@@ -618,6 +618,8 @@ internal class CodeGeneratorVisitor(val context: Context) : IrElementVisitorVoid
|
|||||||
if (objectPtr == null) {
|
if (objectPtr == null) {
|
||||||
objectPtr = LLVMAddGlobal(context.llvmModule, codegen.getLLVMType(value.type), objName)
|
objectPtr = LLVMAddGlobal(context.llvmModule, codegen.getLLVMType(value.type), objName)
|
||||||
LLVMSetInitializer(objectPtr, codegen.kNullObjHeaderPtr)
|
LLVMSetInitializer(objectPtr, codegen.kNullObjHeaderPtr)
|
||||||
|
// Backing storage for this global is common between all modules.
|
||||||
|
LLVMSetLinkage(objectPtr, LLVMLinkage.LLVMCommonLinkage)
|
||||||
}
|
}
|
||||||
|
|
||||||
val bbCurrent = codegen.currentBlock
|
val bbCurrent = codegen.currentBlock
|
||||||
|
|||||||
@@ -329,8 +329,6 @@ task tostring2(type: RunKonanTest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task tostring3(type: RunKonanTest) {
|
task tostring3(type: RunKonanTest) {
|
||||||
// Enable, once double object init fixed.
|
|
||||||
disabled = true
|
|
||||||
goldValue = "-128\n127\n-32768\n32767\n" +
|
goldValue = "-128\n127\n-32768\n32767\n" +
|
||||||
"-2147483648\n2147483647\n-9223372036854775808\n9223372036854775807\n" +
|
"-2147483648\n2147483647\n-9223372036854775808\n9223372036854775807\n" +
|
||||||
"1.17549E-38\n3.40282E+38\n-INF\nINF\n" +
|
"1.17549E-38\n3.40282E+38\n-INF\nINF\n" +
|
||||||
|
|||||||
Reference in New Issue
Block a user