make --gc:arc --exceptions:quirky work again [backport:1.4] (#16583)

* make --gc:arc --exceptions:quirky work again [backport:1.4]

* fixes #16404 [backport:1.4]
This commit is contained in:
Andreas Rumpf 2021-01-04 19:44:50 +01:00 • committed by GitHub
commit 6317e4004d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 17 deletions

View file

@ -11,9 +11,4 @@ proc panic(s: string) {.noreturn.} =
rawoutput(s)
exit(1)
# Alternatively we also could implement these 2 here:
#
# proc sysFatal(exceptn: typeDesc, message: string) {.noReturn.}
# proc sysFatal(exceptn: typeDesc, message, arg: string) {.noReturn.}
{.pop.}

View file

@ -0,0 +1,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.}

View file

@ -0,0 +1,7 @@
# bug #16404
proc printf(frmt: cstring) {.varargs, header: "<stdio.h>", cdecl.}
var x = 0
inc x
printf("hi %ld\n", x+4777)

View file

@ -0,0 +1,4 @@
--gc:arc
--cpu:avr
--os:standalone
--compileOnly