diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-14 07:56:54 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-14 07:56:54 +0000 |
commit | 98a1d4392b2c6b63e5ceab588dd9876f053c6ac1 (patch) | |
tree | 93129dfbe6218445158cf46b67c5590976b31681 /gcc/testsuite/gcc.dg/20021029-2.c | |
parent | ed6044da464d6dd03a689528ba72082dbb10309f (diff) | |
download | gcc-98a1d4392b2c6b63e5ceab588dd9876f053c6ac1.tar.gz |
* varasm.c (output_addressed_constants) [MINUS_EXPR]: Clear reloc if
both operands contain local relocations.
(categorize_decl_for_section): Don't use mergeable sections if
initializer has any relocations.
* gcc.dg/20021029-1.c: New test.
* gcc.dg/20021029-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59097 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/20021029-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/20021029-2.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20021029-2.c b/gcc/testsuite/gcc.dg/20021029-2.c new file mode 100644 index 00000000000..e99342478c5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20021029-2.c @@ -0,0 +1,14 @@ +/* Test whether variables with relocations aren't put into + mergeable sections even with -fmerge-all-constants. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fmerge-all-constants" } */ +/* { dg-final { scan-assembler-not ".rodata.cst" } } */ + +int foo (int a) +{ + static void * const ar[] = { &&l2 }; + void *p = ar[a]; + goto *p; +l2: + return 2; +} |