summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-06 22:53:23 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:51 +0200
commit7aecaee20c48839256135f83a01a96f525f50321 (patch)
tree29db7499c12b6a1eba3737fd0e59c8169031a110 /tests
parentdbb2682ebe10a8a2ed86d8ec20c24b4ef117d60d (diff)
Use do_run_from_file() for test_llrint
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_llrint.in8
-rw-r--r--tests/core/test_llrint.out4
-rw-r--r--tests/test_core.py14
3 files changed, 17 insertions, 9 deletions
diff --git a/tests/core/test_llrint.in b/tests/core/test_llrint.in
new file mode 100644
index 00000000..cbba8a21
--- /dev/null
+++ b/tests/core/test_llrint.in
@@ -0,0 +1,8 @@
+
+ #include <stdio.h>
+ #include <math.h>
+ int main() {
+ printf("%lld\n%lld\n%lld\n%lld\n", llrint(0.1), llrint(0.6), llrint(1.25), llrint(1099511627776.667));
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_llrint.out b/tests/core/test_llrint.out
new file mode 100644
index 00000000..80e9c908
--- /dev/null
+++ b/tests/core/test_llrint.out
@@ -0,0 +1,4 @@
+0
+1
+1
+1099511627777
diff --git a/tests/test_core.py b/tests/test_core.py
index b524ff70..7a693f36 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -840,15 +840,11 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
def test_llrint(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('requires ta2')
- src = r'''
- #include <stdio.h>
- #include <math.h>
- int main() {
- printf("%lld\n%lld\n%lld\n%lld\n", llrint(0.1), llrint(0.6), llrint(1.25), llrint(1099511627776.667));
- return 0;
- }
- '''
- self.do_run(src, '0\n1\n1\n1099511627777\n')
+
+ test_path = path_from_root('tests', 'core', 'test_llrint')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output)
def test_getgep(self):
# Generated code includes getelementptr (getelementptr, 0, 1), i.e., GEP as the first param to GEP