summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-11-05 12:11:50 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2010-11-05 12:11:50 +0100
commit502c50846ce1ee2c46022fe2f004c19b7ea42314 (patch)
tree4b778aed069a282624447328e96ba9fd6fa1c854 /gcc/testsuite/c-c++-common
parentcb1150418276ecc5a39261ad5a4204c8d9632803 (diff)
downloadgcc-502c50846ce1ee2c46022fe2f004c19b7ea42314.tar.gz
re PR middle-end/43690 (Internal compiler error detected by avr-gcc.)
PR middle-end/43690 * gimplify.c (gimplify_asm_expr): If a "m" input is a {pre,post}{in,de}crement, fail. * c-c++-common/pr43690.c: New test. From-SVN: r166354
Diffstat (limited to 'gcc/testsuite/c-c++-common')
-rw-r--r--gcc/testsuite/c-c++-common/pr43690.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/pr43690.c b/gcc/testsuite/c-c++-common/pr43690.c
new file mode 100644
index 00000000000..67c6cb0f88c
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr43690.c
@@ -0,0 +1,13 @@
+/* PR middle-end/43690 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+foo (char *x)
+{
+ asm ("" : : "m" (x++)); /* { dg-error "is not directly addressable" } */
+ asm ("" : : "m" (++x)); /* { dg-error "is not directly addressable" } */
+ asm ("" : : "m" (x--)); /* { dg-error "is not directly addressable" } */
+ asm ("" : : "m" (--x)); /* { dg-error "is not directly addressable" } */
+ asm ("" : : "m" (x + 1)); /* { dg-error "is not directly addressable" } */
+}