• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 /* Test case for http://bugs.kde.org/show_bug.cgi?id=157748 */
3 
4 #include <stdio.h>
5 
6 int arr[3];
7 
main(void)8 int main ( void )
9 {
10    /* eax points at arr[0] */
11    __asm__ __volatile__(
12       "movl %%esp,0(%%eax)\n\t"
13       "pushfw\n\t"
14       "movl %%esp,4(%%eax)\n\t"
15       "popfw\n\t"
16       "movl %%esp,8(%%eax)\n"
17       : /*out*/ : /*in*/ "a"(&arr) : /*trash*/ "memory","cc"
18    );
19 
20    printf("%x %x %x\n", arr[0]-arr[0], arr[0]-arr[1], arr[0]-arr[2]);
21    return 0;
22 }
23