view gcc/testsuite/g++.dg/ext/int128-4.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// Test for int128 arithmetic conversions.
// { dg-do compile { target int128 } }
// { dg-require-effective-target c++11 }
// { dg-options "" }

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);
}