summary refs log tree commit diff stats
path: root/tests/pragmas/tpush.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-08-02 17:00:34 +0800
committerGitHub <noreply@github.com>2023-08-02 11:00:34 +0200
commit825a0e7df40100d92e87fc421a135a84b94f818f (patch)
tree82865cc50f3f1c0793ae70150d02cf37483f3b0f /tests/pragmas/tpush.nim
parentf3a7622514f24740c6b33f0c37ebe6339ad5b70d (diff)
downloadNim-825a0e7df40100d92e87fc421a135a84b94f818f.tar.gz
fixes #22362; Compiler crashes with staticBoundsCheck on (#22363)
Diffstat (limited to 'tests/pragmas/tpush.nim')
-rw-r--r--tests/pragmas/tpush.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/pragmas/tpush.nim b/tests/pragmas/tpush.nim
index f2779ea70..6d7eade91 100644
--- a/tests/pragmas/tpush.nim
+++ b/tests/pragmas/tpush.nim
@@ -1,3 +1,7 @@
+discard """
+  targets: "c js"
+"""
+
 # test the new pragmas
 
 {.push warnings: off, hints: off.}
@@ -25,3 +29,12 @@ proc foo(x: string, y: int, res: int) =
 
 foo("", 0, 48)
 foo("abc", 40, 51)
+
+# bug #22362
+{.push staticBoundChecks: on.}
+proc main(): void =
+  {.pop.}
+  discard
+  {.push staticBoundChecks: on.}
+
+main()