From: Jason Merrill Date: Tue, 12 Feb 2013 16:32:30 +0000 (-0500) Subject: int128 tests X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bf94424ce151e33c75157aea2428977df01590e8;p=gcc.git int128 tests From-SVN: r195985 --- diff --git a/gcc/testsuite/g++.dg/ext/int128-3.C b/gcc/testsuite/g++.dg/ext/int128-3.C new file mode 100644 index 00000000000..f62b62d1067 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/int128-3.C @@ -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)); diff --git a/gcc/testsuite/g++.dg/ext/int128-4.C b/gcc/testsuite/g++.dg/ext/int128-4.C new file mode 100644 index 00000000000..2d30a082d55 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/int128-4.C @@ -0,0 +1,19 @@ +// Test for int128 arithmetic conversions. +// { dg-do compile { target int128 } } +// { dg-options "-std=gnu++11" } + +template struct same; +template struct same { }; +#define assert_same(T,U) (same()) + +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); +}