1
0
mirror of https://github.com/ioacademy-jikim/debugging synced 2025-06-08 08:26:14 +00:00
2015-12-13 22:34:58 +09:00

16 lines
274 B
C

/* test segment register getting */
#include <stdio.h>
int main()
{
unsigned short gsw;
unsigned long gsl;
asm ("mov $~0, %0; movl %%gs, %0" : "=r" (gsl));
asm ("mov $~0, %0; movw %%gs, %0" : "=r" (gsw));
printf("%s\n", gsl == gsw ? "PASS" : "FAIL");
return 0;
}