summaryrefslogtreecommitdiff
path: root/sim/testsuite/cris/c/uname1.c
diff options
context:
space:
mode:
Diffstat (limited to 'sim/testsuite/cris/c/uname1.c')
-rw-r--r--sim/testsuite/cris/c/uname1.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sim/testsuite/cris/c/uname1.c b/sim/testsuite/cris/c/uname1.c
new file mode 100644
index 00000000000..83518d6ec86
--- /dev/null
+++ b/sim/testsuite/cris/c/uname1.c
@@ -0,0 +1,21 @@
+/* Check that the right machine name appears in the uname result.
+#notarget: *-*-elf
+*/
+#include <sys/utsname.h>
+#include <stdio.h>
+#include <stdlib.h>
+int main (void)
+{
+ struct utsname buf;
+ if (uname (&buf) != 0
+ || strcmp (buf.machine,
+#ifdef __arch_v32
+ "crisv32"
+#else
+ "cris"
+#endif
+ ) != 0)
+ abort ();
+ printf ("pass\n");
+ exit (0);
+}