From d45a6c7099a346153e970476688be5bd6a016cef Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Wed, 2 Sep 2020 13:42:39 +0100 Subject: [PATCH] MSP430: Skip gcc.dg/pr55940.c in the small memory model In the MSP430 small memory model, there is a 16-bit address space and pointer arithmetic wraps around the address space, so any calculated address is always within this range. In this test, pointer arithmetic wraps when 0x1000 is added to the address of a variable, causing the resulting address to be unexpectedly less than 0x2000, which breaks the test. gcc/testsuite/ChangeLog: * gcc.dg/pr55940.c: Skip for msp430 unless -mlarge is specified. --- gcc/testsuite/gcc.dg/pr55940.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/testsuite/gcc.dg/pr55940.c b/gcc/testsuite/gcc.dg/pr55940.c index d046d0b6912..85761f6c31f 100644 --- a/gcc/testsuite/gcc.dg/pr55940.c +++ b/gcc/testsuite/gcc.dg/pr55940.c @@ -1,5 +1,6 @@ /* PR target/55940 */ /* { dg-do run } */ +/* { dg-skip-if "pointer arithmetic can wrap" { msp430-*-* } { "*" } { "-mlarge" } } */ /* { dg-options "-Os" } */ /* { dg-additional-options "-mpreferred-stack-boundary=2" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ -- 2.30.2