diff --git a/include/backtrace.hpp b/include/backtrace.hpp index 2c23a89a..e0d8947c 100644 --- a/include/backtrace.hpp +++ b/include/backtrace.hpp @@ -11,6 +11,10 @@ #include "style.hpp" +#define TRACE_SEPARATOR "<-" +#define NODE_SEPARATOR "::" +#define REPT_NODE_PREFIX "REPT~" + struct Tracing { uint64_t depth = 0; bool collapse = false; @@ -34,7 +38,7 @@ void trace_PrintBacktrace(std::vector const &stack, M getName, N getLineNo) { if (!tracing.collapse) { fputs(" ", stderr); // Just three spaces; the fourth will be printed next } - fprintf(stderr, " %s ", i == 0 ? "at" : "<-"); + fprintf(stderr, " %s ", i == 0 ? "at" : TRACE_SEPARATOR); style_Set(stderr, STYLE_CYAN, true); fputs(getName(item), stderr); style_Set(stderr, STYLE_CYAN, false); @@ -62,7 +66,7 @@ void trace_PrintBacktrace(std::vector const &stack, M getName, N getLineNo) { style_Reset(stderr); if (tracing.collapse) { - fputs(" <-", stderr); + fputs(" " TRACE_SEPARATOR, stderr); } else { fputs(" ", stderr); // Just three spaces; the fourth will be printed next } diff --git a/src/asm/fstack.cpp b/src/asm/fstack.cpp index c0d8760c..2c614fce 100644 --- a/src/asm/fstack.cpp +++ b/src/asm/fstack.cpp @@ -56,16 +56,6 @@ static std::vector includePaths = {""}; // -I static std::deque preIncludeNames; // -P static bool failedOnMissingInclude = false; -static std::string reptChain(FileStackNode const &node) { - std::string chain; - std::vector const &nodeIters = node.iters(); - for (uint32_t i = nodeIters.size(); i--;) { - chain.append("::REPT~"); - chain.append(std::to_string(nodeIters[i])); - } - return chain; -} - using TraceNode = std::pair; static std::vector backtrace(FileStackNode const &node, uint32_t curLineNo) { @@ -89,7 +79,12 @@ static std::vector backtrace(FileStackNode const &node, uint32_t curL std::vector traceNodes = backtrace(*node.parent, node.lineNo); if (std::holds_alternative>(node.data)) { assume(!traceNodes.empty()); // REPT nodes use their parent's name - traceNodes.emplace_back(traceNodes.back().first + reptChain(node), curLineNo); + std::string reptName = traceNodes.back().first; + if (std::vector const &nodeIters = node.iters(); !nodeIters.empty()) { + reptName.append(NODE_SEPARATOR REPT_NODE_PREFIX); + reptName.append(std::to_string(nodeIters.front())); + } + traceNodes.emplace_back(reptName, curLineNo); } else { traceNodes.emplace_back(node.name(), curLineNo); } @@ -299,9 +294,13 @@ static void } } if (macro.src->type == NODE_REPT) { - fileInfoName.append(reptChain(*macro.src)); + std::vector const &srcIters = macro.src->iters(); + for (uint32_t i = srcIters.size(); i--;) { + fileInfoName.append(NODE_SEPARATOR REPT_NODE_PREFIX); + fileInfoName.append(std::to_string(srcIters[i])); + } } - fileInfoName.append("::"); + fileInfoName.append(NODE_SEPARATOR); fileInfoName.append(macro.name); auto fileInfo = std::make_shared(NODE_MACRO, fileInfoName, isQuiet); diff --git a/src/link/fstack.cpp b/src/link/fstack.cpp index 5fdd5638..50283adb 100644 --- a/src/link/fstack.cpp +++ b/src/link/fstack.cpp @@ -35,12 +35,12 @@ static std::vector backtrace(FileStackNode const &node, uint32_t curL std::vector traceNodes = backtrace(*node.parent, node.lineNo); if (std::holds_alternative>(node.data)) { assume(!traceNodes.empty()); // REPT nodes use their parent's name - std::string reptChain = traceNodes.back().first; - for (uint32_t iter : node.iters()) { - reptChain.append("::REPT~"); - reptChain.append(std::to_string(iter)); + std::string reptName = traceNodes.back().first; + if (std::vector const &nodeIters = node.iters(); !nodeIters.empty()) { + reptName.append(NODE_SEPARATOR REPT_NODE_PREFIX); + reptName.append(std::to_string(nodeIters.back())); } - traceNodes.emplace_back(reptChain, curLineNo); + traceNodes.emplace_back(reptName, curLineNo); } else { traceNodes.emplace_back(node.name(), curLineNo); } diff --git a/test/asm/rept-line-no.err b/test/asm/rept-line-no.err index 403a884a..8c0a8140 100644 --- a/test/asm/rept-line-no.err +++ b/test/asm/rept-line-no.err @@ -9,10 +9,10 @@ warning: Line 5 [-Wuser] warning: Line 8 [-Wuser] at rept-line-no.asm(8) warning: Line 12 [-Wuser] - at rept-line-no.asm::REPT~1::REPT~1::REPT~1(12) <- rept-line-no.asm::REPT~1(11) <- rept-line-no.asm(10) + at rept-line-no.asm::REPT~1::REPT~1(12) <- rept-line-no.asm::REPT~1(11) <- rept-line-no.asm(10) warning: Line 12 [-Wuser] - at rept-line-no.asm::REPT~1::REPT~1::REPT~2(12) <- rept-line-no.asm::REPT~1(11) <- rept-line-no.asm(10) + at rept-line-no.asm::REPT~1::REPT~2(12) <- rept-line-no.asm::REPT~1(11) <- rept-line-no.asm(10) warning: Line 12 [-Wuser] - at rept-line-no.asm::REPT~2::REPT~2::REPT~1(12) <- rept-line-no.asm::REPT~2(11) <- rept-line-no.asm(10) + at rept-line-no.asm::REPT~2::REPT~1(12) <- rept-line-no.asm::REPT~2(11) <- rept-line-no.asm(10) warning: Line 12 [-Wuser] - at rept-line-no.asm::REPT~2::REPT~2::REPT~2(12) <- rept-line-no.asm::REPT~2(11) <- rept-line-no.asm(10) + at rept-line-no.asm::REPT~2::REPT~2(12) <- rept-line-no.asm::REPT~2(11) <- rept-line-no.asm(10) diff --git a/test/asm/rept-macro-fstack-trace.err b/test/asm/rept-macro-fstack-trace.err index b74f135d..e978909e 100644 --- a/test/asm/rept-macro-fstack-trace.err +++ b/test/asm/rept-macro-fstack-trace.err @@ -1,5 +1,5 @@ warning: round 1 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~1::REPT~1::REPT~1(13) + at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~1::REPT~1(13) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~1(12) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~1(13) @@ -7,7 +7,7 @@ warning: round 1 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 2 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~1::REPT~1::REPT~2(13) + at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~1::REPT~2(13) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~1(12) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~1(13) @@ -15,7 +15,7 @@ warning: round 2 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 3 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~2::REPT~2::REPT~1(13) + at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~2::REPT~1(13) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~2(12) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~1(13) @@ -23,7 +23,7 @@ warning: round 3 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 4 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~2::REPT~2::REPT~2(13) + at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~2::REPT~2(13) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~2(12) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~1(13) @@ -31,7 +31,7 @@ warning: round 4 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 5 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~1::REPT~1::REPT~1(13) + at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~1::REPT~1(13) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~1(12) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~2(13) @@ -39,7 +39,7 @@ warning: round 5 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 6 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~1::REPT~1::REPT~2(13) + at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~1::REPT~2(13) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~1(12) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~2(13) @@ -47,7 +47,7 @@ warning: round 6 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 7 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~2::REPT~2::REPT~1(13) + at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~2::REPT~1(13) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~2(12) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~2(13) @@ -55,7 +55,7 @@ warning: round 7 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 8 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~2::REPT~2::REPT~2(13) + at rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~2::REPT~2(13) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner::REPT~2(12) <- rept-macro-fstack-trace.asm::outer::REPT~1::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~2(13) @@ -63,7 +63,7 @@ warning: round 8 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 9 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~1::REPT~1::REPT~1(13) + at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~1::REPT~1(13) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~1(12) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~3(13) @@ -71,7 +71,7 @@ warning: round 9 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 10 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~1::REPT~1::REPT~2(13) + at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~1::REPT~2(13) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~1(12) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~3(13) @@ -79,7 +79,7 @@ warning: round 10 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 11 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~2::REPT~2::REPT~1(13) + at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~2::REPT~1(13) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~2(12) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~3(13) @@ -87,7 +87,7 @@ warning: round 11 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 12 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~2::REPT~2::REPT~2(13) + at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~2::REPT~2(13) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~2(12) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~3(13) @@ -95,7 +95,7 @@ warning: round 12 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 13 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~1::REPT~1::REPT~1(13) + at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~1::REPT~1(13) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~1(12) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~4(13) @@ -103,7 +103,7 @@ warning: round 13 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 14 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~1::REPT~1::REPT~2(13) + at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~1::REPT~2(13) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~1(12) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~4(13) @@ -111,7 +111,7 @@ warning: round 14 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 15 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~2::REPT~2::REPT~1(13) + at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~2::REPT~1(13) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~2(12) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~4(13) @@ -119,7 +119,7 @@ warning: round 15 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 16 [-Wuser] - at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~2::REPT~2::REPT~2(13) + at rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~2::REPT~2(13) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner::REPT~2(12) <- rept-macro-fstack-trace.asm::outer::REPT~3::inner(11) <- rept-macro-fstack-trace.asm::outer::REPT~4(13) @@ -127,42 +127,42 @@ warning: round 16 [-Wuser] <- rept-macro-fstack-trace.asm::REPT~1(18) <- rept-macro-fstack-trace.asm(17) warning: round 17 [-Wuser] - at rept-macro-fstack-trace.asm::foo::REPT~1::REPT~1::REPT~1(24) + at rept-macro-fstack-trace.asm::foo::REPT~1::REPT~1(24) <- rept-macro-fstack-trace.asm::foo::REPT~1(23) <- rept-macro-fstack-trace.asm::foo(22) - <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar::REPT~1::REPT~1::REPT~1(34) + <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar::REPT~1::REPT~1(34) <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar::REPT~1(33) <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar(32) - <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::REPT~1(38) + <- rept-macro-fstack-trace.asm::REPT~1::REPT~1(38) <- rept-macro-fstack-trace.asm::REPT~1(30) <- rept-macro-fstack-trace.asm(29) warning: round 18 [-Wuser] - at rept-macro-fstack-trace.asm::foo::REPT~1::REPT~1::REPT~1(24) + at rept-macro-fstack-trace.asm::foo::REPT~1::REPT~1(24) <- rept-macro-fstack-trace.asm::foo::REPT~1(23) <- rept-macro-fstack-trace.asm::foo(22) - <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar::REPT~1::REPT~1::REPT~2(34) + <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar::REPT~1::REPT~2(34) <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar::REPT~1(33) <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar(32) - <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::REPT~1(38) + <- rept-macro-fstack-trace.asm::REPT~1::REPT~1(38) <- rept-macro-fstack-trace.asm::REPT~1(30) <- rept-macro-fstack-trace.asm(29) warning: round 19 [-Wuser] - at rept-macro-fstack-trace.asm::foo::REPT~1::REPT~1::REPT~1(24) + at rept-macro-fstack-trace.asm::foo::REPT~1::REPT~1(24) <- rept-macro-fstack-trace.asm::foo::REPT~1(23) <- rept-macro-fstack-trace.asm::foo(22) - <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar::REPT~2::REPT~2::REPT~1(34) + <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar::REPT~2::REPT~1(34) <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar::REPT~2(33) <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar(32) - <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::REPT~1(38) + <- rept-macro-fstack-trace.asm::REPT~1::REPT~1(38) <- rept-macro-fstack-trace.asm::REPT~1(30) <- rept-macro-fstack-trace.asm(29) warning: round 20 [-Wuser] - at rept-macro-fstack-trace.asm::foo::REPT~1::REPT~1::REPT~1(24) + at rept-macro-fstack-trace.asm::foo::REPT~1::REPT~1(24) <- rept-macro-fstack-trace.asm::foo::REPT~1(23) <- rept-macro-fstack-trace.asm::foo(22) - <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar::REPT~2::REPT~2::REPT~2(34) + <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar::REPT~2::REPT~2(34) <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar::REPT~2(33) <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::bar(32) - <- rept-macro-fstack-trace.asm::REPT~1::REPT~1::REPT~1(38) + <- rept-macro-fstack-trace.asm::REPT~1::REPT~1(38) <- rept-macro-fstack-trace.asm::REPT~1(30) <- rept-macro-fstack-trace.asm(29) diff --git a/test/asm/rept-trace.asm b/test/asm/rept-trace.asm new file mode 100644 index 00000000..e482167a --- /dev/null +++ b/test/asm/rept-trace.asm @@ -0,0 +1,23 @@ +section "test", rom0 +for v1, 4 + if v1 == 3 + for v2, 3 + if v2 == 2 + for v3, 2 + if v3 == 1 + rept 1 + macro m + static_assert \1 + endm + endr + rept 1 + rept 2 + m 0 + endr + endr + endc + endr + endc + endr + endc +endr diff --git a/test/asm/rept-trace.err b/test/asm/rept-trace.err new file mode 100644 index 00000000..591df309 --- /dev/null +++ b/test/asm/rept-trace.err @@ -0,0 +1,17 @@ +error: Assertion failed + at rept-trace.asm::REPT~4::REPT~3::REPT~2::REPT~1::m(10) + <- rept-trace.asm::REPT~4::REPT~3::REPT~2::REPT~1::REPT~1(15) + <- rept-trace.asm::REPT~4::REPT~3::REPT~2::REPT~1(14) + <- rept-trace.asm::REPT~4::REPT~3::REPT~2(13) + <- rept-trace.asm::REPT~4::REPT~3(6) + <- rept-trace.asm::REPT~4(4) + <- rept-trace.asm(2) +error: Assertion failed + at rept-trace.asm::REPT~4::REPT~3::REPT~2::REPT~1::m(10) + <- rept-trace.asm::REPT~4::REPT~3::REPT~2::REPT~1::REPT~2(15) + <- rept-trace.asm::REPT~4::REPT~3::REPT~2::REPT~1(14) + <- rept-trace.asm::REPT~4::REPT~3::REPT~2(13) + <- rept-trace.asm::REPT~4::REPT~3(6) + <- rept-trace.asm::REPT~4(4) + <- rept-trace.asm(2) +Assembly aborted with 2 errors! diff --git a/test/asm/rept-trace.flags b/test/asm/rept-trace.flags new file mode 100644 index 00000000..50f0633e --- /dev/null +++ b/test/asm/rept-trace.flags @@ -0,0 +1 @@ +-Bno-collapse diff --git a/test/link/rept-trace/a.asm b/test/link/rept-trace/a.asm new file mode 100644 index 00000000..2ee8a611 --- /dev/null +++ b/test/link/rept-trace/a.asm @@ -0,0 +1,23 @@ +section "test", rom0 +for v1, 4 + if v1 == 3 + for v2, 3 + if v2 == 2 + for v3, 2 + if v3 == 1 + rept 1 + macro m + assert \1 + endm + endr + rept 1 + rept 2 + m @ + endr + endr + endc + endr + endc + endr + endc +endr diff --git a/test/link/rept-trace/out.err b/test/link/rept-trace/out.err new file mode 100644 index 00000000..74715269 --- /dev/null +++ b/test/link/rept-trace/out.err @@ -0,0 +1,17 @@ +error: assert failure + at rept-trace/a.asm::REPT~4::REPT~3::REPT~2::REPT~1::m(10) + <- rept-trace/a.asm::REPT~4::REPT~3::REPT~2::REPT~1::REPT~1(15) + <- rept-trace/a.asm::REPT~4::REPT~3::REPT~2::REPT~1(14) + <- rept-trace/a.asm::REPT~4::REPT~3::REPT~2(13) + <- rept-trace/a.asm::REPT~4::REPT~3(6) + <- rept-trace/a.asm::REPT~4(4) + <- rept-trace/a.asm(2) +error: assert failure + at rept-trace/a.asm::REPT~4::REPT~3::REPT~2::REPT~1::m(10) + <- rept-trace/a.asm::REPT~4::REPT~3::REPT~2::REPT~1::REPT~2(15) + <- rept-trace/a.asm::REPT~4::REPT~3::REPT~2::REPT~1(14) + <- rept-trace/a.asm::REPT~4::REPT~3::REPT~2(13) + <- rept-trace/a.asm::REPT~4::REPT~3(6) + <- rept-trace/a.asm::REPT~4(4) + <- rept-trace/a.asm(2) +Linking failed with 2 errors diff --git a/test/link/test.sh b/test/link/test.sh index e9247f16..63a4d2e3 100755 --- a/test/link/test.sh +++ b/test/link/test.sh @@ -266,13 +266,19 @@ evaluateTest test="pipeline" startTest continueTest -("$RGBASM" -Weverything -Bcollapse -o - - | \ - "$RGBLINK" -Weverything -Bcollapse -o - - | \ - "$RGBFIX" -Weverything -v -p 0xff -) < "$test"/a.asm > "$gbtemp" +("$RGBASM" -o - - | "$RGBLINK" -o - - | "$RGBFIX" -v -p 0xff -) < "$test"/a.asm > "$gbtemp" # This test does not trim its output with 'dd' because it needs to verify the correct output size tryCmp "$test"/out.gb "$gbtemp" evaluateTest +test="rept-trace" +startTest +"$RGBASM" -o "$otemp" "$test"/a.asm +continueTest +rgblinkQuiet -Bno-collapse -o "$gbtemp" "$otemp" 2>"$outtemp" +tryDiff "$test"/out.err "$outtemp" +evaluateTest + test="same-consts" startTest "$RGBASM" -o "$otemp" "$test"/a.asm