mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00

* Fix issue 11051 Keep a HALT instruction in a final switch statement if the function is @safe and -release mode is enabled. * @system -release test should also be non-zero * don't suppress test errors * Remove unreported error line * Disable core dumps Co-authored-by: Andrej Mitrovic <andrej.mitrovich@gmail.com>
29 lines
629 B
Bash
Executable file
29 lines
629 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# tests various @safe behavior for final switches in
|
|
# -release and non-release builds
|
|
|
|
src_file=runnable/extra-files/test11051.d
|
|
|
|
die()
|
|
{
|
|
echo "test_safe_final_switch.sh error: test #$1 failed"
|
|
exit 1
|
|
}
|
|
|
|
# some tests cause a core dump rather than throwing an Error
|
|
ulimit -c 0
|
|
|
|
# returns 1 (failure)
|
|
$DMD -run ${src_file} 2> /dev/null && die 1
|
|
|
|
# returns 1 (failure)
|
|
$DMD -release -run ${src_file} 2> /dev/null && die 2
|
|
|
|
# returns 1 (failure)
|
|
$DMD -version=Safe -run ${src_file} 2> /dev/null && die 3
|
|
|
|
# returns 1 (failure)
|
|
$DMD -release -version=Safe -run ${src_file} 2> /dev/null && die 4
|
|
|
|
exit 0
|