xref: /aosp_15_r20/external/clang/test/CodeGen/weak_constant.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
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