mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-16 03:10:28 +08:00
int128 tests
From-SVN: r195985
This commit is contained in:
parent
18a7895438
commit
bf94424ce1
12
gcc/testsuite/g++.dg/ext/int128-3.C
Normal file
12
gcc/testsuite/g++.dg/ext/int128-3.C
Normal file
@ -0,0 +1,12 @@
|
||||
// Test for int128 enums.
|
||||
// { dg-do compile { target int128 } }
|
||||
// { dg-options "" }
|
||||
|
||||
enum E {
|
||||
e1 = 0xffffffffffffffff,
|
||||
e2, e3
|
||||
} e = e3;
|
||||
|
||||
#define SA(I,X) int a##I[(X)? 1 : -1]
|
||||
|
||||
SA(1, sizeof(E) == sizeof(__int128));
|
19
gcc/testsuite/g++.dg/ext/int128-4.C
Normal file
19
gcc/testsuite/g++.dg/ext/int128-4.C
Normal file
@ -0,0 +1,19 @@
|
||||
// Test for int128 arithmetic conversions.
|
||||
// { dg-do compile { target int128 } }
|
||||
// { dg-options "-std=gnu++11" }
|
||||
|
||||
template <class T, class U> struct same;
|
||||
template <class T> struct same<T,T> { };
|
||||
#define assert_same(T,U) (same<T,U>())
|
||||
|
||||
int main()
|
||||
{
|
||||
long long ll;
|
||||
unsigned long long ull;
|
||||
__int128 i8;
|
||||
unsigned __int128 u8;
|
||||
assert_same (decltype (ll+i8), __int128);
|
||||
assert_same (decltype (ull+i8), __int128);
|
||||
assert_same (decltype (ll+u8), unsigned __int128);
|
||||
assert_same (decltype (ull+u8), unsigned __int128);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user