summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/avr/nim.cfg12
-rw-r--r--tests/avr/panicoverride.nim13
-rw-r--r--tests/avr/thello.nim6
3 files changed, 31 insertions, 0 deletions
diff --git a/tests/avr/nim.cfg b/tests/avr/nim.cfg
new file mode 100644
index 000000000..d6eba8eda
--- /dev/null
+++ b/tests/avr/nim.cfg
@@ -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"
diff --git a/tests/avr/panicoverride.nim b/tests/avr/panicoverride.nim
new file mode 100644
index 000000000..770933ddd
--- /dev/null
+++ b/tests/avr/panicoverride.nim
@@ -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.}
diff --git a/tests/avr/thello.nim b/tests/avr/thello.nim
new file mode 100644
index 000000000..a0191815c
--- /dev/null
+++ b/tests/avr/thello.nim
@@ -0,0 +1,6 @@
+discard """
+  cmd: "nim c --compileOnly --os:standalone --exceptions:quirky -d:noSignalHandler -d:danger $file"
+  action: "compile"
+"""
+
+echo "hi"