From: Jozef Lawrynowicz Date: Wed, 2 Sep 2020 12:42:39 +0000 (+0100) Subject: MSP430: Skip gcc.dg/pr55940.c in the small memory model X-Git-Tag: basepoints/gcc-12~5277 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d45a6c7099a346153e970476688be5bd6a016cef;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/testsuite/gcc.dg/pr55940.c b/gcc/testsuite/gcc.dg/pr55940.c index d046d0b6912f..85761f6c31f7 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 } } } */