always mangle local variables (#24681)

ref #24677

(cherry picked from commit 1af88a2d20)
This commit is contained in:
ringabout
2025-02-20 06:03:58 +08:00
committed by narimiran
parent c8a030a902
commit 51edd9bd60
4 changed files with 14 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
discard """
matrix: "--mm:refc"
output: "Hello"
ccodecheck: "\\i@'a = ((NimStringDesc*) NIM_NIL)'"
ccodecheck: "\\i@'a_1 = ((NimStringDesc*) NIM_NIL)'"
"""
proc main() =

View File

@@ -1,7 +1,7 @@
discard """
output: "1"
cmd: r"nim c --hints:on $options --mm:refc -d:release $file"
ccodecheck: "'NI volatile state;'"
ccodecheck: "'NI volatile state_1;'"
targets: "c"
"""

View File

@@ -45,3 +45,14 @@ block: # bug #22354
main()
proc main = # bug #24677
let NULL = 1
doAssert NULL == 1
var COMMA = 1
doAssert COMMA == 1
for NDEBUG in 0..2:
doAssert NDEBUG == NDEBUG
main()