public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] sim: testsuite: unify basic C compiler checks
@ 2021-11-17  1:52 Mike Frysinger
  2021-11-17  1:52 ` [PATCH 2/2] sim: testsuite: initial support for OS-specific tests Mike Frysinger
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2021-11-17  1:52 UTC (permalink / raw)
  To: gdb-patches

Both bfin & cris ports test the C compiler to see if it works, but in
their own way.  Unify the checks in the common code so we can leverage
them in more ports in the future, and collapse the bfin & cris code.
---
 sim/testsuite/bfin/allinsn.exp    | 34 +++++----------------------
 sim/testsuite/cris/c/c.exp        | 15 +++++-------
 sim/testsuite/lib/compilercheck.c |  5 ++++
 sim/testsuite/lib/sim-defs.exp    | 38 +++++++++++++++++++++++++++++++
 4 files changed, 55 insertions(+), 37 deletions(-)
 create mode 100644 sim/testsuite/lib/compilercheck.c

diff --git a/sim/testsuite/bfin/allinsn.exp b/sim/testsuite/bfin/allinsn.exp
index aa304eaa9b4a..199f95c16f5a 100644
--- a/sim/testsuite/bfin/allinsn.exp
+++ b/sim/testsuite/bfin/allinsn.exp
@@ -1,38 +1,16 @@
 # Analog Devices Blackfin simulator testsuite
 
+# Set a default CPU to satisfy bfin-elf-gcc requirements.  BF537 should work
+# with all standard Blackfin toolchains.
+set global_cc_options "-mcpu=bf537"
+sim_init_toolchain
+unset global_cc_options
+
 if [istarget bfin-*-elf] {
     # all machines
     set all_machs "bfin"
 
-    # See if we have a preprocessor available.
-    if { [target_compile $srcdir/$subdir/usp.S compilercheck.x "preprocess" \
-	  [list "incdir=$srcdir/$subdir"]] == "" } {
-	set has_cpp 1
-    } {
-	verbose -log "Can't execute preprocessor"
-	set has_cpp 0
-    }
-
-    # See if we have a compiler available.
-    if { [target_compile $srcdir/$subdir/argc.c compilercheck.x "executable" \
-	  [list "incdir=$srcdir/$subdir" "additional_flags=-msim"]] == "" } {
-	set has_cc 1
-    } {
-	verbose -log "Can't execute C compiler"
-	set has_cc 0
-    }
-
     foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.\[csS\]]] {
-	# If we don't have a compiler available, skip tests :(.
-	if { $has_cpp == 0 && [string match "*.S" $src] } {
-	    untested $src
-	    continue
-	}
-	if { $has_cc == 0 && [string match "*.c" $src] } {
-	    untested $src
-	    continue
-	}
-
 	# If we're only testing specific files and this isn't one of them,
 	# skip it.
 	if ![runtest_file_p $runtests $src] {
diff --git a/sim/testsuite/cris/c/c.exp b/sim/testsuite/cris/c/c.exp
index 233ed8533778..e617b2324b68 100644
--- a/sim/testsuite/cris/c/c.exp
+++ b/sim/testsuite/cris/c/c.exp
@@ -15,6 +15,8 @@
 
 # Miscellaneous CRIS simulator testcases testing syscall sequences.
 
+sim_init_toolchain
+
 if ![istarget cris*-*-*] {
     return
 }
@@ -31,10 +33,8 @@ if [istarget cris*-*-elf] {
 }
 
 # Using target_compile, since it is less noisy,
-if { [target_compile $srcdir/$subdir/hello.c compilercheck.x \
-	  "executable" "" ] == "" } {
-    set has_cc 1
-
+global global_cc_works
+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
     # directory (which must end in /lib) in [pwd], so /lib/ld.so.1 is
@@ -43,7 +43,7 @@ if { [target_compile $srcdir/$subdir/hello.c compilercheck.x \
     # detrimental effects on the executable from the specs and
     # -static in the board ldflags, we just add -Bdynamic.
     if [regexp "(.*/lib)/libc.so" \
-	    [target_compile $srcdir/$subdir/hello.c compilercheck.x \
+	    [target_compile $srcdir/lib/compilercheck.c compilercheck.x \
 		 "executable" \
 		 "ldflags=-print-file-name=libc.so -Wl,-Bdynamic"] \
 	    xxx libcsodir]  {
@@ -51,9 +51,6 @@ if { [target_compile $srcdir/$subdir/hello.c compilercheck.x \
 	verbose -log "Creating link to $libcsodir in [pwd]"
 	file link lib $libcsodir
     }
-} {
-    verbose -log "Can't execute C compiler"
-    set has_cc 0
 }
 
 # Like istarget, except take a list of targets as a string.
@@ -88,7 +85,7 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
     }
 
     # Note absence of CC in results, but don't make a big fuss over it.
-    if { $has_cc == 0 } {
+    if { $global_cc_works == 0 } {
 	untested $testname
 	continue
     }
diff --git a/sim/testsuite/lib/compilercheck.c b/sim/testsuite/lib/compilercheck.c
new file mode 100644
index 000000000000..63a957705479
--- /dev/null
+++ b/sim/testsuite/lib/compilercheck.c
@@ -0,0 +1,5 @@
+/* Used by the test harness to verify working compiler & preprocessor.  */
+int main()
+{
+  return 0;
+}
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 0ddc4d556ab7..3c93e66d9ac2 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -35,6 +35,30 @@ proc sim_version {} {
     clone_output "$sim_path $version\n"
 }
 
+# Initialize the toolchain settings for this port.
+# Needs to be called once per-port.
+
+proc sim_init_toolchain {} {
+    global subdir srcdir
+    global global_cpp_works
+    global global_cc_works
+    global global_cc_options
+
+    if ![info exists global_cc_options] {
+	set global_cc_options ""
+    }
+
+    # See if we have a preprocessor available.
+    set result [target_compile $srcdir/lib/compilercheck.c 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 compilercheck.x \
+		"executable" [list "additional_flags=$global_cc_options"]]
+    set global_cc_works [string equal "" "$result"]
+}
+
 # Find the path to the simulator for executing.
 proc sim_tool_path {} {
     global sim_path
@@ -191,6 +215,8 @@ proc run_sim_test { name requested_machs } {
     global global_ld_options
     global global_cc_options
     global global_sim_options
+    global global_cpp_works
+    global global_cc_works
 
     if ![file exists [sim_tool_path]] {
 	unsupported "$name: missing simulator [sim_tool_path]"
@@ -337,11 +363,23 @@ proc run_sim_test { name requested_machs } {
 	}
 
 	if [string match "*.c" $sourcefile] {
+	    # If we don't have a compiler available, skip tests :(.
+	    if { $global_cc_works == 0 } {
+		untested $subdir/$name
+		return
+	    }
+
 	    set comp_output [target_compile $sourcefile ${name}.x "executable" \
 		[list "incdir=$srcdir/$subdir" "additional_flags=$c_as_options $c_ld_options $opts(cc,$mach) $global_cc_options"]]
 	    set method "compiling/linking"
 	} else {
 	    if [string match "*.S" $sourcefile] {
+		# If we don't have a preprocessor available, skip tests :(.
+		if { $global_cpp_works == 0 } {
+		    untested $subdir/$name
+		    return
+		}
+
 		set comp_output [target_compile $sourcefile ${name}.o "object" \
 		    [list "incdir=$srcdir/$subdir" "additional_flags=$c_as_options"]]
 		set method "compiling"
-- 
2.33.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2/2] sim: testsuite: initial support for OS-specific tests
  2021-11-17  1:52 [PATCH 1/2] sim: testsuite: unify basic C compiler checks Mike Frysinger
@ 2021-11-17  1:52 ` Mike Frysinger
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2021-11-17  1:52 UTC (permalink / raw)
  To: gdb-patches

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        | 34 +++++++++++++++++++++++----
 107 files changed, 159 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 ba9be34a1b8e..10a47ea16959 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 <unistd.h>
 #include <stdio.h>
diff --git a/sim/testsuite/cris/c/badldso1.c b/sim/testsuite/cris/c/badldso1.c
index 70414b536d23..fbd320cd5dbe 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 92efc138c565..2f58bff8c81f 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 f827e771a9c4..7039ad42a1d5 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 e617b2324b68..ca66416f1e9c 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
@@ -95,6 +96,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"
@@ -156,6 +158,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 163b18647a84..9c4cca42545e 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 aaa0873b640f..88a984fe8a67 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 0a97484adacd..6c5b8813f08c 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 <stddef.h>
diff --git a/sim/testsuite/cris/c/clone4.c b/sim/testsuite/cris/c/clone4.c
index 81489ddc4195..c2e684ca871c 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 <stddef.h>
diff --git a/sim/testsuite/cris/c/clone5.c b/sim/testsuite/cris/c/clone5.c
index 9380a1ea5aab..5cd164466665 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 586b5c67378d..9ecd48943474 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 2447319f71ae..ea239c2ad4b8 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 0b4c425b3e60..acaad922e4b1 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 <unistd.h>
diff --git a/sim/testsuite/cris/c/exitg2.c b/sim/testsuite/cris/c/exitg2.c
index e222cc4707b1..e5b0be73854c 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 032f6b501981..7c0501820975 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 fc9f95b688d4..5298e7a277c3 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 46b8756705cc..cc213b83a245 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 <stdio.h>
diff --git a/sim/testsuite/cris/c/ftruncate2.c b/sim/testsuite/cris/c/ftruncate2.c
index f1ef18c6aa68..712c185c754f 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 3838916143af..f7b6bd923da5 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 <unistd.h>
diff --git a/sim/testsuite/cris/c/hellodyn3.c b/sim/testsuite/cris/c/hellodyn3.c
index 4dd8bdd9e843..ff3ca70f8d54 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 9db94c177515..0bb0ea55d1e8 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 35139a0ed9aa..7c99e4e10d08 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 34401fa0c907..3667644d085f 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 b3a66e48b6d7..551cdb1ea620 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 95f00c37fe3c..a10fdc225027 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 929d9ccf8579..29f70f582474 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 c4b14b0f9db6..d7a7f3be2670 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 0564c79a6db2..b81d9c039e57 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 8dae50ba6eb4..1afbd96635c7 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 4d839452435f..ba8a3dab35c5 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 90bebe509be5..9fa80a9b0348 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 <stddef.h>
diff --git a/sim/testsuite/cris/c/pipe1.c b/sim/testsuite/cris/c/pipe1.c
index 735974b6cfa0..21b17764c26b 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 <stddef.h>
diff --git a/sim/testsuite/cris/c/pipe2.c b/sim/testsuite/cris/c/pipe2.c
index 18ccf38b9b1d..7f3de61211a1 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 bf08a38e1f0c..467b5ca12210 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 <stddef.h>
diff --git a/sim/testsuite/cris/c/pipe4.c b/sim/testsuite/cris/c/pipe4.c
index 1cb309f9dc81..842e2fe7994e 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 <stddef.h>
 #include <signal.h>
diff --git a/sim/testsuite/cris/c/pipe5.c b/sim/testsuite/cris/c/pipe5.c
index 2b4d763353df..440cdbcd92e4 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 a8830cc3e698..cbfb31329128 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 552ddb8e1e89..5125138ea773 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 <stdio.h>
diff --git a/sim/testsuite/cris/c/readlink1.c b/sim/testsuite/cris/c/readlink1.c
index 1898e8eceb54..5bec2d5c328f 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 <unistd.h>
diff --git a/sim/testsuite/cris/c/readlink10.c b/sim/testsuite/cris/c/readlink10.c
index 21744083eddb..f4705df214ff 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 <unistd.h>
diff --git a/sim/testsuite/cris/c/readlink11.c b/sim/testsuite/cris/c/readlink11.c
index 9d84e7d95fac..d082d229ef84 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 e5e9d94121c6..235817f4ebbc 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 <unistd.h>
diff --git a/sim/testsuite/cris/c/readlink3.c b/sim/testsuite/cris/c/readlink3.c
index d728087f1d52..2a4e07536847 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 028f3ee44ca6..66cfca5af6b7 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 <unistd.h>
diff --git a/sim/testsuite/cris/c/readlink5.c b/sim/testsuite/cris/c/readlink5.c
index 4bfb7ba3a1d3..b0b56abac13f 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 d64b95913a3f..67868af7eedd 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 52c0733ca8a4..d15f59d57366 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 ddc424e4c510..9465592c5001 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 7316b7a9854e..ce5d446044da 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 b76c33853a88..a47b377e3000 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 5026908fe166..4ae2be6ffad6 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 66ca7954503e..04139a8be651 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 9ce165db5529..4f32cca0f932 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 1b778f4a4015..0a461b27c652 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 <sched.h>
diff --git a/sim/testsuite/cris/c/sched2.c b/sim/testsuite/cris/c/sched2.c
index f40a19a8085c..fbde1e1b7538 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 <sched.h>
diff --git a/sim/testsuite/cris/c/sched3.c b/sim/testsuite/cris/c/sched3.c
index 2909a4b6c52f..94051e9b24d9 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 <sched.h>
diff --git a/sim/testsuite/cris/c/sched4.c b/sim/testsuite/cris/c/sched4.c
index df372f217e83..7821cf0c1a08 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 <sched.h>
diff --git a/sim/testsuite/cris/c/sched5.c b/sim/testsuite/cris/c/sched5.c
index ddfe14d03c36..87468d076f5c 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 <sched.h>
diff --git a/sim/testsuite/cris/c/sched6.c b/sim/testsuite/cris/c/sched6.c
index d5adedc1a35f..26deb2122c0b 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 <sched.h>
diff --git a/sim/testsuite/cris/c/sched7.c b/sim/testsuite/cris/c/sched7.c
index 35d006bca6a8..c047461871be 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 <sched.h>
diff --git a/sim/testsuite/cris/c/sched8.c b/sim/testsuite/cris/c/sched8.c
index cd3e06e6488e..b0d3c8259b67 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 <string.h>
 #include <sched.h>
diff --git a/sim/testsuite/cris/c/sched9.c b/sim/testsuite/cris/c/sched9.c
index 8499e43fb8c6..c9647b610e2a 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 <sched.h>
diff --git a/sim/testsuite/cris/c/setrlimit1.c b/sim/testsuite/cris/c/setrlimit1.c
index 747f16caa7f9..1222619c2f03 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 <sys/time.h>
 #include <sys/resource.h>
diff --git a/sim/testsuite/cris/c/settls1.c b/sim/testsuite/cris/c/settls1.c
index bd55aa16f504..c6f84c5553f0 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 <unistd.h>
diff --git a/sim/testsuite/cris/c/sig10.c b/sim/testsuite/cris/c/sig10.c
index ef548327ebf2..7ae46090beb0 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 9c8aad7d88e1..69dc278d4266 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 5a2e65fe9c31..7131cbc14cc8 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 <stdlib.h>
diff --git a/sim/testsuite/cris/c/sig13.c b/sim/testsuite/cris/c/sig13.c
index 4d71752a257c..2558f6749e78 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 65596ef2eea5..35b2802576be 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 <stdio.h>
diff --git a/sim/testsuite/cris/c/sig4.c b/sim/testsuite/cris/c/sig4.c
index 57491f80a3c6..e932b080a352 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 a1f572026a7e..f8c8f80408c2 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 b04f7c8ba4e8..b939fb8a148a 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 c86681b4322d..8e972faf4fdc 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 40fc852f36c5..af239652248c 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 3848b5fc798f..a86ca25d3d63 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 f5ed90f2432c..c2b149e87338 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 456e312c5684..041970a8816d 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 e59f67305238..8d06bfaed304 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 <sys/types.h>
diff --git a/sim/testsuite/cris/c/stat2.c b/sim/testsuite/cris/c/stat2.c
index 78c5c44f9108..3ade5d213552 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 <sys/types.h>
diff --git a/sim/testsuite/cris/c/stat4.c b/sim/testsuite/cris/c/stat4.c
index e524ac87a8b8..3606bcc392dd 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 41ab493fd5ca..fe9fbc05500f 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 <sys/types.h>
diff --git a/sim/testsuite/cris/c/stat7.c b/sim/testsuite/cris/c/stat7.c
index cbd5282b70ac..d61bd8e0c7db 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 <sys/types.h>
diff --git a/sim/testsuite/cris/c/stat8.c b/sim/testsuite/cris/c/stat8.c
index c7eb49f54038..1778b3ed40ba 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 <unistd.h>
diff --git a/sim/testsuite/cris/c/syscall1.c b/sim/testsuite/cris/c/syscall1.c
index 84aacb6e0927..be6eb275a193 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 b4dbead0b137..d2b5a62373af 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 f4d02eb6cd3b..6d5ea2855561 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 ba01cfdeb30c..431452218ebd 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 2eac90089727..75a014a350bd 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 91375df6d349..f59dc1c3bd18 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 0f1daf1653f3..e38d944edd8a 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 c579436d0ef9..38d6cc9a1baa 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 6646faca6780..5742fa447bfa 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 <unistd.h>
diff --git a/sim/testsuite/cris/c/sysctl2.c b/sim/testsuite/cris/c/sysctl2.c
index f27c37c90053..53e810b70234 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 <unistd.h>
diff --git a/sim/testsuite/cris/c/sysctl3.c b/sim/testsuite/cris/c/sysctl3.c
index 747e78410f4b..b198ed8c0e64 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 c9ad2f9214ce..1da539d7e1f2 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 3b6945ad3c35..8cfc0d781141 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 cfa23279c505..0df5fba5bf90 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 494251fdd396..84b53e06fda9 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 477dc3d61d25..acd04909bddb 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 <stdio.h>
diff --git a/sim/testsuite/cris/c/truncate2.c b/sim/testsuite/cris/c/truncate2.c
index f021ae8ac992..b24c30846d65 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 2a49b9589eeb..6f3eb4d11d8d 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 <sys/time.h>
diff --git a/sim/testsuite/cris/c/uname1.c b/sim/testsuite/cris/c/uname1.c
index 83518d6ec860..02db97465a6b 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 <sys/utsname.h>
 #include <stdio.h>
diff --git a/sim/testsuite/cris/c/writev1.c b/sim/testsuite/cris/c/writev1.c
index fad5b7f1920b..a723171a87f7 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 <sys/uio.h>
diff --git a/sim/testsuite/cris/c/writev2.c b/sim/testsuite/cris/c/writev2.c
index 5cb92b60a5e1..e4904dfbdb91 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 <sys/uio.h>
 #include <errno.h>
diff --git a/sim/testsuite/lib/linuxcheck.c b/sim/testsuite/lib/linuxcheck.c
new file mode 100644
index 000000000000..d1f4bc17a6bd
--- /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 000000000000..c44bd7f010f1
--- /dev/null
+++ b/sim/testsuite/lib/newlibcheck.c
@@ -0,0 +1,10 @@
+/* Used by the test harness to see if toolchain uses newlib.  */
+#include <newlib.h>
+#ifdef __NEWLIB__
+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 3c93e66d9ac2..118602b45da1 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -42,6 +42,7 @@ proc sim_init_toolchain {} {
     global subdir srcdir
     global global_cpp_works
     global global_cc_works
+    global global_cc_os
     global global_cc_options
 
     if ![info exists global_cc_options] {
@@ -53,10 +54,27 @@ proc sim_init_toolchain {} {
 		"preprocess" ""]
     set global_cpp_works [string equal "" "$result"]
 
-    # See if we have a compiler available.
-    set result [target_compile $srcdir/lib/compilercheck.c compilercheck.x \
-		"executable" [list "additional_flags=$global_cc_options"]]
-    set global_cc_works [string equal "" "$result"]
+    # See if we have a compiler available, and which environment it's targeting.
+    set cc_options [list "additional_flags=$global_cc_options"]
+    if { [target_compile $srcdir/lib/newlibcheck.c compilercheck.x \
+	  "executable" $cc_options] == "" } {
+	verbose -log "Found newlib C compiler"
+	set global_cc_works 1
+	set global_cc_os "newlib"
+    } elseif { [target_compile $srcdir/lib/linuxcheck.c compilercheck.x \
+		"executable" $cc_options] == "" } {
+	verbose -log "Found Linux C compiler"
+	set global_cc_works 1
+	set global_cc_os "linux"
+    } elseif { [target_compile $srcdir/lib/compilercheck.c compilercheck.x \
+		"executable" $cc_options] == "" } {
+	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
+    }
 }
 
 # Find the path to the simulator for executing.
@@ -193,6 +211,7 @@ proc sim_run { prog sim_opts prog_opts redir options } {
 # cc[(mach-list)]: <compiler options>
 # sim[(mach-list)]: <simulator options>
 # progopts: <arguments to the program being simulated>
+# 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
@@ -217,6 +236,7 @@ proc run_sim_test { name requested_machs } {
     global global_sim_options
     global global_cpp_works
     global global_cc_works
+    global global_cc_os
 
     if ![file exists [sim_tool_path]] {
 	unsupported "$name: missing simulator [sim_tool_path]"
@@ -240,6 +260,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) ""
@@ -306,6 +327,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.33.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-17  1:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17  1:52 [PATCH 1/2] sim: testsuite: unify basic C compiler checks Mike Frysinger
2021-11-17  1:52 ` [PATCH 2/2] sim: testsuite: initial support for OS-specific tests Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).