From 1214c97666139d06fd1d1301af05844f7771f377 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 11 Nov 2021 00:29:41 -0500 Subject: [PATCH] sim: testsuite: initial support for OS-specific tests We usually test against the newlib/libgloss environment, but for a few ports that also support Linux apps, we want to test that logic too. A lot of the C code is written such that it works with either newlib/libgloss or glibc/linux toolchains, but we have some tests that end up being Linux-specific. Cris has been using the target tuple as a rough proxy for this (where cris*-*-elf is assumed to be newlib/libgloss, and everything else is glibc/linux), but that is a bit too rough, and it doesn't work in a multitarget build. So lets create a few stub files that we can do compile tests with to detect the different setups, and then let tests declare which one they require (if they require any at all). --- sim/testsuite/cris/c/access1.c | 2 +- sim/testsuite/cris/c/badldso1.c | 2 +- sim/testsuite/cris/c/badldso2.c | 2 +- sim/testsuite/cris/c/badldso3.c | 2 +- sim/testsuite/cris/c/c.exp | 7 ++++++ sim/testsuite/cris/c/clone1.c | 2 +- sim/testsuite/cris/c/clone2.c | 2 +- sim/testsuite/cris/c/clone3.c | 2 +- sim/testsuite/cris/c/clone4.c | 2 +- sim/testsuite/cris/c/clone5.c | 2 +- sim/testsuite/cris/c/clone6.c | 2 +- sim/testsuite/cris/c/ex1.c | 2 +- sim/testsuite/cris/c/exitg1.c | 2 +- sim/testsuite/cris/c/exitg2.c | 2 +- sim/testsuite/cris/c/fcntl1.c | 2 +- sim/testsuite/cris/c/fcntl2.c | 2 +- sim/testsuite/cris/c/ftruncate1.c | 2 +- sim/testsuite/cris/c/ftruncate2.c | 2 +- sim/testsuite/cris/c/getcwd1.c | 2 +- sim/testsuite/cris/c/hellodyn3.c | 2 +- sim/testsuite/cris/c/mmap1.c | 2 +- sim/testsuite/cris/c/mmap2.c | 2 +- sim/testsuite/cris/c/mmap3.c | 2 +- sim/testsuite/cris/c/mmap4.c | 2 +- sim/testsuite/cris/c/mmap5.c | 2 +- sim/testsuite/cris/c/mmap6.c | 2 +- sim/testsuite/cris/c/mmap7.c | 2 +- sim/testsuite/cris/c/mmap8.c | 2 +- sim/testsuite/cris/c/mprotect1.c | 2 +- sim/testsuite/cris/c/mprotect2.c | 2 +- sim/testsuite/cris/c/openpf5.c | 2 +- sim/testsuite/cris/c/pipe1.c | 2 +- sim/testsuite/cris/c/pipe2.c | 2 +- sim/testsuite/cris/c/pipe3.c | 2 +- sim/testsuite/cris/c/pipe4.c | 2 +- sim/testsuite/cris/c/pipe5.c | 2 +- sim/testsuite/cris/c/pipe6.c | 2 +- sim/testsuite/cris/c/pipe7.c | 2 +- sim/testsuite/cris/c/readlink1.c | 2 +- sim/testsuite/cris/c/readlink10.c | 2 +- sim/testsuite/cris/c/readlink11.c | 2 +- sim/testsuite/cris/c/readlink2.c | 2 +- sim/testsuite/cris/c/readlink3.c | 2 +- sim/testsuite/cris/c/readlink4.c | 2 +- sim/testsuite/cris/c/readlink5.c | 2 +- sim/testsuite/cris/c/readlink6.c | 2 +- sim/testsuite/cris/c/readlink7.c | 2 +- sim/testsuite/cris/c/readlink8.c | 2 +- sim/testsuite/cris/c/readlink9.c | 2 +- sim/testsuite/cris/c/rtsigprocmask1.c | 2 +- sim/testsuite/cris/c/rtsigprocmask2.c | 2 +- sim/testsuite/cris/c/rtsigsuspend1.c | 2 +- sim/testsuite/cris/c/rtsigsuspend2.c | 2 +- sim/testsuite/cris/c/sched1.c | 2 +- sim/testsuite/cris/c/sched2.c | 2 +- sim/testsuite/cris/c/sched3.c | 2 +- sim/testsuite/cris/c/sched4.c | 2 +- sim/testsuite/cris/c/sched5.c | 2 +- sim/testsuite/cris/c/sched6.c | 2 +- sim/testsuite/cris/c/sched7.c | 2 +- sim/testsuite/cris/c/sched8.c | 2 +- sim/testsuite/cris/c/sched9.c | 2 +- sim/testsuite/cris/c/setrlimit1.c | 2 +- sim/testsuite/cris/c/settls1.c | 2 +- sim/testsuite/cris/c/sig10.c | 2 +- sim/testsuite/cris/c/sig11.c | 2 +- sim/testsuite/cris/c/sig12.c | 2 +- sim/testsuite/cris/c/sig13.c | 2 +- sim/testsuite/cris/c/sig2.c | 2 +- sim/testsuite/cris/c/sig4.c | 2 +- sim/testsuite/cris/c/sig6.c | 2 +- sim/testsuite/cris/c/sig7.c | 2 +- sim/testsuite/cris/c/sig9.c | 2 +- sim/testsuite/cris/c/sigreturn1.c | 2 +- sim/testsuite/cris/c/sigreturn2.c | 2 +- sim/testsuite/cris/c/sigreturn3.c | 2 +- sim/testsuite/cris/c/sigreturn4.c | 2 +- sim/testsuite/cris/c/sock1.c | 2 +- sim/testsuite/cris/c/stat2.c | 2 +- sim/testsuite/cris/c/stat4.c | 2 +- sim/testsuite/cris/c/stat5.c | 2 +- sim/testsuite/cris/c/stat7.c | 2 +- sim/testsuite/cris/c/stat8.c | 2 +- sim/testsuite/cris/c/syscall1.c | 2 +- sim/testsuite/cris/c/syscall2.c | 2 +- sim/testsuite/cris/c/syscall3.c | 2 +- sim/testsuite/cris/c/syscall4.c | 2 +- sim/testsuite/cris/c/syscall5.c | 2 +- sim/testsuite/cris/c/syscall6.c | 2 +- sim/testsuite/cris/c/syscall7.c | 2 +- sim/testsuite/cris/c/syscall8.c | 2 +- sim/testsuite/cris/c/sysctl1.c | 2 +- sim/testsuite/cris/c/sysctl2.c | 2 +- sim/testsuite/cris/c/sysctl3.c | 2 +- sim/testsuite/cris/c/thread2.c | 2 +- sim/testsuite/cris/c/thread3.c | 2 +- sim/testsuite/cris/c/thread4.c | 2 +- sim/testsuite/cris/c/thread5.c | 2 +- sim/testsuite/cris/c/truncate1.c | 2 +- sim/testsuite/cris/c/truncate2.c | 2 +- sim/testsuite/cris/c/ugetrlimit1.c | 2 +- sim/testsuite/cris/c/uname1.c | 2 +- sim/testsuite/cris/c/writev1.c | 2 +- sim/testsuite/cris/c/writev2.c | 2 +- sim/testsuite/lib/linuxcheck.c | 9 ++++++++ sim/testsuite/lib/newlibcheck.c | 10 ++++++++ sim/testsuite/lib/sim-defs.exp | 33 +++++++++++++++++++++++---- 107 files changed, 158 insertions(+), 107 deletions(-) create mode 100644 sim/testsuite/lib/linuxcheck.c create mode 100644 sim/testsuite/lib/newlibcheck.c diff --git a/sim/testsuite/cris/c/access1.c b/sim/testsuite/cris/c/access1.c index ba9be34a1b8..10a47ea1695 100644 --- a/sim/testsuite/cris/c/access1.c +++ b/sim/testsuite/cris/c/access1.c @@ -1,5 +1,5 @@ /* Check access(2) trivially. Newlib doesn't have it. -#notarget: cris*-*-elf +#progos: linux */ #include #include diff --git a/sim/testsuite/cris/c/badldso1.c b/sim/testsuite/cris/c/badldso1.c index 70414b536d2..fbd320cd5db 100644 --- a/sim/testsuite/cris/c/badldso1.c +++ b/sim/testsuite/cris/c/badldso1.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux #xerror: #output: *: could not load ELF interpreter `*' for program `*'\n */ diff --git a/sim/testsuite/cris/c/badldso2.c b/sim/testsuite/cris/c/badldso2.c index 92efc138c56..2f58bff8c81 100644 --- a/sim/testsuite/cris/c/badldso2.c +++ b/sim/testsuite/cris/c/badldso2.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux #xerror: #cc: additional_flags=-Wl,-dynamic-linker,/dev/null #output: *: could not load ELF interpreter `*' for program `*'\n diff --git a/sim/testsuite/cris/c/badldso3.c b/sim/testsuite/cris/c/badldso3.c index f827e771a9c..7039ad42a1d 100644 --- a/sim/testsuite/cris/c/badldso3.c +++ b/sim/testsuite/cris/c/badldso3.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux #xerror: #cc: additional_flags=-Wl,-dynamic-linker,/compilercheck.x #sim: --sysroot=$pwd diff --git a/sim/testsuite/cris/c/c.exp b/sim/testsuite/cris/c/c.exp index dfafa003bf5..e43259434bc 100644 --- a/sim/testsuite/cris/c/c.exp +++ b/sim/testsuite/cris/c/c.exp @@ -34,6 +34,7 @@ if [istarget cris*-*-elf] { # Using target_compile, since it is less noisy, global global_cc_works +global global_cc_os if { $global_cc_works == 1 } { # Now check if we can link a program dynamically, and where # libc.so is located. If it is, we provide a sym link to the @@ -103,6 +104,7 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { set opts(sim) "" set opts(output) "" set opts(progoptions) "" + set opts(progos) "" set opts(timeout) "" set opts(mach) "" set opts(xerror) "no" @@ -164,6 +166,11 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { continue } + if { $opts(progos) != "" && $opts(progos) != $global_cc_os } { + untested $testname + continue + } + # If no machine specific options, default to the general version. if ![info exists opts(sim,$mach)] { set opts(sim,$mach) $opts(sim) diff --git a/sim/testsuite/cris/c/clone1.c b/sim/testsuite/cris/c/clone1.c index 163b18647a8..9c4cca42545 100644 --- a/sim/testsuite/cris/c/clone1.c +++ b/sim/testsuite/cris/c/clone1.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux #output: got: a\nthen: bc\nexit: 0\n */ diff --git a/sim/testsuite/cris/c/clone2.c b/sim/testsuite/cris/c/clone2.c index aaa0873b640..88a984fe8a6 100644 --- a/sim/testsuite/cris/c/clone2.c +++ b/sim/testsuite/cris/c/clone2.c @@ -1,5 +1,5 @@ /* Make sure the thread system trivially works with trace output. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-trace=basic --trace-file=$pwd/clone2.tmp #output: got: a\nthen: bc\nexit: 0\n */ diff --git a/sim/testsuite/cris/c/clone3.c b/sim/testsuite/cris/c/clone3.c index 0a97484adac..6c5b8813f08 100644 --- a/sim/testsuite/cris/c/clone3.c +++ b/sim/testsuite/cris/c/clone3.c @@ -1,5 +1,5 @@ /* Check that exiting from a parent thread does not kill the child. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/clone4.c b/sim/testsuite/cris/c/clone4.c index 81489ddc419..c2e684ca871 100644 --- a/sim/testsuite/cris/c/clone4.c +++ b/sim/testsuite/cris/c/clone4.c @@ -1,5 +1,5 @@ /* Check that TRT happens when we reach the #threads implementation limit. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/clone5.c b/sim/testsuite/cris/c/clone5.c index 9380a1ea5aa..5cd16446666 100644 --- a/sim/testsuite/cris/c/clone5.c +++ b/sim/testsuite/cris/c/clone5.c @@ -1,5 +1,5 @@ /* Check that unimplemented clone syscalls get the right treatment. -#notarget: cris*-*-elf +#progos: linux #xerror: #output: Unimplemented clone syscall * #output: program stopped with signal 4 (*).\n diff --git a/sim/testsuite/cris/c/clone6.c b/sim/testsuite/cris/c/clone6.c index 586b5c67378..9ecd4894347 100644 --- a/sim/testsuite/cris/c/clone6.c +++ b/sim/testsuite/cris/c/clone6.c @@ -1,5 +1,5 @@ /* As the included file, but specifying silent ENOSYS. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=enosys-quiet #output: ENOSYS\n #output: xyzzy\n diff --git a/sim/testsuite/cris/c/ex1.c b/sim/testsuite/cris/c/ex1.c index 2447319f71a..ea239c2ad4b 100644 --- a/sim/testsuite/cris/c/ex1.c +++ b/sim/testsuite/cris/c/ex1.c @@ -1,5 +1,5 @@ /* Compiler options: -#notarget: cris*-*-elf +#progos: linux #cc: additional_flags=-pthread #output: Starting process a\naaaaaaaaStarting process b\nababbbbbbbbb diff --git a/sim/testsuite/cris/c/exitg1.c b/sim/testsuite/cris/c/exitg1.c index 0b4c425b3e6..acaad922e4b 100644 --- a/sim/testsuite/cris/c/exitg1.c +++ b/sim/testsuite/cris/c/exitg1.c @@ -1,7 +1,7 @@ /* Check exit_group(2) trivially. Newlib doesn't have it and the pre-v32 glibc requires updated headers we'd have to check or adjust for. -#notarget: cris-*-* *-*-elf +#progos: linux #output: exit_group\n */ #include diff --git a/sim/testsuite/cris/c/exitg2.c b/sim/testsuite/cris/c/exitg2.c index e222cc4707b..e5b0be73854 100644 --- a/sim/testsuite/cris/c/exitg2.c +++ b/sim/testsuite/cris/c/exitg2.c @@ -1,5 +1,5 @@ /* Check exit_group(2) trivially with non-zero status. -#notarget: cris-*-* *-*-elf +#progos: linux #output: exit_group\n #xerror: */ diff --git a/sim/testsuite/cris/c/fcntl1.c b/sim/testsuite/cris/c/fcntl1.c index 032f6b50198..7c050182097 100644 --- a/sim/testsuite/cris/c/fcntl1.c +++ b/sim/testsuite/cris/c/fcntl1.c @@ -1,5 +1,5 @@ /* Check that we get the expected message for unsupported fcntl calls. -#notarget: cris*-*-elf +#progos: linux #xerror: #output: Unimplemented fcntl* #output: program stopped with signal 4 (*).\n diff --git a/sim/testsuite/cris/c/fcntl2.c b/sim/testsuite/cris/c/fcntl2.c index fc9f95b688d..5298e7a277c 100644 --- a/sim/testsuite/cris/c/fcntl2.c +++ b/sim/testsuite/cris/c/fcntl2.c @@ -1,5 +1,5 @@ /* As the included file, but specifying silent ENOSYS. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=enosys-quiet #output: ENOSYS\n #output: xyzzy\n diff --git a/sim/testsuite/cris/c/ftruncate1.c b/sim/testsuite/cris/c/ftruncate1.c index 46b8756705c..cc213b83a24 100644 --- a/sim/testsuite/cris/c/ftruncate1.c +++ b/sim/testsuite/cris/c/ftruncate1.c @@ -1,5 +1,5 @@ /* Check that the ftruncate syscall works trivially. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/ftruncate2.c b/sim/testsuite/cris/c/ftruncate2.c index f1ef18c6aa6..712c185c754 100644 --- a/sim/testsuite/cris/c/ftruncate2.c +++ b/sim/testsuite/cris/c/ftruncate2.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ /* Check that we get a proper error indication if trying ftruncate on a diff --git a/sim/testsuite/cris/c/getcwd1.c b/sim/testsuite/cris/c/getcwd1.c index 3838916143a..f7b6bd923da 100644 --- a/sim/testsuite/cris/c/getcwd1.c +++ b/sim/testsuite/cris/c/getcwd1.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/hellodyn3.c b/sim/testsuite/cris/c/hellodyn3.c index 4dd8bdd9e84..ff3ca70f8d5 100644 --- a/sim/testsuite/cris/c/hellodyn3.c +++ b/sim/testsuite/cris/c/hellodyn3.c @@ -2,7 +2,7 @@ works. Jump through a few hoops to avoid reading the host ld.so.cache (having no absolute path specified for the executable falls back on loading through the same mechanisms as a DSO). -#notarget: *-*-elf +#progos: linux #sim: --sysroot=$pwd $pwd/lib/ld.so.1 --library-path / */ #include "hello.c" diff --git a/sim/testsuite/cris/c/mmap1.c b/sim/testsuite/cris/c/mmap1.c index 9db94c17751..0bb0ea55d1e 100644 --- a/sim/testsuite/cris/c/mmap1.c +++ b/sim/testsuite/cris/c/mmap1.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #define _GNU_SOURCE diff --git a/sim/testsuite/cris/c/mmap2.c b/sim/testsuite/cris/c/mmap2.c index 35139a0ed9a..7c99e4e10d0 100644 --- a/sim/testsuite/cris/c/mmap2.c +++ b/sim/testsuite/cris/c/mmap2.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #define _GNU_SOURCE diff --git a/sim/testsuite/cris/c/mmap3.c b/sim/testsuite/cris/c/mmap3.c index 34401fa0c90..3667644d085 100644 --- a/sim/testsuite/cris/c/mmap3.c +++ b/sim/testsuite/cris/c/mmap3.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #define _GNU_SOURCE diff --git a/sim/testsuite/cris/c/mmap4.c b/sim/testsuite/cris/c/mmap4.c index b3a66e48b6d..551cdb1ea62 100644 --- a/sim/testsuite/cris/c/mmap4.c +++ b/sim/testsuite/cris/c/mmap4.c @@ -1,5 +1,5 @@ /* Just check that MAP_DENYWRITE is "honored" (ignored). -#notarget: cris*-*-elf +#progos: linux */ #define MMAP_FLAGS (MAP_PRIVATE|MAP_DENYWRITE) #include "mmap1.c" diff --git a/sim/testsuite/cris/c/mmap5.c b/sim/testsuite/cris/c/mmap5.c index 95f00c37fe3..a10fdc22502 100644 --- a/sim/testsuite/cris/c/mmap5.c +++ b/sim/testsuite/cris/c/mmap5.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #define _GNU_SOURCE diff --git a/sim/testsuite/cris/c/mmap6.c b/sim/testsuite/cris/c/mmap6.c index 929d9ccf857..29f70f58247 100644 --- a/sim/testsuite/cris/c/mmap6.c +++ b/sim/testsuite/cris/c/mmap6.c @@ -1,6 +1,6 @@ /* Check that mmapping specifying a previously mmapped address without MAP_FIXED works; that we just don't get the same address. -#notarget: cris*-*-elf +#progos: linux */ #define NO_MUNMAP #define MMAP_FLAGS2 MAP_PRIVATE diff --git a/sim/testsuite/cris/c/mmap7.c b/sim/testsuite/cris/c/mmap7.c index c4b14b0f9db..d7a7f3be267 100644 --- a/sim/testsuite/cris/c/mmap7.c +++ b/sim/testsuite/cris/c/mmap7.c @@ -1,7 +1,7 @@ /* Check that mmapping a page-aligned size, larger than the file, works. -#notarget: cris*-*-elf +#progos: linux */ /* Make sure we get an address where the size fits. */ diff --git a/sim/testsuite/cris/c/mmap8.c b/sim/testsuite/cris/c/mmap8.c index 0564c79a6db..b81d9c039e5 100644 --- a/sim/testsuite/cris/c/mmap8.c +++ b/sim/testsuite/cris/c/mmap8.c @@ -1,6 +1,6 @@ /* Check that mmapping 0 using MAP_FIXED works, both with/without there being previously mmapped contents. -#notarget: cris*-*-elf +#progos: linux */ #define MMAP_FLAGS1 MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED #define NO_MUNMAP diff --git a/sim/testsuite/cris/c/mprotect1.c b/sim/testsuite/cris/c/mprotect1.c index 8dae50ba6eb..1afbd96635c 100644 --- a/sim/testsuite/cris/c/mprotect1.c +++ b/sim/testsuite/cris/c/mprotect1.c @@ -1,5 +1,5 @@ /* Check unimplemented-output for mprotect call. -#notarget: cris*-*-elf +#progos: linux #xerror: #output: Unimplemented mprotect call (0x0, 0x2001, 0x4)\n #output: program stopped with signal 4 (*).\n diff --git a/sim/testsuite/cris/c/mprotect2.c b/sim/testsuite/cris/c/mprotect2.c index 4d839452435..ba8a3dab35c 100644 --- a/sim/testsuite/cris/c/mprotect2.c +++ b/sim/testsuite/cris/c/mprotect2.c @@ -1,5 +1,5 @@ /* As the included file, but specifying silent ENOSYS. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=enosys-quiet #output: ENOSYS\n #output: xyzzy\n diff --git a/sim/testsuite/cris/c/openpf5.c b/sim/testsuite/cris/c/openpf5.c index 90bebe509be..9fa80a9b034 100644 --- a/sim/testsuite/cris/c/openpf5.c +++ b/sim/testsuite/cris/c/openpf5.c @@ -1,5 +1,5 @@ /* Check that TRT happens when error on too many opened files. -#notarget: cris*-*-elf +#progos: linux #sim: --sysroot=$pwd */ #include diff --git a/sim/testsuite/cris/c/pipe1.c b/sim/testsuite/cris/c/pipe1.c index 735974b6cfa..21b17764c26 100644 --- a/sim/testsuite/cris/c/pipe1.c +++ b/sim/testsuite/cris/c/pipe1.c @@ -1,5 +1,5 @@ /* Check for proper pipe semantics at corner cases. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/pipe2.c b/sim/testsuite/cris/c/pipe2.c index 18ccf38b9b1..7f3de61211a 100644 --- a/sim/testsuite/cris/c/pipe2.c +++ b/sim/testsuite/cris/c/pipe2.c @@ -1,5 +1,5 @@ /* Check that closing a pipe with a nonempty buffer works. -#notarget: cris*-*-elf +#progos: linux #output: got: a\ngot: b\nexit: 0\n */ diff --git a/sim/testsuite/cris/c/pipe3.c b/sim/testsuite/cris/c/pipe3.c index bf08a38e1f0..467b5ca1221 100644 --- a/sim/testsuite/cris/c/pipe3.c +++ b/sim/testsuite/cris/c/pipe3.c @@ -1,5 +1,5 @@ /* Check that TRT happens when error on pipe call. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/pipe4.c b/sim/testsuite/cris/c/pipe4.c index 1cb309f9dc8..842e2fe7994 100644 --- a/sim/testsuite/cris/c/pipe4.c +++ b/sim/testsuite/cris/c/pipe4.c @@ -1,5 +1,5 @@ /* Check that TRT happens for pipe corner cases. -#notarget: cris*-*-elf +#progos: linux */ #include #include diff --git a/sim/testsuite/cris/c/pipe5.c b/sim/testsuite/cris/c/pipe5.c index 2b4d763353d..440cdbcd92e 100644 --- a/sim/testsuite/cris/c/pipe5.c +++ b/sim/testsuite/cris/c/pipe5.c @@ -1,5 +1,5 @@ /* Check that TRT happens for pipe corner cases (for our definition of TRT). -#notarget: cris*-*-elf +#progos: linux #xerror: #output: Terminating simulation due to writing pipe * from one single thread\n #output: program stopped with signal 4 (*).\n diff --git a/sim/testsuite/cris/c/pipe6.c b/sim/testsuite/cris/c/pipe6.c index a8830cc3e69..cbfb3132912 100644 --- a/sim/testsuite/cris/c/pipe6.c +++ b/sim/testsuite/cris/c/pipe6.c @@ -1,5 +1,5 @@ /* Check that writing an inordinate amount of data works (somewhat). -#notarget: cris*-*-elf +#progos: linux #output: got: a\nexit: 0\n This test-case will *not* work on host (or for real): the first pipemax+1 bytes will be successfully written. It's just for diff --git a/sim/testsuite/cris/c/pipe7.c b/sim/testsuite/cris/c/pipe7.c index 552ddb8e1e8..5125138ea77 100644 --- a/sim/testsuite/cris/c/pipe7.c +++ b/sim/testsuite/cris/c/pipe7.c @@ -1,5 +1,5 @@ /* Check for proper pipe semantics at corner cases. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/readlink1.c b/sim/testsuite/cris/c/readlink1.c index 1898e8eceb5..5bec2d5c328 100644 --- a/sim/testsuite/cris/c/readlink1.c +++ b/sim/testsuite/cris/c/readlink1.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/readlink10.c b/sim/testsuite/cris/c/readlink10.c index 21744083edd..f4705df214f 100644 --- a/sim/testsuite/cris/c/readlink10.c +++ b/sim/testsuite/cris/c/readlink10.c @@ -1,5 +1,5 @@ /* Check that odd cases of readlink work. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/readlink11.c b/sim/testsuite/cris/c/readlink11.c index 9d84e7d95fa..d082d229ef8 100644 --- a/sim/testsuite/cris/c/readlink11.c +++ b/sim/testsuite/cris/c/readlink11.c @@ -1,5 +1,5 @@ /* As readlink5.c (sic), but specifying silent ENOSYS. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=enosys-quiet --argv0 ./readlink11.c.x #output: ENOSYS\n #output: xyzzy\n diff --git a/sim/testsuite/cris/c/readlink2.c b/sim/testsuite/cris/c/readlink2.c index e5e9d94121c..235817f4ebb 100644 --- a/sim/testsuite/cris/c/readlink2.c +++ b/sim/testsuite/cris/c/readlink2.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/readlink3.c b/sim/testsuite/cris/c/readlink3.c index d728087f1d5..2a4e0753684 100644 --- a/sim/testsuite/cris/c/readlink3.c +++ b/sim/testsuite/cris/c/readlink3.c @@ -1,5 +1,5 @@ /* Simulator options: -#notarget: cris*-*-elf +#progos: linux #sim: --sysroot=$pwd */ #define SYSROOTED 1 diff --git a/sim/testsuite/cris/c/readlink4.c b/sim/testsuite/cris/c/readlink4.c index 028f3ee44ca..66cfca5af6b 100644 --- a/sim/testsuite/cris/c/readlink4.c +++ b/sim/testsuite/cris/c/readlink4.c @@ -1,5 +1,5 @@ /* Check for corner case: readlink of too-long name. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/readlink5.c b/sim/testsuite/cris/c/readlink5.c index 4bfb7ba3a1d..b0b56abac13 100644 --- a/sim/testsuite/cris/c/readlink5.c +++ b/sim/testsuite/cris/c/readlink5.c @@ -1,5 +1,5 @@ /* Check that unsupported readlink calls don't cause the simulator to abort. -#notarget: cris*-*-elf +#progos: linux #sim: --argv0 ./readlink5.c.x #xerror: #output: Unimplemented readlink syscall (*)\n diff --git a/sim/testsuite/cris/c/readlink6.c b/sim/testsuite/cris/c/readlink6.c index d64b95913a3..67868af7eed 100644 --- a/sim/testsuite/cris/c/readlink6.c +++ b/sim/testsuite/cris/c/readlink6.c @@ -1,5 +1,5 @@ /* Check that rare readlink calls don't cause the simulator to abort. -#notarget: cris*-*-elf +#progos: linux #sim: --argv0 $pwd/readlink6.c.x */ #include "readlink2.c" diff --git a/sim/testsuite/cris/c/readlink7.c b/sim/testsuite/cris/c/readlink7.c index 52c0733ca8a..d15f59d5736 100644 --- a/sim/testsuite/cris/c/readlink7.c +++ b/sim/testsuite/cris/c/readlink7.c @@ -1,5 +1,5 @@ /* Check that rare readlink calls don't cause the simulator to abort. -#notarget: cris*-*-elf +#progos: linux #sim: --env-unset PWD */ #include "readlink2.c" diff --git a/sim/testsuite/cris/c/readlink8.c b/sim/testsuite/cris/c/readlink8.c index ddc424e4c51..9465592c500 100644 --- a/sim/testsuite/cris/c/readlink8.c +++ b/sim/testsuite/cris/c/readlink8.c @@ -1,5 +1,5 @@ /* Check that rare readlink calls don't cause the simulator to abort. -#notarget: cris*-*-elf +#progos: linux #sim: --sysroot=$pwd --env-unset PWD */ #define SYSROOTED 1 diff --git a/sim/testsuite/cris/c/readlink9.c b/sim/testsuite/cris/c/readlink9.c index 7316b7a9854..ce5d446044d 100644 --- a/sim/testsuite/cris/c/readlink9.c +++ b/sim/testsuite/cris/c/readlink9.c @@ -1,5 +1,5 @@ /* Check that odd cases of readlink work. -#notarget: cris*-*-elf +#progos: linux #cc: additional_flags=-DX="$pwd" */ diff --git a/sim/testsuite/cris/c/rtsigprocmask1.c b/sim/testsuite/cris/c/rtsigprocmask1.c index b76c33853a8..a47b377e300 100644 --- a/sim/testsuite/cris/c/rtsigprocmask1.c +++ b/sim/testsuite/cris/c/rtsigprocmask1.c @@ -1,5 +1,5 @@ /* Compiler options: -#notarget: cris*-*-elf +#progos: linux #cc: additional_flags=-pthread #xerror: #output: Unimplemented rt_sigprocmask syscall (0x3, 0x0, 0x3dff*\n diff --git a/sim/testsuite/cris/c/rtsigprocmask2.c b/sim/testsuite/cris/c/rtsigprocmask2.c index 5026908fe16..4ae2be6ffad 100644 --- a/sim/testsuite/cris/c/rtsigprocmask2.c +++ b/sim/testsuite/cris/c/rtsigprocmask2.c @@ -1,5 +1,5 @@ /* As the included file, but specifying silent ENOSYS. -#notarget: cris*-*-elf +#progos: linux #cc: additional_flags=-pthread #sim: --cris-unknown-syscall=enosys-quiet #output: ENOSYS\n diff --git a/sim/testsuite/cris/c/rtsigsuspend1.c b/sim/testsuite/cris/c/rtsigsuspend1.c index 66ca7954503..04139a8be65 100644 --- a/sim/testsuite/cris/c/rtsigsuspend1.c +++ b/sim/testsuite/cris/c/rtsigsuspend1.c @@ -1,5 +1,5 @@ /* Test that TRT happens for invalid rt_sigsuspend calls. Single-thread. -#notarget: cris*-*-elf +#progos: linux #xerror: #output: Unimplemented rt_sigsuspend syscall arguments (0x1, 0x2)\n #output: program stopped with signal 4 (*).\n diff --git a/sim/testsuite/cris/c/rtsigsuspend2.c b/sim/testsuite/cris/c/rtsigsuspend2.c index 9ce165db552..4f32cca0f93 100644 --- a/sim/testsuite/cris/c/rtsigsuspend2.c +++ b/sim/testsuite/cris/c/rtsigsuspend2.c @@ -1,5 +1,5 @@ /* As the included file, but specifying silent ENOSYS. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=enosys-quiet #output: ENOSYS\n #output: xyzzy\n diff --git a/sim/testsuite/cris/c/sched1.c b/sim/testsuite/cris/c/sched1.c index 1b778f4a401..0a461b27c65 100644 --- a/sim/testsuite/cris/c/sched1.c +++ b/sim/testsuite/cris/c/sched1.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/sched2.c b/sim/testsuite/cris/c/sched2.c index f40a19a8085..fbde1e1b753 100644 --- a/sim/testsuite/cris/c/sched2.c +++ b/sim/testsuite/cris/c/sched2.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/sched3.c b/sim/testsuite/cris/c/sched3.c index 2909a4b6c52..94051e9b24d 100644 --- a/sim/testsuite/cris/c/sched3.c +++ b/sim/testsuite/cris/c/sched3.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/sched4.c b/sim/testsuite/cris/c/sched4.c index df372f217e8..7821cf0c1a0 100644 --- a/sim/testsuite/cris/c/sched4.c +++ b/sim/testsuite/cris/c/sched4.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/sched5.c b/sim/testsuite/cris/c/sched5.c index ddfe14d03c3..87468d076f5 100644 --- a/sim/testsuite/cris/c/sched5.c +++ b/sim/testsuite/cris/c/sched5.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/sched6.c b/sim/testsuite/cris/c/sched6.c index d5adedc1a35..26deb2122c0 100644 --- a/sim/testsuite/cris/c/sched6.c +++ b/sim/testsuite/cris/c/sched6.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/sched7.c b/sim/testsuite/cris/c/sched7.c index 35d006bca6a..c047461871b 100644 --- a/sim/testsuite/cris/c/sched7.c +++ b/sim/testsuite/cris/c/sched7.c @@ -1,5 +1,5 @@ /* Check corner error case: specifying invalid PID. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/sched8.c b/sim/testsuite/cris/c/sched8.c index cd3e06e6488..b0d3c8259b6 100644 --- a/sim/testsuite/cris/c/sched8.c +++ b/sim/testsuite/cris/c/sched8.c @@ -1,5 +1,5 @@ /* Check corner error case: specifying invalid PID. -#notarget: cris*-*-elf +#progos: linux */ #include #include diff --git a/sim/testsuite/cris/c/sched9.c b/sim/testsuite/cris/c/sched9.c index 8499e43fb8c..c9647b610e2 100644 --- a/sim/testsuite/cris/c/sched9.c +++ b/sim/testsuite/cris/c/sched9.c @@ -1,5 +1,5 @@ /* Check corner error case: specifying invalid scheduling policy. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/setrlimit1.c b/sim/testsuite/cris/c/setrlimit1.c index 747f16caa7f..1222619c2f0 100644 --- a/sim/testsuite/cris/c/setrlimit1.c +++ b/sim/testsuite/cris/c/setrlimit1.c @@ -1,5 +1,5 @@ /* Check corner error case: specifying unimplemented resource. -#notarget: cris*-*-elf +#progos: linux */ #include #include diff --git a/sim/testsuite/cris/c/settls1.c b/sim/testsuite/cris/c/settls1.c index bd55aa16f50..c6f84c5553f 100644 --- a/sim/testsuite/cris/c/settls1.c +++ b/sim/testsuite/cris/c/settls1.c @@ -1,5 +1,5 @@ /* Check that the syscall set_thread_area is supported and does the right thing. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/sig10.c b/sim/testsuite/cris/c/sig10.c index ef548327ebf..7ae46090beb 100644 --- a/sim/testsuite/cris/c/sig10.c +++ b/sim/testsuite/cris/c/sig10.c @@ -1,5 +1,5 @@ /* Check that TRT happens when trying to IGN an non-ignorable signal, more than one thread. -#notarget: cris*-*-elf +#progos: linux #cc: additional_flags=-pthread #xerror: #output: Exiting pid 42 due to signal 9\n diff --git a/sim/testsuite/cris/c/sig11.c b/sim/testsuite/cris/c/sig11.c index 9c8aad7d88e..69dc278d426 100644 --- a/sim/testsuite/cris/c/sig11.c +++ b/sim/testsuite/cris/c/sig11.c @@ -1,5 +1,5 @@ /* Check that TRT happens when getting a non-standard (realtime) signal, more than one thread. -#notarget: cris*-*-elf +#progos: linux #cc: additional_flags=-pthread #xerror: #output: Unimplemented signal: 77\n diff --git a/sim/testsuite/cris/c/sig12.c b/sim/testsuite/cris/c/sig12.c index 5a2e65fe9c3..7131cbc14cc 100644 --- a/sim/testsuite/cris/c/sig12.c +++ b/sim/testsuite/cris/c/sig12.c @@ -1,6 +1,6 @@ /* Check that TRT happens for a signal sent to a non-existent process/thread, more than one thread. #cc: additional_flags=-pthread -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/sig13.c b/sim/testsuite/cris/c/sig13.c index 4d71752a257..2558f6749e7 100644 --- a/sim/testsuite/cris/c/sig13.c +++ b/sim/testsuite/cris/c/sig13.c @@ -1,5 +1,5 @@ /* As the included file, but specifying silent ENOSYS. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=enosys-quiet #output: ENOSYS\n #output: xyzzy\n diff --git a/sim/testsuite/cris/c/sig2.c b/sim/testsuite/cris/c/sig2.c index 65596ef2eea..35b2802576b 100644 --- a/sim/testsuite/cris/c/sig2.c +++ b/sim/testsuite/cris/c/sig2.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/sig4.c b/sim/testsuite/cris/c/sig4.c index 57491f80a3c..e932b080a35 100644 --- a/sim/testsuite/cris/c/sig4.c +++ b/sim/testsuite/cris/c/sig4.c @@ -1,5 +1,5 @@ /* Check that TRT happens at an abort (3) call, more than one thread. -#notarget: cris*-*-elf +#progos: linux #cc: additional_flags=-pthread #xerror: #output: Exiting pid 42 due to signal 6\n diff --git a/sim/testsuite/cris/c/sig6.c b/sim/testsuite/cris/c/sig6.c index a1f572026a7..f8c8f80408c 100644 --- a/sim/testsuite/cris/c/sig6.c +++ b/sim/testsuite/cris/c/sig6.c @@ -1,5 +1,5 @@ /* Check that TRT happens at an non-abort non-caught signal, more than one thread. -#notarget: cris*-*-elf +#progos: linux #cc: additional_flags=-pthread #xerror: #output: Exiting pid 42 due to signal 7\n diff --git a/sim/testsuite/cris/c/sig7.c b/sim/testsuite/cris/c/sig7.c index b04f7c8ba4e..b939fb8a148 100644 --- a/sim/testsuite/cris/c/sig7.c +++ b/sim/testsuite/cris/c/sig7.c @@ -1,5 +1,5 @@ /* Check unsupported case of sigaction syscall. -#notarget: cris*-*-elf +#progos: linux #xerror: #output: Unimplemented rt_sigaction syscall (0x8, 0x3df*\n #output: program stopped with signal 4 (*).\n diff --git a/sim/testsuite/cris/c/sig9.c b/sim/testsuite/cris/c/sig9.c index c86681b4322..8e972faf4fd 100644 --- a/sim/testsuite/cris/c/sig9.c +++ b/sim/testsuite/cris/c/sig9.c @@ -1,5 +1,5 @@ /* Check that TRT happens at an non-abort ignored signal, more than one thread. -#notarget: cris*-*-elf +#progos: linux #cc: additional_flags=-pthread */ diff --git a/sim/testsuite/cris/c/sigreturn1.c b/sim/testsuite/cris/c/sigreturn1.c index 40fc852f36c..af239652248 100644 --- a/sim/testsuite/cris/c/sigreturn1.c +++ b/sim/testsuite/cris/c/sigreturn1.c @@ -1,5 +1,5 @@ /* Test that TRT happens for spurious sigreturn calls. Single-thread. -#notarget: cris*-*-elf +#progos: linux #xerror: #output: Invalid sigreturn syscall: no signal handler active (0x1, 0x2, 0x3, 0x4, 0x5, 0x6)\n #output: program stopped with signal 4 (*).\n diff --git a/sim/testsuite/cris/c/sigreturn2.c b/sim/testsuite/cris/c/sigreturn2.c index 3848b5fc798..a86ca25d3d6 100644 --- a/sim/testsuite/cris/c/sigreturn2.c +++ b/sim/testsuite/cris/c/sigreturn2.c @@ -1,5 +1,5 @@ /* Check that TRT happens for spurious sigreturn calls. Multiple threads. -#notarget: cris*-*-elf +#progos: linux #cc: additional_flags=-pthread #xerror: #output: Invalid sigreturn syscall: no signal handler active (0x1, 0x2, 0x3, 0x4, 0x5, 0x6)\n diff --git a/sim/testsuite/cris/c/sigreturn3.c b/sim/testsuite/cris/c/sigreturn3.c index f5ed90f2432..c2b149e8733 100644 --- a/sim/testsuite/cris/c/sigreturn3.c +++ b/sim/testsuite/cris/c/sigreturn3.c @@ -1,5 +1,5 @@ /* As the included file, but specifying silent ENOSYS. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=enosys-quiet #output: ENOSYS\n #output: xyzzy\n diff --git a/sim/testsuite/cris/c/sigreturn4.c b/sim/testsuite/cris/c/sigreturn4.c index 456e312c568..041970a8816 100644 --- a/sim/testsuite/cris/c/sigreturn4.c +++ b/sim/testsuite/cris/c/sigreturn4.c @@ -1,5 +1,5 @@ /* As the included file, but specifying silent ENOSYS. -#notarget: cris*-*-elf +#progos: linux #cc: additional_flags=-pthread #sim: --cris-unknown-syscall=enosys-quiet #output: ENOSYS\n diff --git a/sim/testsuite/cris/c/sock1.c b/sim/testsuite/cris/c/sock1.c index e59f6730523..8d06bfaed30 100644 --- a/sim/testsuite/cris/c/sock1.c +++ b/sim/testsuite/cris/c/sock1.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/stat2.c b/sim/testsuite/cris/c/stat2.c index 78c5c44f910..3ade5d21355 100644 --- a/sim/testsuite/cris/c/stat2.c +++ b/sim/testsuite/cris/c/stat2.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/stat4.c b/sim/testsuite/cris/c/stat4.c index e524ac87a8b..3606bcc392d 100644 --- a/sim/testsuite/cris/c/stat4.c +++ b/sim/testsuite/cris/c/stat4.c @@ -1,5 +1,5 @@ /* Simulator options: -#notarget: cris*-*-elf +#progos: linux #sim: --sysroot=$pwd */ diff --git a/sim/testsuite/cris/c/stat5.c b/sim/testsuite/cris/c/stat5.c index 41ab493fd5c..fe9fbc05500 100644 --- a/sim/testsuite/cris/c/stat5.c +++ b/sim/testsuite/cris/c/stat5.c @@ -1,5 +1,5 @@ /* Check that lstat:ing an nonexistent file works as expected. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/stat7.c b/sim/testsuite/cris/c/stat7.c index cbd5282b70a..d61bd8e0c7d 100644 --- a/sim/testsuite/cris/c/stat7.c +++ b/sim/testsuite/cris/c/stat7.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/stat8.c b/sim/testsuite/cris/c/stat8.c index c7eb49f5403..1778b3ed40b 100644 --- a/sim/testsuite/cris/c/stat8.c +++ b/sim/testsuite/cris/c/stat8.c @@ -1,6 +1,6 @@ /* For this test, we need to do the lstat syscall directly, or else glibc gets a SEGV. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/syscall1.c b/sim/testsuite/cris/c/syscall1.c index 84aacb6e092..be6eb275a19 100644 --- a/sim/testsuite/cris/c/syscall1.c +++ b/sim/testsuite/cris/c/syscall1.c @@ -1,5 +1,5 @@ /* Test unknown-syscall output. -#notarget: cris*-*-elf +#progos: linux #xerror: #output: Unimplemented syscall: 166 (0x1, 0x2, 0x3, 0x4, 0x5, 0x6)\n #output: program stopped with signal 4 (*).\n diff --git a/sim/testsuite/cris/c/syscall2.c b/sim/testsuite/cris/c/syscall2.c index b4dbead0b13..d2b5a62373a 100644 --- a/sim/testsuite/cris/c/syscall2.c +++ b/sim/testsuite/cris/c/syscall2.c @@ -1,5 +1,5 @@ /* Test unknown-syscall output. -#notarget: cris*-*-elf +#progos: linux #xerror: #output: Unimplemented syscall: 0 (0x3, 0x2, 0x1, 0x4, 0x6, 0x5)\n #output: program stopped with signal 4 (*).\n diff --git a/sim/testsuite/cris/c/syscall3.c b/sim/testsuite/cris/c/syscall3.c index f4d02eb6cd3..6d5ea285556 100644 --- a/sim/testsuite/cris/c/syscall3.c +++ b/sim/testsuite/cris/c/syscall3.c @@ -1,5 +1,5 @@ /* As the included file, just actually specifying the default. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=stop #xerror: #output: Unimplemented syscall: 166 (0x1, 0x2, 0x3, 0x4, 0x5, 0x6)\n diff --git a/sim/testsuite/cris/c/syscall4.c b/sim/testsuite/cris/c/syscall4.c index ba01cfdeb30..431452218eb 100644 --- a/sim/testsuite/cris/c/syscall4.c +++ b/sim/testsuite/cris/c/syscall4.c @@ -1,5 +1,5 @@ /* As the included file, just actually specifying the default. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=stop #xerror: #output: Unimplemented syscall: 0 (0x3, 0x2, 0x1, 0x4, 0x6, 0x5)\n diff --git a/sim/testsuite/cris/c/syscall5.c b/sim/testsuite/cris/c/syscall5.c index 2eac9008972..75a014a350b 100644 --- a/sim/testsuite/cris/c/syscall5.c +++ b/sim/testsuite/cris/c/syscall5.c @@ -1,5 +1,5 @@ /* As the included file, but specifying ENOSYS with message. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=enosys #output: Unimplemented syscall: 166 (0x1, 0x2, 0x3, 0x4, 0x5, 0x6)\n #output: ENOSYS\n diff --git a/sim/testsuite/cris/c/syscall6.c b/sim/testsuite/cris/c/syscall6.c index 91375df6d34..f59dc1c3bd1 100644 --- a/sim/testsuite/cris/c/syscall6.c +++ b/sim/testsuite/cris/c/syscall6.c @@ -1,5 +1,5 @@ /* As the included file, but specifying ENOSYS with message. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=enosys #output: Unimplemented syscall: 0 (0x3, 0x2, 0x1, 0x4, 0x6, 0x5)\n #output: ENOSYS\n diff --git a/sim/testsuite/cris/c/syscall7.c b/sim/testsuite/cris/c/syscall7.c index 0f1daf1653f..e38d944edd8 100644 --- a/sim/testsuite/cris/c/syscall7.c +++ b/sim/testsuite/cris/c/syscall7.c @@ -1,5 +1,5 @@ /* As the included file, but specifying silent ENOSYS. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=enosys-quiet #output: ENOSYS\n #output: xyzzy\n diff --git a/sim/testsuite/cris/c/syscall8.c b/sim/testsuite/cris/c/syscall8.c index c579436d0ef..38d6cc9a1ba 100644 --- a/sim/testsuite/cris/c/syscall8.c +++ b/sim/testsuite/cris/c/syscall8.c @@ -1,5 +1,5 @@ /* As the included file, but specifying silent ENOSYS. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=enosys-quiet #output: ENOSYS\n #output: xyzzy\n diff --git a/sim/testsuite/cris/c/sysctl1.c b/sim/testsuite/cris/c/sysctl1.c index 6646faca678..5742fa447bf 100644 --- a/sim/testsuite/cris/c/sysctl1.c +++ b/sim/testsuite/cris/c/sysctl1.c @@ -1,5 +1,5 @@ /* -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/sysctl2.c b/sim/testsuite/cris/c/sysctl2.c index f27c37c9005..53e810b7023 100644 --- a/sim/testsuite/cris/c/sysctl2.c +++ b/sim/testsuite/cris/c/sysctl2.c @@ -2,7 +2,7 @@ #xerror: #output: Unimplemented _sysctl syscall *\n #output: program stopped with signal 4 (*).\n -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/sysctl3.c b/sim/testsuite/cris/c/sysctl3.c index 747e78410f4..b198ed8c0e6 100644 --- a/sim/testsuite/cris/c/sysctl3.c +++ b/sim/testsuite/cris/c/sysctl3.c @@ -1,5 +1,5 @@ /* As the included file, but specifying silent ENOSYS. -#notarget: cris*-*-elf +#progos: linux #sim: --cris-unknown-syscall=enosys-quiet #output: ENOSYS\n #output: xyzzy\n diff --git a/sim/testsuite/cris/c/thread2.c b/sim/testsuite/cris/c/thread2.c index c9ad2f9214c..1da539d7e1f 100644 --- a/sim/testsuite/cris/c/thread2.c +++ b/sim/testsuite/cris/c/thread2.c @@ -1,6 +1,6 @@ /* Compiler options: #cc: additional_flags=-pthread -#notarget: cris*-*-elf +#progos: linux A sanity check for syscalls resulting from pthread_getschedparam and pthread_setschedparam. */ diff --git a/sim/testsuite/cris/c/thread3.c b/sim/testsuite/cris/c/thread3.c index 3b6945ad3c3..8cfc0d78114 100644 --- a/sim/testsuite/cris/c/thread3.c +++ b/sim/testsuite/cris/c/thread3.c @@ -1,6 +1,6 @@ /* Compiler options: #cc: additional_flags=-pthread -#notarget: cris*-*-elf +#progos: linux To test sched_yield in the presencs of threads. Core from ex1.c. */ diff --git a/sim/testsuite/cris/c/thread4.c b/sim/testsuite/cris/c/thread4.c index cfa23279c50..0df5fba5bf9 100644 --- a/sim/testsuite/cris/c/thread4.c +++ b/sim/testsuite/cris/c/thread4.c @@ -1,5 +1,5 @@ /* Compiler options: -#notarget: cris*-*-elf +#progos: linux #cc: additional_flags=-pthread #output: abb ok\n diff --git a/sim/testsuite/cris/c/thread5.c b/sim/testsuite/cris/c/thread5.c index 494251fdd39..84b53e06fda 100644 --- a/sim/testsuite/cris/c/thread5.c +++ b/sim/testsuite/cris/c/thread5.c @@ -1,5 +1,5 @@ /* Compiler options: -#notarget: cris*-*-elf +#progos: linux #cc: additional_flags=-pthread #output: abbb ok\n diff --git a/sim/testsuite/cris/c/truncate1.c b/sim/testsuite/cris/c/truncate1.c index 477dc3d61d2..acd04909bdd 100644 --- a/sim/testsuite/cris/c/truncate1.c +++ b/sim/testsuite/cris/c/truncate1.c @@ -1,5 +1,5 @@ /* Check that the truncate syscall works trivially. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/truncate2.c b/sim/testsuite/cris/c/truncate2.c index f021ae8ac99..b24c30846d6 100644 --- a/sim/testsuite/cris/c/truncate2.c +++ b/sim/testsuite/cris/c/truncate2.c @@ -1,6 +1,6 @@ /* #sim: --sysroot=$pwd -#notarget: cris*-*-elf +#progos: linux */ #define PREFIX "/" #include "truncate1.c" diff --git a/sim/testsuite/cris/c/ugetrlimit1.c b/sim/testsuite/cris/c/ugetrlimit1.c index 2a49b9589ee..6f3eb4d11d8 100644 --- a/sim/testsuite/cris/c/ugetrlimit1.c +++ b/sim/testsuite/cris/c/ugetrlimit1.c @@ -1,5 +1,5 @@ /* Check corner error case: specifying unimplemented resource. -#notarget: cris*-*-elf +#progos: linux */ #include diff --git a/sim/testsuite/cris/c/uname1.c b/sim/testsuite/cris/c/uname1.c index 83518d6ec86..02db97465a6 100644 --- a/sim/testsuite/cris/c/uname1.c +++ b/sim/testsuite/cris/c/uname1.c @@ -1,5 +1,5 @@ /* Check that the right machine name appears in the uname result. -#notarget: *-*-elf +#progos: linux */ #include #include diff --git a/sim/testsuite/cris/c/writev1.c b/sim/testsuite/cris/c/writev1.c index fad5b7f1920..a723171a87f 100644 --- a/sim/testsuite/cris/c/writev1.c +++ b/sim/testsuite/cris/c/writev1.c @@ -1,5 +1,5 @@ /* Trivial test of writev. -#notarget: cris*-*-elf +#progos: linux #output: abcdefghijklmn\npass\n */ #include diff --git a/sim/testsuite/cris/c/writev2.c b/sim/testsuite/cris/c/writev2.c index 5cb92b60a5e..e4904dfbdb9 100644 --- a/sim/testsuite/cris/c/writev2.c +++ b/sim/testsuite/cris/c/writev2.c @@ -1,5 +1,5 @@ /* Trivial test of failing writev: invalid file descriptor. -#notarget: cris*-*-elf +#progos: linux */ #include #include diff --git a/sim/testsuite/lib/linuxcheck.c b/sim/testsuite/lib/linuxcheck.c new file mode 100644 index 00000000000..d1f4bc17a6b --- /dev/null +++ b/sim/testsuite/lib/linuxcheck.c @@ -0,0 +1,9 @@ +/* Used by the test harness to see if toolchain targets Linux. */ +#ifdef __linux__ +int main() +{ + return 0; +} +#else +# error "not linux" +#endif diff --git a/sim/testsuite/lib/newlibcheck.c b/sim/testsuite/lib/newlibcheck.c new file mode 100644 index 00000000000..ea1d8642885 --- /dev/null +++ b/sim/testsuite/lib/newlibcheck.c @@ -0,0 +1,10 @@ +/* Used by the test harness to see if toolchain uses newlib. */ +#include +#if defined(__NEWLIB__) || defined(_NEWLIB_VERSION) +int main() +{ + return 0; +} +#else +# error "not newlib" +#endif diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp index f399d2f3da1..535f76cbae3 100644 --- a/sim/testsuite/lib/sim-defs.exp +++ b/sim/testsuite/lib/sim-defs.exp @@ -48,16 +48,33 @@ proc sim_init_toolchain {} { global srcdir global global_cpp_works global global_cc_works + global global_cc_os # See if we have a preprocessor available. set result [target_compile $srcdir/lib/compilercheck.c \ $objdir/compilercheck.x "preprocess" ""] set global_cpp_works [string equal "" "$result"] - # See if we have a compiler available. - set result [target_compile $srcdir/lib/compilercheck.c \ - $objdir/compilercheck.x "executable" ""] - set global_cc_works [string equal "" "$result"] + # See if we have a compiler available, and which environment it's targeting. + if { [target_compile $srcdir/lib/newlibcheck.c \ + $objdir/compilercheck.x "executable" ""] == "" } { + verbose -log "Found newlib C compiler" + set global_cc_works 1 + set global_cc_os "newlib" + } elseif { [target_compile $srcdir/lib/linuxcheck.c \ + $objdir/compilercheck.x "executable" ""] == "" } { + verbose -log "Found Linux C compiler" + set global_cc_works 1 + set global_cc_os "linux" + } elseif { [target_compile $srcdir/lib/compilercheck.c \ + $objdir/compilercheck.x "executable" ""] == "" } { + verbose -log "Found C compiler, but unknown OS" + set global_cc_works 1 + set global_cc_os "" + } { + verbose -log "Can't execute C compiler" + set global_cc_works 0 + } file delete $objdir/compilercheck.x } @@ -189,6 +206,7 @@ proc sim_run { prog sim_opts prog_opts redir options } { # cc[(mach-list)]: # sim[(mach-list)]: # progopts: +# progos: OS required for the test # status: program exit status to treat as "pass" # output: program output pattern to match with string-match # xerror: program is expected to return with a "failure" exit code @@ -211,6 +229,7 @@ proc run_sim_test { name requested_machs } { global SIMFLAGS_FOR_TARGET global global_cpp_works global global_cc_works + global global_cc_os if ![file exists $sim_path] { unsupported "$name: missing simulator $sim_path" @@ -234,6 +253,7 @@ proc run_sim_test { name requested_machs } { set opts(ld) "" set opts(cc) "" set opts(progopts) "" + set opts(progos) "" set opts(sim) "" set opts(status) "0" set opts(output) "" @@ -291,6 +311,11 @@ proc run_sim_test { name requested_machs } { } } + if { $opts(progos) != "" && $opts(progos) != $global_cc_os } { + untested $subdir/$name + return + } + set testname $name set sourcefile $file if { $seen_output == 0 } { -- 2.30.2