annotate gcc/testsuite/gcc.dg/visibility-11.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR middle-end/20297 */
kono
parents:
diff changeset
2 /* The memcpy FUNCTION_DECL built in the middle-end for block moves got
kono
parents:
diff changeset
3 hidden visibility from the first push, so the call didn't use the PLT. */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
kono
parents:
diff changeset
6 /* { dg-skip-if "" { *-*-darwin* } } */
kono
parents:
diff changeset
7 /* { dg-require-visibility "" } */
kono
parents:
diff changeset
8 /* { dg-require-effective-target fpic } */
kono
parents:
diff changeset
9 /* { dg-options "-Os -fpic -mstringop-strategy=libcall" } */
kono
parents:
diff changeset
10 /* { dg-final { scan-assembler "memcpy@PLT" } } */
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 #pragma GCC visibility push(hidden)
kono
parents:
diff changeset
13 #pragma GCC visibility push(default)
kono
parents:
diff changeset
14 extern void* memcpy (void *, const void *, __SIZE_TYPE__);
kono
parents:
diff changeset
15 #pragma GCC visibility pop
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 struct a { int a[4096]; };
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 extern void *bar (struct a *, struct a *, int);
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 void *
kono
parents:
diff changeset
22 foo (struct a *a, struct a *b, int c)
kono
parents:
diff changeset
23 {
kono
parents:
diff changeset
24 struct a cc = *b;
kono
parents:
diff changeset
25 return bar (a, &cc, 4 * c);
kono
parents:
diff changeset
26 }