summary refs log tree commit diff stats
path: root/tests/gc/panicoverride.nim
blob: 0f28b0b72baa2d5726b94ea88da37623957b43d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
proc printf(frmt: cstring) {.varargs, importc, header: "<stdio.h>", cdecl.}
proc exit(code: int) {.importc, header: "<stdlib.h>", cdecl.}

{.push stack_trace: off, profiler:off.}

proc rawoutput(s: string) =
  printf("%s\n", s)

proc panic(s: string) {.noreturn.} =
  rawoutput(s)
  exit(1)

{.pop.}