blob: 7c6cabb509a62e55675e05ac1fc1afe4a95bebf9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
/* { dg-do run } */
/* { dg-require-weak "" } */
/* { dg-skip-if "No undefined weak" { hppa*-*-hpux* && { ! lp64 } } } */
/* { dg-skip-if "No undefined weak" { nvptx-*-* } { "*" } { "" } } */
/* { dg-additional-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } } */
/* { dg-additional-options "-Wl,-flat_namespace" { target *-*-darwin[89]* } } */
typedef __SIZE_TYPE__ size_t;
extern int posix_memalign(void **memptr, size_t alignment, size_t size) __attribute__((weak));
extern void abort(void);
int
main (void)
{
void *p;
int ret;
if (!posix_memalign)
return 0;
p = (void *)&ret;
ret = posix_memalign (&p, sizeof (void *), -1);
if (p != (void *)&ret)
abort ();
return 0;
}
|