1 /*
2 * Check decoding of int 0x80 on x86_64, x32, and x86.
3 *
4 * Copyright (c) 2017-2021 Dmitry V. Levin <ldv@strace.io>
5 * All rights reserved.
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
10 #include "tests.h"
11
12 #if defined __x86_64__ || defined __i386__
13
14 # include <stdio.h>
15 # include <unistd.h>
16
17 int
18 main(void)
19 {
20 /* 200 is __NR_getgid32 on x86 and __NR_tkill on x86_64. */
21 __asm__("movl $200, %eax; int $0x80");
22 printf("getgid32() = %d\n", getegid());
23
24 puts("+++ exited with 0 +++");
25 return 0;
26 }
27
28 #else
29
30 SKIP_MAIN_UNDEFINED("__x86_64__ || __i386__")
31
32 #endif