summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/attr-alias-2.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-02 07:52:31 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-02 07:52:31 +0000
commit8bc09a747fed4c300f335b0bca7723e55fd19091 (patch)
tree9fcf4185c5360e802ff2cef25c68d1cd2b7178d6 /gcc/testsuite/gcc.dg/attr-alias-2.c
parentc838448c89657e91d35e22ee3b3686410bf32c74 (diff)
downloadgcc-8bc09a747fed4c300f335b0bca7723e55fd19091.tar.gz
PR c/19031
* c-decl.c (pop_file_scope): Call maybe_apply_pending_pragma_weaks. * c-lang.c (finish_file): Don't do it here. * objc/objc-act.c (objc_finish_file): Likewise. * cgraph.c (decl_assembler_name_equal): New. (cgraph_node_for_asm, cgraph_varpool_node_for_asm): New. (cgraph_varpool_node): Actually link up cgraph_varpool_nodes. * cgraph.h (struct cgraph_varpool_node): Add next. (cgraph_node_for_asm, cgraph_varpool_node_for_asm): Declare. * varasm.c (assemble_alias): Mark the target as needed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92803 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/attr-alias-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/attr-alias-2.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/attr-alias-2.c b/gcc/testsuite/gcc.dg/attr-alias-2.c
new file mode 100644
index 00000000000..8a21384cf46
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/attr-alias-2.c
@@ -0,0 +1,20 @@
+/* PR 19031 */
+/* { dg-do link } */
+/* { dg-require-alias } */
+/* { dg-options "-funit-at-a-time" } */
+
+static int f1 (void) { return 0; }
+extern int g1 (void) __attribute__((__alias__("f1")));
+
+#define STR(x) STR1(__USER_LABEL_PREFIX__, x)
+#define STR1(x,y) STR2(x, y)
+#define STR2(x,y) #x #y
+
+static int f2 (void) __asm__(STR(a2));
+static int f2 (void) { return 0; }
+extern int g2 (void) __attribute__((__alias__("a2")));
+
+int main ()
+{
+ return g1() + g2();
+}