blob: 2d43d42a02194823edb39892aba602376898c602 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/* { dg-options "-O2" } */
/* { dg-do run } */
#if defined __i386__
#define REG "edi"
#else
#define REG "r14"
#endif
register unsigned long *ds asm(REG);
extern void abort (void);
__attribute__ ((noinline)) void
test (void)
{
*++ds = 31337;
}
int
main ()
{
unsigned long stack[2];
stack[0] = 0;
stack[1] = 0;
ds = stack;
test ();
if (ds != stack + 1 || *ds != 31337)
abort ();
return 0;
}
|