xref: /netbsd-src/external/gpl3/gdb/dist/sim/testsuite/cris/c/uname1.c (revision 4b169a6ba595ae283ca507b26b15fdff40495b1c)
1*4b169a6bSchristos /* Check that the right machine name appears in the uname result.
2*4b169a6bSchristos #progos: linux
3*4b169a6bSchristos */
4*4b169a6bSchristos #include <sys/utsname.h>
5*4b169a6bSchristos #include <stdio.h>
6*4b169a6bSchristos #include <stdlib.h>
main(void)7*4b169a6bSchristos int main (void)
8*4b169a6bSchristos {
9*4b169a6bSchristos   struct utsname buf;
10*4b169a6bSchristos   if (uname (&buf) != 0
11*4b169a6bSchristos       || strcmp (buf.machine,
12*4b169a6bSchristos #ifdef __arch_v32
13*4b169a6bSchristos 		 "crisv32"
14*4b169a6bSchristos #else
15*4b169a6bSchristos 		 "cris"
16*4b169a6bSchristos #endif
17*4b169a6bSchristos 		 ) != 0)
18*4b169a6bSchristos     abort ();
19*4b169a6bSchristos   printf ("pass\n");
20*4b169a6bSchristos   exit (0);
21*4b169a6bSchristos }
22