Update release-README after completing the 2.43 release.
[binutils-gdb.git] / sim / testsuite / cris / c / settls1.c
blobc6f84c5553f0bb3504955a6c7b89274da43870e1
1 /* Check that the syscall set_thread_area is supported and does the right thing.
2 #progos: linux
3 */
5 #include <unistd.h>
6 #include <sys/syscall.h>
7 #include <stdio.h>
8 #include <errno.h>
9 #include <stdlib.h>
11 #ifndef SYS_set_thread_area
12 #define SYS_set_thread_area 243
13 #endif
15 int main (void)
17 int ret;
19 /* Check the error check that the low 8 bits must be 0. */
20 ret = syscall (SYS_set_thread_area, 0xfeeb1ff0);
21 if (ret != -1 || errno != EINVAL)
23 perror ("tls1");
24 abort ();
27 ret = syscall (SYS_set_thread_area, 0xcafebe00);
28 if (ret != 0)
30 perror ("tls2");
31 abort ();
34 /* Check that we got the right result. */
35 #ifdef __arch_v32
36 asm ("move $pid,%0\n\tclear.b %0" : "=rm" (ret));
37 #else
38 asm ("move $brp,%0" : "=rm" (ret));
39 #endif
41 if (ret != 0xcafebe00)
43 perror ("tls2");
44 abort ();
47 printf ("pass\n");
48 exit (0);