summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-11-26 18:05:09 -0800
committerGitHub <noreply@github.com>2019-11-26 18:05:09 -0800
commitd15fe879834b0c58d2d4d8526cb428990f7b50a7 (patch)
treee7e05d655cdad2cb0f56b91f723207e430a02e47
parent5c81d48c70e62e11d9a8fd0fd8231fac10c3bf29 (diff)
downloadbinaryen-d15fe879834b0c58d2d4d8526cb428990f7b50a7.tar.gz
binaryen-d15fe879834b0c58d2d4d8526cb428990f7b50a7.tar.bz2
binaryen-d15fe879834b0c58d2d4d8526cb428990f7b50a7.zip
Remove vanilla tests (#2482)
These have not been used in years and seem outdated.
-rwxr-xr-xcheck.py47
-rw-r--r--test/wasm_backend/globals_only.cpp21
-rw-r--r--test/wasm_backend/globals_only.txt5
-rw-r--r--test/wasm_backend/hello_num_only.cpp10
-rw-r--r--test/wasm_backend/hello_num_only.txt1
-rw-r--r--test/wasm_backend/hello_world_only.cpp8
-rw-r--r--test/wasm_backend/hello_world_only.txt1
-rw-r--r--test/wasm_backend/hello_world_real.cpp6
-rw-r--r--test/wasm_backend/hello_world_real.txt1
-rw-r--r--test/wasm_backend/i64.load32_u.cpp16
-rw-r--r--test/wasm_backend/i64.load32_u.txt1
-rw-r--r--test/wasm_backend/i64_load.cpp15
-rw-r--r--test/wasm_backend/i64_load.txt4
-rw-r--r--test/wasm_backend/indirect_call_only.cpp50
-rw-r--r--test/wasm_backend/indirect_call_only.txt15
-rw-r--r--test/wasm_backend/unaligned_only.cpp70
-rw-r--r--test/wasm_backend/unaligned_only.txt15
17 files changed, 0 insertions, 286 deletions
diff --git a/check.py b/check.py
index 5973b8a3d..f43c117c7 100755
--- a/check.py
+++ b/check.py
@@ -386,52 +386,6 @@ def run_validator_tests():
support.run_command(cmd, expected_status=1)
-def run_vanilla_tests():
- if not (shared.has_vanilla_emcc and shared.has_vanilla_llvm and 0):
- print('\n[ skipping emcc WASM_BACKEND testcases...]\n')
- return
-
- print('\n[ checking emcc WASM_BACKEND testcases...]\n')
-
- try:
- if shared.has_vanilla_llvm:
- os.environ['LLVM'] = shared.BIN_DIR # use the vanilla LLVM
- else:
- # if we did not set vanilla llvm, then we must set this env var to make emcc use the wasm backend.
- # (if we are using vanilla llvm, things should just work)
- print('(not using vanilla llvm, so setting env var to tell emcc to use wasm backend)')
- os.environ['EMCC_WASM_BACKEND'] = '1'
- VANILLA_EMCC = os.path.join(shared.options.binaryen_test, 'emscripten', 'emcc')
- # run emcc to make sure it sets itself up properly, if it was never run before
- command = [VANILLA_EMCC, '-v']
- print('____' + ' '.join(command))
- subprocess.check_call(command)
-
- for c in shared.get_tests(shared.get_test_dir('wasm_backend'), '.cpp'):
- print('..', os.path.basename(c))
- base = c.replace('.cpp', '').replace('.c', '')
- expected = open(os.path.join(base + '.txt')).read()
- for opts in [[], ['-O1'], ['-O2']]:
- # only my code is a hack we used early in wasm backend dev, which somehow worked, but only with -O1
- only = [] if opts != ['-O1'] or '_only' not in base else ['-s', 'ONLY_MY_CODE=1']
- command = [VANILLA_EMCC, '-o', 'a.wasm.js', c] + opts + only
- print('....' + ' '.join(command))
- if os.path.exists('a.wasm.js'):
- os.unlink('a.wasm.js')
- subprocess.check_call(command)
- if shared.NODEJS:
- print(' (check in node)')
- cmd = [shared.NODEJS, 'a.wasm.js']
- out = support.run_command(cmd)
- if out.strip() != expected.strip():
- shared.fail(out, expected)
- finally:
- if shared.has_vanilla_llvm:
- del os.environ['LLVM']
- else:
- del os.environ['EMCC_WASM_BACKEND']
-
-
def run_gcc_tests():
print('\n[ checking native gcc testcases...]\n')
if not shared.NATIVECC or not shared.NATIVEXX:
@@ -515,7 +469,6 @@ TEST_SUITES = OrderedDict([
('lld', lld.test_wasm_emscripten_finalize),
('wasm2js', wasm2js.test_wasm2js),
('validator', run_validator_tests),
- ('vanilla', run_vanilla_tests),
('gcc', run_gcc_tests),
('unit', run_unittest),
])
diff --git a/test/wasm_backend/globals_only.cpp b/test/wasm_backend/globals_only.cpp
deleted file mode 100644
index 9a2f1bcc8..000000000
--- a/test/wasm_backend/globals_only.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <emscripten.h>
-
-char c = 10;
-short s = 20;
-int i = 55;
-
-void print(int v) {
- int *x = (int*)8;
- *x = v;
- EM_ASM({
- Module.print("print: " + HEAP32[8>>2]);
- });
-}
-
-int main() {
- print(1);
- print(c);
- print(s);
- print(i);
-}
-
diff --git a/test/wasm_backend/globals_only.txt b/test/wasm_backend/globals_only.txt
deleted file mode 100644
index 56248691d..000000000
--- a/test/wasm_backend/globals_only.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-print: 1
-print: 10
-print: 20
-print: 55
-
diff --git a/test/wasm_backend/hello_num_only.cpp b/test/wasm_backend/hello_num_only.cpp
deleted file mode 100644
index d272f11c6..000000000
--- a/test/wasm_backend/hello_num_only.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <emscripten.h>
-
-int main() {
- int *x = (int*)8;
- *x = 123;
- EM_ASM({
- Module.print("hello, world " + HEAP32[8>>2] + "!");
- });
-}
-
diff --git a/test/wasm_backend/hello_num_only.txt b/test/wasm_backend/hello_num_only.txt
deleted file mode 100644
index 9afd068a4..000000000
--- a/test/wasm_backend/hello_num_only.txt
+++ /dev/null
@@ -1 +0,0 @@
-hello, world 123!
diff --git a/test/wasm_backend/hello_world_only.cpp b/test/wasm_backend/hello_world_only.cpp
deleted file mode 100644
index a4a6a025d..000000000
--- a/test/wasm_backend/hello_world_only.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <emscripten.h>
-
-int main() {
- EM_ASM({
- Module.print("hello, world!");
- });
-}
-
diff --git a/test/wasm_backend/hello_world_only.txt b/test/wasm_backend/hello_world_only.txt
deleted file mode 100644
index 270c611ee..000000000
--- a/test/wasm_backend/hello_world_only.txt
+++ /dev/null
@@ -1 +0,0 @@
-hello, world!
diff --git a/test/wasm_backend/hello_world_real.cpp b/test/wasm_backend/hello_world_real.cpp
deleted file mode 100644
index 1e39e8bd4..000000000
--- a/test/wasm_backend/hello_world_real.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <stdio.h>
-
-int main() {
- printf("hello, world!\n");
-}
-
diff --git a/test/wasm_backend/hello_world_real.txt b/test/wasm_backend/hello_world_real.txt
deleted file mode 100644
index 270c611ee..000000000
--- a/test/wasm_backend/hello_world_real.txt
+++ /dev/null
@@ -1 +0,0 @@
-hello, world!
diff --git a/test/wasm_backend/i64.load32_u.cpp b/test/wasm_backend/i64.load32_u.cpp
deleted file mode 100644
index a53c93d86..000000000
--- a/test/wasm_backend/i64.load32_u.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdint.h>
-#include <stdio.h>
-
-volatile uint64_t x = 0x0101010101010101;
-volatile uint32_t u = 0xfefefefe;
-
-int main(void)
-{
- putchar('a' + (x >> 60));
-
- x = u; // i64.load32_u
-
- putchar('A' + (x >> 60));
- putchar('\n');
- return 0;
-}
diff --git a/test/wasm_backend/i64.load32_u.txt b/test/wasm_backend/i64.load32_u.txt
deleted file mode 100644
index 7ac5efc36..000000000
--- a/test/wasm_backend/i64.load32_u.txt
+++ /dev/null
@@ -1 +0,0 @@
-aA
diff --git a/test/wasm_backend/i64_load.cpp b/test/wasm_backend/i64_load.cpp
deleted file mode 100644
index a54b31650..000000000
--- a/test/wasm_backend/i64_load.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <stdint.h>
-#include <stdio.h>
-
-struct S1 { unsigned lo:32; unsigned mid:2; unsigned hi:30; };
-
-static struct S1 g_68 = { -1, 0, 0xbbe }; // 0xbbe = 3006
-
-extern "C" void emscripten_autodebug_i32(int32_t x, int32_t y);
-
-int main() {
- emscripten_autodebug_i32(0, g_68.lo);
- emscripten_autodebug_i32(1, g_68.mid);
- emscripten_autodebug_i32(2, g_68.hi);
- return 0;
-}
diff --git a/test/wasm_backend/i64_load.txt b/test/wasm_backend/i64_load.txt
deleted file mode 100644
index 119a531df..000000000
--- a/test/wasm_backend/i64_load.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-AD:0,-1
-AD:1,0
-AD:2,3006
-
diff --git a/test/wasm_backend/indirect_call_only.cpp b/test/wasm_backend/indirect_call_only.cpp
deleted file mode 100644
index ef52a4ad1..000000000
--- a/test/wasm_backend/indirect_call_only.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-#include <emscripten.h>
-
-void print(const char *prefix, int v) {
- int *x = (int*)8; // XXX this order is wrong!
- *x = (int)prefix;
- int *y = (int*)16;
- *y = v;
- EM_ASM({
- Module.print("print: " + Pointer_stringify(HEAP32[8>>2]) + " : " + HEAP32[16>>2]);
- });
-}
-
-void something() {
- print("something", 12);
-}
-
-void more() {
- print("more", -1);
-}
-
-void other(int x) {
- print("other", x + 40);
-}
-
-void yet(int x) {
- print("yet", x + 99);
-}
-
-typedef void (*v)();
-typedef void (*vi)(int);
-
-int main(int argc, char **argv) {
- print("argc", argc);
- v f1[4] = { something, more, something, more };
- print("addr of something", (int)&something);
- print("addr of more", (int)&more);
- for (int i = 0; i < 4 && i < argc*4; i++) {
- print("i", i);
- v curr = f1[i];
- //print("curr address to call", (int)curr);
- curr();
- }
- vi f2[4] = { other, yet, other, yet };
- for (int i = 0; i < 4 && i < argc*4; i++) {
- vi curr = f2[i];
- //print("curr", (int)curr);
- curr(i);
- }
-}
-
diff --git a/test/wasm_backend/indirect_call_only.txt b/test/wasm_backend/indirect_call_only.txt
deleted file mode 100644
index 0927c1885..000000000
--- a/test/wasm_backend/indirect_call_only.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-print: argc : 1
-print: addr of something : 1
-print: addr of more : 2
-print: i : 0
-print: something : 12
-print: i : 1
-print: more : -1
-print: i : 2
-print: something : 12
-print: i : 3
-print: more : -1
-print: other : 40
-print: yet : 100
-print: other : 42
-print: yet : 102
diff --git a/test/wasm_backend/unaligned_only.cpp b/test/wasm_backend/unaligned_only.cpp
deleted file mode 100644
index 75f8b419b..000000000
--- a/test/wasm_backend/unaligned_only.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-#include <stdint.h>
-#include <emscripten.h>
-
-void print(int v) {
- int *x = (int*)8;
- *x = v;
- EM_ASM({
- Module.print("print: " + HEAP32[8>>2]);
- });
-}
-
-char buffer[8];
-
-int main() {
- {
- volatile int16_t* x;
- x = (int16_t*)&buffer[0];
- *x = 0x1234;
- print(*x);
- x = (int16_t*)&buffer[1];
- *x = 0x2345;
- print(*x);
- }
- {
- volatile int32_t* x;
- x = (int32_t*)&buffer[0];
- *x = 0x12345678;
- print(*x);
- x = (int32_t*)&buffer[1];
- *x = 0x23456789;
- print(*x);
- x = (int32_t*)&buffer[2];
- *x = 0x3456789a;
- print(*x);
- x = (int32_t*)&buffer[3];
- *x = 0x456789ab;
- print(*x);
- }
- {
- volatile float* x;
- x = (float*)&buffer[0];
- *x = -0x12345678;
- print(*x);
- x = (float*)&buffer[1];
- *x = -0x12345678;
- print(*x);
- x = (float*)&buffer[2];
- *x = -0x12345678;
- print(*x);
- x = (float*)&buffer[3];
- *x = -0x12345678;
- print(*x);
- }
- {
- volatile double* x;
- x = (double*)&buffer[0];
- *x = -1;
- print(*x);
- x = (double*)&buffer[1];
- *x = -2;
- print(*x);
- x = (double*)&buffer[2];
- *x = -3;
- print(*x);
- x = (double*)&buffer[3];
- *x = -4;
- print(*x);
- }
-}
-
diff --git a/test/wasm_backend/unaligned_only.txt b/test/wasm_backend/unaligned_only.txt
deleted file mode 100644
index 15ca033cf..000000000
--- a/test/wasm_backend/unaligned_only.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-print: 4660
-print: 9029
-print: 305419896
-print: 591751049
-print: 878082202
-print: 1164413355
-print: -305419904
-print: -305419904
-print: -305419904
-print: -305419904
-print: -1
-print: -2
-print: -3
-print: -4
-