OSDN Git Service

PR rtl-optimization/27735
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / visibility-11.c
1 /* PR middle-end/20297 */
2 /* The memcpy FUNCTION_DECL built in the middle-end for block moves got
3    hidden visibility from the first push, so the call didn't use the PLT.  */
4
5 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
6 /* { dg-require-visibility "" } */
7 /* { dg-options "-Os -fpic" } */
8 /* { dg-final { scan-assembler "memcpy@PLT" } } */
9
10 #pragma GCC visibility push(hidden)
11 #pragma GCC visibility push(default)
12 extern void* memcpy (void *, const void *, __SIZE_TYPE__);
13 #pragma GCC visibility pop
14
15 struct a { int a[1024]; };
16
17 extern void *bar (struct a *, struct a *, int);
18
19 void *
20 foo (struct a *a, struct a *b, int c)
21 {
22   struct a cc = *b;
23   return bar (a, &cc, 4 * c);
24 }