From 0f5ad499714f3fc6bc02b54351e59ecf9946dd5a Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Mon, 3 Oct 2022 22:12:23 +0800 Subject: [ARC] fixes #18645; C Compiler error when initializing {.global.} with a block (#19953) * fixes #18645; C Compiler error when initializing {.global.} with a block: * arguably cleaner solution Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com> Co-authored-by: Araq --- tests/arc/t18645.nim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/arc/t18645.nim (limited to 'tests') diff --git a/tests/arc/t18645.nim b/tests/arc/t18645.nim new file mode 100644 index 000000000..c5fddd4bb --- /dev/null +++ b/tests/arc/t18645.nim @@ -0,0 +1,18 @@ +discard """ + matrix: "--gc:arc; --gc:refc" + output: ''' +1 +2 +3 +''' +""" + +proc bitTypeIdUnion() = + var bitId {.global.} = block: + 0 + inc bitId + echo bitId + +bitTypeIdUnion() +bitTypeIdUnion() +bitTypeIdUnion() -- cgit 1.4.1-2-gfad0