mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-11 22:08:54 +00:00
ensure the avr example keeps compiling (#17663)
* ensure the avr example keeps compiling * Update tests/avr/thello.nim * now compiles properly
This commit is contained in:
@@ -34,6 +34,10 @@ proc quitOrDebug() {.noreturn, importc: "abort", header: "<stdlib.h>", nodecl.}
|
||||
proc raiseException(e: ref Exception, ename: cstring) {.compilerRtl.} =
|
||||
sysFatal(ReraiseDefect, "exception handling is not available")
|
||||
|
||||
proc raiseExceptionEx(e: sink(ref Exception), ename, procname, filename: cstring,
|
||||
line: int) {.compilerRtl.} =
|
||||
sysFatal(ReraiseDefect, "exception handling is not available")
|
||||
|
||||
proc reraiseException() {.compilerRtl.} =
|
||||
sysFatal(ReraiseDefect, "no exception to reraise")
|
||||
|
||||
|
||||
12
tests/avr/nim.cfg
Normal file
12
tests/avr/nim.cfg
Normal file
@@ -0,0 +1,12 @@
|
||||
avr.standalone.gcc.path = "/usr/bin"
|
||||
avr.standalone.gcc.exe = "avr-gcc"
|
||||
avr.standalone.gcc.linkerexe = "avr-gcc"
|
||||
passC = "-Os"
|
||||
passC = "-DF_CPU=16000000UL"
|
||||
passC = "-mmcu=atmega328p"
|
||||
passL = "-mmcu=atmega328p"
|
||||
passC = "-flto"
|
||||
passL = "-flto"
|
||||
cpu = "avr"
|
||||
deadCodeElim = "on"
|
||||
gc = "arc"
|
||||
13
tests/avr/panicoverride.nim
Normal file
13
tests/avr/panicoverride.nim
Normal file
@@ -0,0 +1,13 @@
|
||||
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) =
|
||||
rawoutput(s)
|
||||
exit(1)
|
||||
|
||||
{.pop.}
|
||||
6
tests/avr/thello.nim
Normal file
6
tests/avr/thello.nim
Normal file
@@ -0,0 +1,6 @@
|
||||
discard """
|
||||
cmd: "nim c --compileOnly --os:standalone --exceptions:quirky -d:noSignalHandler -d:danger $file"
|
||||
action: "compile"
|
||||
"""
|
||||
|
||||
echo "hi"
|
||||
Reference in New Issue
Block a user