summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/darwin-segaddr.c
blob: 93452278c45a11a0f5b91b9dcefbf471ed1f6f3f (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" { target { *-*-darwin* && { ! lp64 } } } } */
/* { dg-options "-O0 -segaddr __TEST 0x110000000" { 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;
}