aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/abi/aarch64_guard1.C
blob: ca1778b87306c7d45b48c5bcb5351b5cab0a3597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Check that the initialization guard variable is an 8-byte aligned,
// 8-byte doubleword and that only the least significant bit is used
// for initialization guard variables.
// { dg-do compile { target aarch64*-*-* } }
// { dg-options "-O -fdump-tree-original -fno-section-anchors" }

int bar();

int *foo ()
{
  static int x = bar ();
  return &x;
}

// { dg-final { scan-assembler _ZGVZ3foovE1x,8,8 } }
// { dg-final { scan-tree-dump "_ZGVZ3foovE1x & 1" "original" } }
// { dg-final { cleanup-tree-dump "original" } }