aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/pr45852.c
blob: 8b7bbfbe7a588768d15f34c671c55c867efe4e0c (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* } && { ! { ia32 } } } } } */
/* { 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 } } */