Files
clang-p2996/lld/test/elf/Inputs/shared.c
Michael J. Spencer 9d70cef481 [Core] Allow weak symbols in shared library when linking.
Patch by Rui Ueyama.

llvm-svn: 180209
2013-04-24 19:00:26 +00:00

17 lines
346 B
C

#include <stdio.h>
extern int i;
int i = 42;
// Undefined weak function in a dynamic library.
__attribute__((weak)) void weakfoo();
// Regular funtion in a dynamic library.
void foo() {
// Try to call weakfoo so that the reference to weekfoo will be included in
// the resulting .so file.
if (weakfoo)
weakfoo();
puts("Fooo!!");
}