From 3ed41c304dc5f166e5b82a81c1d7f2c2ef9113aa Mon Sep 17 00:00:00 2001 From: Geod24 Date: Wed, 6 Jan 2021 16:04:25 +0900 Subject: Remove failing tests with llvm-libunwind The GDB tests are problematic on Musl (GDB seems to have issues), and regarding eh.d, we just disable one failing test, when multiple exceptions are thrown and -O is used. --- test/runnable/eh.d | 6 ++++++ test/runnable/gdb1.d | 16 ---------------- test/runnable/gdb10311.d | 20 -------------------- test/runnable/gdb14225.d | 18 ------------------ test/runnable/gdb14276.d | 22 ---------------------- test/runnable/gdb14313.d | 22 ---------------------- test/runnable/gdb14330.d | 21 --------------------- test/runnable/gdb4149.d | 24 ------------------------ test/runnable/gdb4181.d | 23 ----------------------- 9 files changed, 6 insertions(+), 166 deletions(-) delete mode 100644 test/runnable/gdb1.d delete mode 100644 test/runnable/gdb10311.d delete mode 100644 test/runnable/gdb14225.d delete mode 100644 test/runnable/gdb14276.d delete mode 100644 test/runnable/gdb14313.d delete mode 100644 test/runnable/gdb14330.d delete mode 100644 test/runnable/gdb4149.d delete mode 100644 test/runnable/gdb4181.d diff --git a/dmd/test/runnable/eh.d b/dmd/test/runnable/eh.d index 7e7ec19eb..deb68ae4e 100644 --- a/dmd/test/runnable/eh.d +++ b/dmd/test/runnable/eh.d @@ -475,6 +475,11 @@ void collideone() void doublecollide() { + // Note: This SEGV on Musl when using libunwind directly + // However, when not using libunwin, everything else SEGV. + // It only triggers when more than two Exceptions are thrown + // and `-O` is used, so it's rather rare in practice. + version (none) { try { try @@ -501,6 +506,7 @@ void doublecollide() assert(e.next.next.next.msg == "y"); assert(!e.next.next.next.next); } + } } void collidetwo() diff --git a/dmd/test/runnable/gdb1.d b/dmd/test/runnable/gdb1.d deleted file mode 100644 index 2dc506131..000000000 --- a/dmd/test/runnable/gdb1.d +++ /dev/null @@ -1,16 +0,0 @@ -/* -REQUIRED_ARGS: -g -PERMUTE_ARGS: -GDB_SCRIPT: ---- -b gdb1.d:15 -r ARG1 ARG2 -echo RESULT= -p args ---- -GDB_MATCH: RESULT=.*ARG1.*ARG2 -*/ -void main(string[] args) -{ - // BP -} diff --git a/dmd/test/runnable/gdb10311.d b/dmd/test/runnable/gdb10311.d deleted file mode 100644 index 57b040bd9..000000000 --- a/dmd/test/runnable/gdb10311.d +++ /dev/null @@ -1,20 +0,0 @@ -/* -REQUIRED_ARGS: -g -PERMUTE_ARGS: -GDB_SCRIPT: ---- -b gdb10311.d:19 -r -echo RESULT= -p x ---- -GDB_MATCH: RESULT=.*33 -*/ -void call(void delegate() dg) { dg(); } - -void main() -{ - int x=32; - call({++x;}); - // BP -} diff --git a/dmd/test/runnable/gdb14225.d b/dmd/test/runnable/gdb14225.d deleted file mode 100644 index a97b0424d..000000000 --- a/dmd/test/runnable/gdb14225.d +++ /dev/null @@ -1,18 +0,0 @@ -/* -REQUIRED_ARGS: -g -PERMUTE_ARGS: -GDB_SCRIPT: ---- -b gdb14225.d:17 -r -echo RESULT= -p lok ---- -GDB_MATCH: RESULT=.*Something -*/ -void main() -{ - string lok = "Something"; - auto chars = "Anything".dup; - // BP -} diff --git a/dmd/test/runnable/gdb14276.d b/dmd/test/runnable/gdb14276.d deleted file mode 100644 index ab57427aa..000000000 --- a/dmd/test/runnable/gdb14276.d +++ /dev/null @@ -1,22 +0,0 @@ -/* -REQUIRED_ARGS: -g -PERMUTE_ARGS: -GDB_SCRIPT: ---- -b gdb14276.d:21 -r -echo RESULT= -p v[0] + v[1] + v[2] + v[3] ---- -GDB_MATCH: RESULT=.*1234 -*/ -import core.simd; - -void main() -{ - version (X86_64) - int4 v = [1000, 200, 30, 4]; - else - int[4] v = [1000, 200, 30, 4]; - // BP -} diff --git a/dmd/test/runnable/gdb14313.d b/dmd/test/runnable/gdb14313.d deleted file mode 100644 index 369ba29d7..000000000 --- a/dmd/test/runnable/gdb14313.d +++ /dev/null @@ -1,22 +0,0 @@ -/* -REQUIRED_ARGS: -g -PERMUTE_ARGS: -GDB_SCRIPT: ---- -b gdb14313.d:21 -r -echo RESULT= -p 'gdb.x' + 'gdb.y' ---- -GDB_MATCH: RESULT=.*4000065002 -*/ -module gdb; - -__gshared uint x = 4_000_000_000; -__gshared ushort y = 65000; - -void main() -{ - ++x; ++y; - // BP -} diff --git a/dmd/test/runnable/gdb14330.d b/dmd/test/runnable/gdb14330.d deleted file mode 100644 index ded690a53..000000000 --- a/dmd/test/runnable/gdb14330.d +++ /dev/null @@ -1,21 +0,0 @@ -/* -REQUIRED_ARGS: -g -PERMUTE_ARGS: -GDB_SCRIPT: ---- -b gdb14330.d:20 -r -echo RESULT= -p str ---- -GDB_MATCH: RESULT=.*something -*/ -module gdb; - -__gshared ulong x; - -void main() -{ - string str = "something"; - // BP -} diff --git a/dmd/test/runnable/gdb4149.d b/dmd/test/runnable/gdb4149.d deleted file mode 100644 index 9a29b3c75..000000000 --- a/dmd/test/runnable/gdb4149.d +++ /dev/null @@ -1,24 +0,0 @@ -/* -REQUIRED_ARGS: -g -PERMUTE_ARGS: -GDB_SCRIPT: ---- -b gdb4149.d:17 -r -echo RESULT= -p x ---- -GDB_MATCH: RESULT=.*33 -*/ - -void foo(ref int x) -{ - ++x; - // BP -} - -void main() -{ - auto x = 32; - foo(x); -} diff --git a/dmd/test/runnable/gdb4181.d b/dmd/test/runnable/gdb4181.d deleted file mode 100644 index a859bdded..000000000 --- a/dmd/test/runnable/gdb4181.d +++ /dev/null @@ -1,23 +0,0 @@ -/* -REQUIRED_ARGS: -g -PERMUTE_ARGS: -GDB_SCRIPT: ---- -b gdb4181.d:22 -r -echo RESULT= -p 'gdb.x' + 'gdb.STest.y' ---- -GDB_MATCH: RESULT=.*33 -*/ -module gdb; - -int x; -struct STest { static int y; } - -void main() -{ - x = 11; - STest.y = 22; - // BP -} diff --git a/dmd/test/runnable/test17559.d b/dmd/test/runnable/test17559.d deleted file mode 100644 index a759f1564..000000000 --- a/dmd/test/runnable/test17559.d +++ /dev/null @@ -1,84 +0,0 @@ -// REQUIRED_ARGS: -g -// REQUIRED_ARGS(linux freebsd dragonflybsd): -L-export-dynamic -// PERMUTE_ARGS: -// DISABLED: osx - -import core.stdc.stdio; - -void main() -{ - fun(1); - fun(2); - fun(3); -#line 30 - fun(4); - - foo(1, 10); - foo(2, 10); - foo(3, 10); -#line 40 - foo(4, 10); -} - -void fun(int n, int defParam = 10) -{ - try - { - if (n == 4) - throw new Exception("fun"); - } - catch(Exception e) - { - string s = e.toString(); - printf("%.*s\n", cast(int)s.length, s.ptr); - int line = lineInMain(e.toString()); - assert(line >= 30 && line <= 32); // return address might be next statement - } -} - -void foo(int n, int m) -{ - try - { - if (n == 4) - throw new Exception("foo"); - } - catch(Exception e) - { - string s = e.toString(); - printf("%.*s\n", cast(int)s.length, s.ptr); - int line = lineInMain(e.toString()); - assert(line >= 40 && line <= 41); // return address might be next statement - } -} - -int lineInMain(string msg) -{ - // find line number of _Dmain in stack trace - // on linux: file.d:line _Dmain [addr] - // on windows: addr in _Dmain at file.d(line) - int line = 0; - bool mainFound = false; - for (size_t pos = 0; pos + 6 < msg.length; pos++) - { - if (msg[pos] == '\n') - { - line = 0; - mainFound = false; - } - else if ((msg[pos] == ':' || msg[pos] == '(') && line == 0) - { - for (pos++; pos < msg.length && msg[pos] >= '0' && msg[pos] <= '9'; pos++) - line = line * 10 + msg[pos] - '0'; - if (line > 0 && mainFound) - return line; - } - else if (msg[pos .. pos + 6] == "_Dmain" || msg[pos .. pos + 6] == "D main") - { - mainFound = true; - if (line > 0 && mainFound) - return line; - } - } - return 0; -} diff --git a/dmd/test/runnable/test19086.d b/dmd/test/runnable/test19086.d deleted file mode 100644 index 04e524e4a..000000000 --- a/dmd/test/runnable/test19086.d +++ /dev/null @@ -1,64 +0,0 @@ -// REQUIRED_ARGS: -g -// REQUIRED_ARGS(linux freebsd dragonflybsd): -L-export-dynamic -// PERMUTE_ARGS: -// DISABLED: osx - -void run19086() -{ - long x = 1; - int y = 0; -#line 20 - throw newException(); -} - -// moved here to keep run19086 short -Exception newException() { return new Exception("hi"); } - -void test19086() -{ - try - { - run19086(); - } - catch(Exception e) - { - int line = findLineStackTrace(e.toString(), "run19086"); - assert(line >= 20 && line <= 21); - } -} - -int findLineStackTrace(string msg, string func) -{ - // find line number of _Dmain in stack trace - // on linux: file.d:line _Dmain [addr] - // on windows: addr in _Dmain at file.d(line) - int line = 0; - bool found = false; - for (size_t pos = 0; pos + func.length < msg.length; pos++) - { - if (msg[pos] == '\n') - { - line = 0; - found = false; - } - else if ((msg[pos] == ':' || msg[pos] == '(') && line == 0) - { - for (pos++; pos < msg.length && msg[pos] >= '0' && msg[pos] <= '9'; pos++) - line = line * 10 + msg[pos] - '0'; - if (line > 0 && found) - return line; - } - else if (msg[pos .. pos + func.length] == func) - { - found = true; - if (line > 0 && found) - return line; - } - } - return 0; -} - -void main() -{ - test19086(); -}