Note: GCC has a limitation that a stack frame cannot exceed half the address space.
For two tests the decision to modify or skip them seems not so clear-cut;
I choose to modify gcc.dg/pr47893.c to use types that fit the numbers, as
that seemed to have little impact on the test, and skip gcc.dg/pr115646.c
for 16 bit, as layout of structs with bitfields members can have quite
subtle rules.
gcc/testsuite/
* gcc.dg/pr107523.c: Make sure variables can fit numbers.
* gcc.dg/pr47893.c: Add dg-require-effective-target size20plus clause.
* c-c++-common/torture/builtin-clear-padding-2.c:
dg-require-effective-target size20plus.
* gcc.dg/pr115646.c: dg-require-effective-target int32plus.
* c-c++-common/analyzer/coreutils-sum-pr108666.c:
For c++, expect a warning about exceeding maximum object size
if not size20plus.
* gcc.dg/torture/inline-mem-cpy-1.c:
Like the included file, dg-require-effective-target ptr32plus.
* gcc.dg/torture/inline-mem-cmp-1.c: Likewise.
int checksum = 0;
uintmax_t total_bytes = 0;
static const size_t buffer_length = 32768;
- uint8_t* buffer = (uint8_t *) malloc(buffer_length);
+ uint8_t* buffer = (uint8_t *) malloc(buffer_length); /* { dg-warning "argument 1 value '32768' exceeds maximum object size 32767" "" { target { c++ && { ! size20plus } } } } */
if (!buffer)
return -1;
/* PR libstdc++/88101 */
/* { dg-do run } */
+/* { dg-require-effective-target size20plus } */
typedef int T __attribute__((aligned (16384)));
struct S { char a; short b; long double c; T d; T e; long long f; };
/* { dg-do run } */
/* { dg-options "-O2 " } */
-int a, b = 1;
-unsigned int c = 1;
+typedef __typeof__(465984011) i32;
+typedef __typeof__(465984011U) u32;
+i32 a, b = 1;
+u32 c = 1;
int main() {
- int d = 1, f;
+ i32 d = 1, f;
if (b)
d = 0;
a = -1;
f = b;
b = f;
if (f <= a) {
- int g = -(a && 1), h = g - f && a, i = ~(c / f) && 1 % (a | h);
+ i32 g = -(a && 1), h = g - f && a, i = ~(c / f) && 1 % (a | h);
if (c) {
g = f;
if (i || (g && (g > -465984012)))
/* { dg-do compile } */
/* { dg-options "-O2" } */
+/* { dg-require-effective-target int32plus } */
extern double pow(double x, double y);
/* { dg-options "-O2" } */
/* { dg-additional-options "-mtune=atom -fno-omit-frame-pointer -fno-strict-aliasing" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
/* { dg-skip-if "Too much RAM needed" { "avr-*-*" } } */
+/* About 50 KB code, 33 KB stack, too big for byte-addressed
+ von Neumann targets with 16 bit addresses. */
+/* { dg-require-effective-target size20plus } */
extern void abort (void);
/* { dg-do run } */
/* { dg-options "-finline-stringops=memcmp -save-temps -g0 -fno-lto" } */
+/* { dg-require-effective-target ptr32plus } */
/* { dg-timeout-factor 2 } */
#include "../memcmp-1.c"
/* { dg-do run } */
/* { dg-options "-finline-stringops=memcpy -save-temps -g0 -fno-lto" } */
/* { dg-additional-options "-DRUN_FRACTION=11" { target simulator } } */
+/* { dg-require-effective-target ptr32plus } */
/* { dg-timeout-factor 2 } */
#include "../memcmp-1.c"