summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/core/test_llvm_used.in14
-rw-r--r--tests/core/test_llvm_used.out1
-rw-r--r--tests/test_core.py21
3 files changed, 20 insertions, 16 deletions
diff --git a/tests/core/test_llvm_used.in b/tests/core/test_llvm_used.in
new file mode 100644
index 00000000..e40ae09e
--- /dev/null
+++ b/tests/core/test_llvm_used.in
@@ -0,0 +1,14 @@
+
+ #include <stdio.h>
+ #include <emscripten.h>
+
+ extern "C" {
+ EMSCRIPTEN_KEEPALIVE void foobar(int x) {
+ printf("Worked! %d\n", x);
+ }
+ }
+
+ int main() {
+ emscripten_run_script("Module['_foobar'](10)");
+ return 0;
+ } \ No newline at end of file
diff --git a/tests/core/test_llvm_used.out b/tests/core/test_llvm_used.out
new file mode 100644
index 00000000..87ef2612
--- /dev/null
+++ b/tests/core/test_llvm_used.out
@@ -0,0 +1 @@
+Worked! 10
diff --git a/tests/test_core.py b/tests/test_core.py
index c065a993..0b3d4ea5 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1848,23 +1848,12 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
assert process.returncode is 0, 'float.h should agree with our system'
def test_llvm_used(self):
- src = r'''
- #include <stdio.h>
- #include <emscripten.h>
-
- extern "C" {
- EMSCRIPTEN_KEEPALIVE void foobar(int x) {
- printf("Worked! %d\n", x);
- }
- }
-
- int main() {
- emscripten_run_script("Module['_foobar'](10)");
- return 0;
- }'''
-
Building.LLVM_OPTS = 3
- self.do_run(src, 'Worked! 10\n')
+
+ test_path = path_from_root('tests', 'core', 'test_llvm_used')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output)
def test_emscripten_api(self):
#if Settings.MICRO_OPTS or Settings.RELOOP or Building.LLVM_OPTS: return self.skip('FIXME')