aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/darwin-segaddr.c
blob: 526db77bd9ce76c6ee85515c8e9b6b1e78d440aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Check that -segaddr gets through and works.  */
/* { dg-do run { target *-*-darwin* } } */
/* { dg-options "-O0 -segaddr __TEST 0x200000 -fno-pie" { target { *-*-darwin* && { ! lp64 } } } } */
/* { dg-options "-O0 -segaddr __TEST 0x110000000 -fno-pie" { target { *-*-darwin* && lp64 } } } */

extern void abort ();

int t __attribute__((section("__TEST,__test")));

int main (void)
{
#ifdef __LP64__
  if ((unsigned long long) &t != 0x110000000ULL)
#else
  if ((unsigned long) &t != 0x200000UL)
#endif
    abort ();
  return 0;
}