Debian Codegraph @

gcc/testsuite/g++.target/i386/pr108934.C

raw
1 // PR c++/108934
2 // { dg-do compile { target c++11 } }
3
4 struct S { unsigned long long a[2]; };
5 struct T { unsigned long long b[6]; };
6 struct U { unsigned long long c[2]; long double d; unsigned long long e[2]; };
7
8 #if __SIZEOF_LONG_DOUBLE__ == 16 && __LDBL_MANT_DIG__ == 64 && __SIZEOF_LONG_LONG__ == 8
9 constexpr long double
10 foo (S x)
11 {
12 return __builtin_bit_cast (long double, x);
13 }
14
15 constexpr S a = { 0ULL, 0xffffffffffff0000ULL };
16 constexpr long double b = foo (a);
17 static_assert (b == 0.0L, "");
18
19 constexpr U
20 bar (T x)
21 {
22 return __builtin_bit_cast (U, x);
23 }
24
25 constexpr T c = { 0ULL, 0ULL, 0ULL, 0xffffffffffff0000ULL, 0ULL, 0ULL };
26 constexpr U d = bar (c);
27 static_assert (d.d == 0.0L, "");
28 #endif