gcc/testsuite/
PR testsuite/52641
* gcc.c-torture/compile/attr-complex-method-2.c [target=avr]: Check
for "divsc3" as double = float per default.
* gcc.c-torture/compile/pr106537-1.c: Use __INTPTR_TYPE__ instead of
hard-coded "long".
* gcc.c-torture/compile/pr106537-2.c: Same.
* gcc.c-torture/compile/pr106537-3.c: Same.
* gcc.c-torture/execute/
20230630-3.c: Use __INT32_TYPE__ for bit-field
wider than 16 bits.
* gcc.c-torture/execute/
20230630-4.c: Same.
* gcc.c-torture/execute/pr109938.c: Require int32plus.
* gcc.c-torture/execute/pr109986.c: Same.
* gcc.dg/fold-ior-4.c: Same.
* gcc.dg/fold-ior-5.c: Same
* gcc.dg/fold-parity-5.c: Same.
* gcc.dg/fold-popcount-5.c: Same.
* gcc.dg/builtin-bswap-13.c [sizeof(int) < 4]: Use __INT32_TYPE__
instead of int.
* gcc.dg/builtin-bswap-14.c: Use __INT32_TYPE__ instead of int where
required by code.
* gcc.dg/c23-constexpr-9.c: Require large_double.
* gcc.dg/c23-nullptr-1.c [target=avr]: xfail.
* gcc.dg/loop-unswitch-10.c: Require size32plus.
* gcc.dg/loop-unswitch-14.c: Same.
* gcc.dg/loop-unswitch-11.c: Require int32.
* gcc.dg/pr101836.c: Use __SIZEOF_INT instead of hard-coded 4.
* gcc.dg/pr101836_1.c: Same.
* gcc.dg/pr101836_2.c: Same.
* gcc.dg/pr101836_3.c: Same.
*a = *b / (4.0 - 5.0fi);
}
-/* { dg-final { scan-tree-dump "__(?:gnu_)?divdc3" "optimized" } } */
+/* { dg-final { scan-tree-dump "__(?:gnu_)?divdc3" "optimized" { target { ! { avr-*-* } } } } } */
+/* { dg-final { scan-tree-dump "__(?:gnu_)?divsc3" "optimized" { target { avr-*-* } } } } */
This testcase checks that warn_compare_distinct_pointer_types is enabled by
default. */
-typedef int __u32;
+typedef __INT32_TYPE__ __u32;
struct xdp_md
{
int xdp_context (struct xdp_md *xdp)
{
- void *data = (void *)(long)xdp->data;
- __u32 *metadata = (void *)(long)xdp->data_meta;
+ void *data = (void *)(__INTPTR_TYPE__)xdp->data;
+ __u32 *metadata = (void *)(__INTPTR_TYPE__)xdp->data_meta;
__u32 ret;
if (metadata + 1 > data) /* { dg-warning "comparison of distinct pointer types" } */
/* { dg-do compile } */
/* { dg-options "-Wcompare-distinct-pointer-types" } */
-typedef int __u32;
+typedef __INT32_TYPE__ __u32;
struct xdp_md
{
int xdp_context (struct xdp_md *xdp)
{
- void *data = (void *)(long)xdp->data;
- __u32 *metadata = (void *)(long)xdp->data_meta;
+ void *data = (void *)(__INTPTR_TYPE__)xdp->data;
+ __u32 *metadata = (void *)(__INTPTR_TYPE__)xdp->data_meta;
__u32 ret;
if (metadata + 1 > data) /* { dg-warning "comparison of distinct pointer types" } */
/* { dg-do compile } */
/* { dg-options "-O0 -Wno-compare-distinct-pointer-types" } */
-typedef int __u32;
+typedef __INT32_TYPE__ __u32;
struct xdp_md
{
int xdp_context (struct xdp_md *xdp)
{
- void *data = (void *)(long)xdp->data;
- __u32 *metadata = (void *)(long)xdp->data_meta;
+ void *data = (void *)(__INTPTR_TYPE__)xdp->data;
+ __u32 *metadata = (void *)(__INTPTR_TYPE__)xdp->data_meta;
__u32 ret;
if (metadata + 1 > data) /* There shouldn't be a warning here. */
struct S {
- int i : 24;
+ __INT32_TYPE__ i : 24;
char c1 : 1;
char c2 : 1;
char c3 : 1;
#endif
struct S {
- int i : 24;
+ __INT32_TYPE__ i : 24;
char c1 : 1;
char c2 : 1;
char c3 : 1;
+/* { dg-require-effective-target int32plus } */
/* PR tree-opt/109938 */
#include "../../gcc.dg/tree-ssa/pr109938.c"
+/* { dg-require-effective-target int32plus } */
/* PR middle-end/109986 */
#include "../../gcc.dg/tree-ssa/pr109986.c"
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
+#if __SIZEOF_INT__ < 4
+#define int __INT32_TYPE__
+#endif
+
int test_s32_0_1(int x) { return __builtin_bswap32(x) & 1; }
int test_s32_0_2(int x) { return __builtin_bswap32(x) & 2; }
int test_s32_0_240(int x) { return __builtin_bswap32(x) & 240; }
__attribute__ ((noinline, noclone))
-static int rt32 (int x, int y, int z) {
+static __INT32_TYPE__ rt32 (__INT32_TYPE__ x, int y, __INT32_TYPE__ z) {
return (__builtin_bswap32(x) >> y) & z;
}
#define TEST32(X,Y,Z) if(((__builtin_bswap32(X)>>Y)&Z)!=rt32(X,Y,Z)) abort()
-void test32(int x)
+void test32(__INT32_TYPE__ x)
{
TEST32(x,0,1);
TEST32(x,0,255);
/* { dg-options "-std=c23 -pedantic-errors" } */
/* { dg-add-options ieee } */
/* { dg-require-effective-target inff } */
+/* { dg-require-effective-target large_double } */
/* A conversion from signaling NaN to quiet NaN in a different format or type
is not valid for constexpr. */
/* { dg-do run } */
// { dg-require-effective-target thread_fence }
/* { dg-options "-std=c23 -pedantic-errors -Wall -Wextra -Wno-unused-variable" } */
+/* { dg-xfail-if "__atomic not supported" { "avr-*-*" } } */
#include <stdarg.h>
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-require-effective-target int32plus } */
unsigned int test_ior(unsigned char i)
{
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-require-effective-target int32plus } */
unsigned int test_ior(unsigned char i)
{
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-require-effective-target int32plus } */
int test_and4(unsigned int a)
{
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-require-effective-target int32plus } */
int test_and4(unsigned int a)
{
/* { dg-do compile } */
/* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-optimized" } */
+/* { dg-require-effective-target size32plus } */
int
__attribute__((noipa))
/* { dg-do compile } */
/* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-optimized" } */
+/* { dg-require-effective-target int32 } */
int
foo(double *a, double *b, double *c, double *d, double *r, int size, int order)
/* { dg-do compile } */
/* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-optimized --param=max-unswitch-insns=1000" } */
+/* { dg-require-effective-target size32plus } */
int
__attribute__((noipa))
struct trailing_array_3 *trailing_0,
struct trailing_array_4 *trailing_flex)
{
- expect(__builtin_object_size(normal->c, 1), 16);
- expect(__builtin_object_size(trailing_1->c, 1), 4);
+ expect(__builtin_object_size(normal->c, 1), 4 * __SIZEOF_INT__);
+ expect(__builtin_object_size(trailing_1->c, 1), __SIZEOF_INT__);
expect(__builtin_object_size(trailing_0->c, 1), 0);
expect(__builtin_object_size(trailing_flex->c, 1), -1);
}
struct trailing_array_3 *trailing_0,
struct trailing_array_4 *trailing_flex)
{
- expect(__builtin_object_size(normal->c, 1), 16);
- expect(__builtin_object_size(trailing_1->c, 1), 4);
+ expect(__builtin_object_size(normal->c, 1), 4 * __SIZEOF_INT__);
+ expect(__builtin_object_size(trailing_1->c, 1), __SIZEOF_INT__);
expect(__builtin_object_size(trailing_0->c, 1), 0);
expect(__builtin_object_size(trailing_flex->c, 1), -1);
}
struct trailing_array_3 *trailing_0,
struct trailing_array_4 *trailing_flex)
{
- expect(__builtin_object_size(normal->c, 1), 16);
- expect(__builtin_object_size(trailing_1->c, 1), 4);
+ expect(__builtin_object_size(normal->c, 1), 4 * __SIZEOF_INT__);
+ expect(__builtin_object_size(trailing_1->c, 1), __SIZEOF_INT__);
expect(__builtin_object_size(trailing_0->c, 1), -1);
expect(__builtin_object_size(trailing_flex->c, 1), -1);
}
struct trailing_array_3 *trailing_0,
struct trailing_array_4 *trailing_flex)
{
- expect(__builtin_object_size(normal->c, 1), 16);
+ expect(__builtin_object_size(normal->c, 1), 4 * __SIZEOF_INT__);
expect(__builtin_object_size(trailing_1->c, 1), -1);
expect(__builtin_object_size(trailing_0->c, 1), -1);
expect(__builtin_object_size(trailing_flex->c, 1), -1);