From 452e266cd6b7e91abc983ebfe0f93d1d4e68f7d7 Mon Sep 17 00:00:00 2001 From: Dylan McKay Date: Wed, 14 Dec 2016 12:03:39 +0000 Subject: [PATCH] [AVR] Add the very first on-target test This test runs on actual AVR hardware. llvm-svn: 289648 --- llvm/test/Metal/AVR/README.md | 6 ++++++ llvm/test/Metal/AVR/basic.ll | 7 +++++++ llvm/test/Metal/AVR/lit.local.cfg | 8 ++++++++ llvm/utils/lit/lit/TestingConfig.py | 2 +- 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 llvm/test/Metal/AVR/README.md create mode 100644 llvm/test/Metal/AVR/basic.ll create mode 100644 llvm/test/Metal/AVR/lit.local.cfg diff --git a/llvm/test/Metal/AVR/README.md b/llvm/test/Metal/AVR/README.md new file mode 100644 index 0000000..4b76251 --- /dev/null +++ b/llvm/test/Metal/AVR/README.md @@ -0,0 +1,6 @@ +# AVR on-target tests + +These tests are built using LLVM and executed on real AVR hardware. + +See [avrlit](https://github.com/avr-llvm/avrlit) for instructions on how +to run them. diff --git a/llvm/test/Metal/AVR/basic.ll b/llvm/test/Metal/AVR/basic.ll new file mode 100644 index 0000000..eb67576 --- /dev/null +++ b/llvm/test/Metal/AVR/basic.ll @@ -0,0 +1,7 @@ +; RUN: avrlit %s + +; CHECK-LABEL: test +define i16 @test() { + ; CHECK-NEXT: return 1357 + ret i16 1357 +} diff --git a/llvm/test/Metal/AVR/lit.local.cfg b/llvm/test/Metal/AVR/lit.local.cfg new file mode 100644 index 0000000..57427d7 --- /dev/null +++ b/llvm/test/Metal/AVR/lit.local.cfg @@ -0,0 +1,8 @@ +import os + +if not 'AVR' in config.root.targets: + config.unsupported = True + +# We can only run avrlit tests if we have a board set up. +if not os.environ["AVRLIT_PORT"] or not os.environ["AVRLIT_BOARD"]: + config.unsupported = True diff --git a/llvm/utils/lit/lit/TestingConfig.py b/llvm/utils/lit/lit/TestingConfig.py index d2389dc..717b53c 100644 --- a/llvm/utils/lit/lit/TestingConfig.py +++ b/llvm/utils/lit/lit/TestingConfig.py @@ -25,7 +25,7 @@ class TestingConfig: 'LD_PRELOAD', 'ASAN_OPTIONS', 'UBSAN_OPTIONS', 'LSAN_OPTIONS', 'ADB', 'ANDROID_SERIAL', 'SANITIZER_IGNORE_CVE_2016_2143', 'TMPDIR', 'TMP', 'TEMP', - 'TEMPDIR'] + 'TEMPDIR', 'AVRLIT_BOARD', 'AVRLIT_PORT'] for var in pass_vars: val = os.environ.get(var, '') # Check for empty string as some variables such as LD_PRELOAD cannot be empty -- 2.7.4