summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr45852.c
blob: b0ba0935debd372cbced8506ae9874893547bd9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* PR middle-end/45852 */
/* { dg-options "-O2 -mcmodel=small" } */
/* { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && lp64 } } } */
/* { dg-require-visibility "" } */

struct S { int s; };

volatile struct S globvar __attribute__((visibility ("hidden"))) = { -6 };

void
foo (void)
{
  globvar = globvar;
}

/* { dg-final { scan-assembler-times "globvar.%?rip" 2 } } */