From: Georg-Johann Lay Date: Mon, 15 Jan 2018 10:04:32 +0000 (+0000) Subject: re PR c/83801 ([avr] String constant in __flash not put into .progmem) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=93c74e59706415bc50ba1c88ee50715e15eb5346;p=gcc.git re PR c/83801 ([avr] String constant in __flash not put into .progmem) PR c/83801 PR c/83729 * gcc.target/avr/torture/pr83729.c: New test. * gcc.target/avr/torture/pr83801.c: New test. From-SVN: r256687 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 546fc82c9f0..614bf178085 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-01-15 Georg-Johann Lay + + PR c/83801 + PR c/83729 + * gcc.target/avr/torture/pr83729.c: New test. + * gcc.target/avr/torture/pr83801.c: New test. + 2018-01-15 Jakub Jelinek PR middle-end/82694 diff --git a/gcc/testsuite/gcc.target/avr/torture/pr83729.c b/gcc/testsuite/gcc.target/avr/torture/pr83729.c new file mode 100644 index 00000000000..01b14e9b167 --- /dev/null +++ b/gcc/testsuite/gcc.target/avr/torture/pr83729.c @@ -0,0 +1,17 @@ +/* { dg-options { "-std=gnu99" } } */ +/* { dg-do run { target { ! avr_tiny } } } */ + +__attribute((noinline,noclone)) +char to_ascii (unsigned i) +{ + static const char __memx code_tab[] = "0123456789"; + return code_tab[i]; +} + +int main() +{ + if (to_ascii (2) != '2') + __builtin_abort(); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/avr/torture/pr83801.c b/gcc/testsuite/gcc.target/avr/torture/pr83801.c new file mode 100644 index 00000000000..77a5b76f53d --- /dev/null +++ b/gcc/testsuite/gcc.target/avr/torture/pr83801.c @@ -0,0 +1,17 @@ +/* { dg-options { "-std=gnu99" } } */ +/* { dg-do run { target { ! avr_tiny } } } */ + +__attribute((noinline,noclone)) +char to_ascii (unsigned i) +{ + static const char __flash code_tab[] = "0123456789"; + return code_tab[i]; +} + +int main() +{ + if (to_ascii (2) != '2') + __builtin_abort(); + + return 0; +}