⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 weak-14.c

📁 linux下编程用 编译软件
💻 C
字号:
// { dg-do run }// { dg-require-weak "" }// { dg-require-alias "" }// { dg-options "-O2 -fno-common" }// Copyright 2005 Free Software Foundation, Inc.// Contributed by Alexandre Oliva <aoliva@redhat.com>// PR middle-end/24295// The unit-at-a-time call graph code used to fail to emit variables// without external linkage that were only used indirectly, through// aliases.  We might then get linker failures because the static// variable was not defined, or run-time errors because the weak alias// ended up pointing somewhere random.#include <stdlib.h>static unsigned long lv1 = 0xdeadbeefUL;#pragma weak Av1a = lv1extern unsigned long Av1a;static unsigned long lf1(void) { return 0x510bea7UL; }#pragma weak Af1a = lf1extern unsigned long Af1a(void);int main (void) {  if (! &Av1a      || ! &Af1a      || Av1a != 0xdeadbeefUL      || Af1a() != 0x510bea7UL)    abort ();  exit (0);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -