diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/dfp')
-rw-r--r-- | gcc/testsuite/gcc.dg/dfp/bitint-10.c | 49 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/dfp/bitint-9.c | 29 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/dfp/pr120631.c | 24 |
3 files changed, 102 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/dfp/bitint-10.c b/gcc/testsuite/gcc.dg/dfp/bitint-10.c new file mode 100644 index 0000000..4a73aeb --- /dev/null +++ b/gcc/testsuite/gcc.dg/dfp/bitint-10.c @@ -0,0 +1,49 @@ +/* PR middle-end/120631 */ +/* { dg-require-effective-target bitint } */ +/* { dg-options "-O2" } */ + +#if __BITINT_MAXWIDTH__ >= 128 +_Decimal128 a = 123456789135792468012345678900000000000.0dl; +_BitInt(128) b = 123456789135792468012345678900000000000wb; +_Decimal64 c = 12345678913579000000000000000000000000.0dd; +_BitInt(127) d = 12345678913579000000000000000000000000wb; +#endif +#if __BITINT_MAXWIDTH__ >= 256 +_Decimal128 m = 1234567891357924680123456789000000000000000000000000000000000000000000000000.0dl; +_BitInt(256) n = 1234567891357924680123456789000000000000000000000000000000000000000000000000wb; +_Decimal64 o = 1234567891357900000000000000000000000000000000000000000000000000000000000000.0dd; +_BitInt(255) p = 1234567891357900000000000000000000000000000000000000000000000000000000000000wb; +#endif + +int +main () +{ +#if __BITINT_MAXWIDTH__ >= 128 + if (a != b || (_BitInt(128)) a != b || c != d || (_BitInt(127)) c != d) + __builtin_abort (); + _Decimal128 e = 123456789135792468012345678900000000000.0dl; + _BitInt(128) f = 123456789135792468012345678900000000000wb; + _Decimal128 g = 123456789135792468012345678900000000000wb; + _BitInt(128) h = 123456789135792468012345678900000000000.0dl; + _Decimal64 i = 12345678913579000000000000000000000000.0dd; + _BitInt(128) j = 12345678913579000000000000000000000000wb; + _Decimal64 k = 12345678913579000000000000000000000000wb; + _BitInt(128) l = 12345678913579000000000000000000000000.0dd; + if (e != g || f != h || i != k || j != l) + __builtin_abort (); +#endif +#if __BITINT_MAXWIDTH__ >= 256 + if (m != n || (_BitInt(256)) m != n || o != p || (_BitInt(255)) o != p) + __builtin_abort (); + _Decimal128 q = 1234567891357924680123456789000000000000000000000000000000000000000000000000.0dl; + _BitInt(256) r = 1234567891357924680123456789000000000000000000000000000000000000000000000000wb; + _Decimal128 s = 1234567891357924680123456789000000000000000000000000000000000000000000000000wb; + _BitInt(256) t = 1234567891357924680123456789000000000000000000000000000000000000000000000000.0dl; + _Decimal64 u = 1234567891357900000000000000000000000000000000000000000000000000000000000000.0dd; + _BitInt(255) v = 1234567891357900000000000000000000000000000000000000000000000000000000000000wb; + _Decimal64 w = 1234567891357900000000000000000000000000000000000000000000000000000000000000wb; + _BitInt(255) x = 1234567891357900000000000000000000000000000000000000000000000000000000000000.0dd; + if (q != s || r != t || u != w || v != x) + __builtin_abort (); +#endif +} diff --git a/gcc/testsuite/gcc.dg/dfp/bitint-9.c b/gcc/testsuite/gcc.dg/dfp/bitint-9.c new file mode 100644 index 0000000..3161487 --- /dev/null +++ b/gcc/testsuite/gcc.dg/dfp/bitint-9.c @@ -0,0 +1,29 @@ +/* PR middle-end/120631 */ +/* { dg-require-effective-target bitint } */ +/* { dg-options "-O2" } */ + +#if __BITINT_MAXWIDTH__ >= 2048 +_Decimal128 a = 123456789135792468012345678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0dl; +_BitInt(2048) b = 123456789135792468012345678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb; +_Decimal64 c = 123456789135790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0dd; +_BitInt(1536) d = 123456789135790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb; +#endif + +int +main () +{ +#if __BITINT_MAXWIDTH__ >= 2048 + if (a != b || (_BitInt(2048)) a != b || c != d || (_BitInt(1536)) c != d) + __builtin_abort (); + _Decimal128 e = 123456789135792468012345678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0dl; + _BitInt(2048) f = 123456789135792468012345678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb; + _Decimal128 g = 123456789135792468012345678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb; + _BitInt(2048) h = 123456789135792468012345678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0dl; + _Decimal64 i = 123456789135790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0dd; + _BitInt(1536) j = 123456789135790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb; + _Decimal64 k = 123456789135790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000wb; + _BitInt(1536) l = 123456789135790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0dd; + if (e != g || f != h || i != k || j != l) + __builtin_abort (); +#endif +} diff --git a/gcc/testsuite/gcc.dg/dfp/pr120631.c b/gcc/testsuite/gcc.dg/dfp/pr120631.c new file mode 100644 index 0000000..2533e9d --- /dev/null +++ b/gcc/testsuite/gcc.dg/dfp/pr120631.c @@ -0,0 +1,24 @@ +/* PR middle-end/120631 */ +/* { dg-options "-O2" } */ + +_Decimal64 a = 1234567891357900000.0dd; +long long b = 1234567891357900000LL; +_Decimal32 c = 1234567000000000000.0df; +long long d = 1234567000000000000LL; + +int +main () +{ + if (a != b || (long long) a != b || c != d || (long long) c != d) + __builtin_abort (); + _Decimal64 e = 1234567891357900000.0dd; + long long f = 1234567891357900000LL; + _Decimal64 g = 1234567891357900000LL; + long long h = 1234567891357900000.0dd; + _Decimal32 i = 1234567000000000000.0df; + long long j = 1234567000000000000LL; + _Decimal32 k = 1234567000000000000LL; + long long l = 1234567000000000000.0df; + if (e != g || f != h || i != k || j != l) + __builtin_abort (); +} |