1 // Test fold-const.c (fold_range_test) optimizations.
3 // { dg-options "-O2" } */
9 #if (INT_MAX == 2147483647) && (INT_MIN == -2147483648) \
10 && (SCHAR_MIN == -128) && (SCHAR_MAX == 127) \
11 && (UCHAR_MIN == 0) && (UCHAR_MAX == 255)
34 #define T(IDX, TYPE, TEST, YESARR, NOARR) \
35 void __attribute__((noinline)) \
41 #include "range-test-2.C"
50 #define T(IDX, TYPE, TEST, YESARR, NOARR) \
52 static TYPE yesarr##IDX [] = YESARR; \
53 static TYPE noarr##IDX [] = NOARR; \
54 for (i = 0; i < (int) (sizeof (yesarr##IDX) / sizeof (TYPE)); ++i) \
57 test##IDX (yesarr##IDX [i]); \
59 printf ("test" #IDX " failed for yesarr [%u]\n", i), ++fails; \
62 for (i = 0; i < (int) (sizeof (noarr##IDX) / sizeof (TYPE)); ++i) \
64 test##IDX (noarr##IDX [i]); \
66 printf ("test" #IDX " failed for noarr [%u]\n", i), ++fails; \
69 #include "range-test-2.C"
80 /* Use `C' instead of `,' below to separate array entries. */
82 T(26, enum3, x == enum3_one || x == enum3_two || x == enum3_three,
83 { enum3_one C enum3_two C enum3_three }, { enum3_zero C enum3_four
84 C enum3_five C enum3_six C enum3_seven })