summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/visibility-11.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-22 04:20:52 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-22 04:20:52 +0000
commitf0f2eb242a667c62c22e7fe9e45baf6c8d549023 (patch)
treebea9fcaacdabc909ee70a71492432316d8610e1f /gcc/testsuite/gcc.dg/visibility-11.c
parentd95c9b0dec0c3b73c9eacb54a7d4cd973aeb29d6 (diff)
downloadgcc-f0f2eb242a667c62c22e7fe9e45baf6c8d549023.tar.gz
PR middle-end/20297
* expr.c (init_block_move_fn): Force default visibility. (init_block_clear_fn): Likewise. * builtins.c (expand_builtin_fork_or_exec): Likewise. * targhooks.c (default_external_stack_protect_fail): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112270 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/visibility-11.c')
-rw-r--r--gcc/testsuite/gcc.dg/visibility-11.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/visibility-11.c b/gcc/testsuite/gcc.dg/visibility-11.c
new file mode 100644
index 00000000000..e5995827b79
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-11.c
@@ -0,0 +1,24 @@
+/* PR middle-end/20297 */
+/* The memcpy FUNCTION_DECL built in the middle-end for block moves got
+ hidden visibility from the first push, so the call didn't use the PLT. */
+
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-require-visibility "" } */
+/* { dg-options "-Os -fpic" } */
+/* { dg-final { scan-assembler "memcpy@PLT" } } */
+
+#pragma GCC visibility push(hidden)
+#pragma GCC visibility push(default)
+extern void* memcpy (void *, const void *, __SIZE_TYPE__);
+#pragma GCC visibility pop
+
+struct a { int a[10]; };
+
+extern void *bar (struct a *, struct a *, int);
+
+void *
+foo (struct a *a, struct a *b, int c)
+{
+ struct a cc = *b;
+ return bar (a, &cc, 4 * c);
+}