| 1 |
/* { dg-do compile { target { ia32 && fstack_protector } } } */ |
| 2 |
/* { dg-options "-O2 -mincoming-stack-boundary=2 -fstack-protector-all" } */ |
| 3 |
|
| 4 |
#include <stdarg.h> |
| 5 |
|
| 6 |
extern int *__errno_location (void); |
| 7 |
|
| 8 |
long |
| 9 |
sys_socketcall (int op, ...) |
| 10 |
{ |
| 11 |
long int res; |
| 12 |
va_list ap; |
| 13 |
va_start (ap, op); |
| 14 |
asm volatile ("push %%ebx; movl %2, %%ebx; int $0x80; pop %%ebx" |
| 15 |
/* { dg-warning "listing the stack pointer register" "" { target *-*-* } .-1 } */ |
| 16 |
: "=a" (res) : "0" (102), "ri" (16), "c" (ap) : "memory", "esp"); |
| 17 |
if (__builtin_expect (res > 4294963200UL, 0)) |
| 18 |
*__errno_location () = -res; |
| 19 |
va_end (ap); |
| 20 |
return res; |
| 21 |
} |
| 22 |
|
| 23 |
/* { dg-final { scan-assembler "call\[ \t\]*_?__errno_location" } } */ |