From 691e2b1c8c3e0491781e9ce6caf8bcf65a6266ed Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Sat, 11 Apr 2020 03:12:39 -0700 Subject: [PATCH] fixup --- compiler/ccgmerge.nim | 1 - compiler/ccgstmts.nim | 4 ++-- compiler/cgendata.nim | 1 - tests/misc/msizeof5.nim | 2 +- tests/trunner.nim | 4 ++-- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/compiler/ccgmerge.nim b/compiler/ccgmerge.nim index 55a9e3386d5a3..c12d6c0b2a2d7 100644 --- a/compiler/ccgmerge.nim +++ b/compiler/ccgmerge.nim @@ -26,7 +26,6 @@ const cfsTypes: "NIM_merge_TYPES", cfsSeqTypes: "NIM_merge_SEQ_TYPES", cfsFieldInfo: "NIM_merge_FIELD_INFO", - cfsEmits: "NIM_merge_EMITS", cfsTypeInfo: "NIM_merge_TYPE_INFO", cfsProcHeaders: "NIM_merge_PROC_HEADERS", cfsData: "NIM_merge_DATA", diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index e32c53441f931..bb9d30b8fca42 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -1455,12 +1455,12 @@ proc genAsmStmt(p: BProc, t: PNode) = # work: if p.prc == nil: # top level asm statement? - p.module.s[cfsEmits].add runtimeFormat(CC[p.config.cCompiler].asmStmtFrmt, [s]) + p.module.s[cfsProcHeaders].add runtimeFormat(CC[p.config.cCompiler].asmStmtFrmt, [s]) else: p.s(cpsStmts).add indentLine(p, runtimeFormat(CC[p.config.cCompiler].asmStmtFrmt, [s])) proc determineSection(n: PNode): TCFileSection = - result = cfsEmits # WAS: cfsProcHeaders + result = cfsProcHeaders if n.len >= 1 and n[0].kind in {nkStrLit..nkTripleStrLit}: let sec = n[0].strVal if sec.startsWith("/*TYPESECTION*/"): result = cfsTypes diff --git a/compiler/cgendata.nim b/compiler/cgendata.nim index 5f7afaaa69504..96e3828739b6c 100644 --- a/compiler/cgendata.nim +++ b/compiler/cgendata.nim @@ -25,7 +25,6 @@ type # this is needed for strange type generation # reasons cfsFieldInfo, # section for field information - cfsEmits, # section for {.emit.} (default location) cfsTypeInfo, # section for type information (ag ABI checks) cfsProcHeaders, # section for C procs prototypes cfsData, # section for C constant data diff --git a/tests/misc/msizeof5.nim b/tests/misc/msizeof5.nim index dcc61d3872663..c833d1e434f6e 100644 --- a/tests/misc/msizeof5.nim +++ b/tests/misc/msizeof5.nim @@ -1,6 +1,6 @@ ## tests for -d:checkAbi used by addAbiCheck via NIM_STATIC_ASSERT -{.emit:""" +{.emit:"""/*TYPESECTION*/ struct Foo1{ int a; }; diff --git a/tests/trunner.nim b/tests/trunner.nim index 2b99583b2edd7..263184571ad86 100644 --- a/tests/trunner.nim +++ b/tests/trunner.nim @@ -47,8 +47,8 @@ else: # don't run twice the same test block: # ABI checks let file = "misc/msizeof5.nim" block: - let (_, exitCode) = runCmd(file, "-d:checkAbi") - doAssert exitCode == 0 + let (output, exitCode) = runCmd(file, "-d:checkAbi") + doAssert exitCode == 0, output block: let (output, exitCode) = runCmd(file, "-d:checkAbi -d:caseBad") # on platforms that support _StaticAssert natively, errors will show full context, eg: