summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/merge-all-constants-1.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2006-06-21 08:58:44 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2006-06-21 08:58:44 +0000
commit1fc5c8affbf852fa27e7781cb1e23b2892983d33 (patch)
treefd1af8dab866ad596acc77b89185aabb10394617 /gcc/testsuite/gcc.dg/merge-all-constants-1.c
parent7a0c37debdedc3e121fb676f63c6d1cc4845859b (diff)
downloadgcc-1fc5c8affbf852fa27e7781cb1e23b2892983d33.tar.gz
* varasm.c (mergeable_string_section): Check for embedded NULs and
NUL termination in the first int_size_in_bytes (TREE_TYPE (decl)) rather than TREE_STRING_LENGTH bytes. * gcc.dg/merge-all-constants-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114842 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/merge-all-constants-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/merge-all-constants-1.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/merge-all-constants-1.c b/gcc/testsuite/gcc.dg/merge-all-constants-1.c
new file mode 100644
index 00000000000..5c9cd06e925
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/merge-all-constants-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-w -O2 -fmerge-all-constants" } */
+
+const char str1[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
+const char str2[38] = "0123456789abcdefghijklmnopqrstuvwxyz";
+const char str3[10] = "0123456789abcdefghijklmnopqrstuvwxyz";
+
+/* { dg-final { scan-assembler-not "\.rodata\.str" } } */