diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:52:33 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:52:33 +0000 |
commit | 009b1c42aa6266385f2c37e227516b24077e6dd7 (patch) | |
tree | 64ba909838c23261cace781ece27d106134ea451 /test/FrontendC/weak_constant.c |
Diffstat (limited to 'test/FrontendC/weak_constant.c')
-rw-r--r-- | test/FrontendC/weak_constant.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/FrontendC/weak_constant.c b/test/FrontendC/weak_constant.c new file mode 100644 index 0000000000000..53379482cb4d3 --- /dev/null +++ b/test/FrontendC/weak_constant.c @@ -0,0 +1,12 @@ +// 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(); +} |