xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/weak_constant.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1 // RUN: %clang_cc1 -w -emit-llvm %s -O1 -o - | FileCheck %s
2 // Check for bug compatibility with gcc.
3 
4 const int x __attribute((weak)) = 123;
5 
f(void)6 int* f(void) {
7   return &x;
8 }
9 
g(void)10 int g(void) {
11   // CHECK: ret i32 123
12   return *f();
13 }
14