mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-01 16:33:37 +01:00
926d062a48
linkage: the value may be replaced with something different at link time. (Frontends that want to allow values to be loaded out of weak constants can give their constants weak_odr linkage). llvm-svn: 67407
13 lines
194 B
C
13 lines
194 B
C
// RUN: %llvmgcc -S %s -O1 -o - | grep {ret.*123}
|
|
// Check for bug compatibility with gcc.
|
|
|
|
const int x __attribute((weak)) = 123;
|
|
|
|
int* f(void) {
|
|
return &x;
|
|
}
|
|
|
|
int g(void) {
|
|
return *f();
|
|
}
|