For PR11916: Add support for g++'s __int128 keyword. Unlike __int128_t, this is
a type specifier and can be combined with unsigned. This allows libstdc++4.7 to
be used with clang in c++98 mode.

Several other changes are still required for libstdc++4.7 to work with clang in
c++11 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153999 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/128bitint.c b/test/Sema/128bitint.c
index fe83d97..89d3ee2 100644
--- a/test/Sema/128bitint.c
+++ b/test/Sema/128bitint.c
@@ -7,3 +7,7 @@
 
 // PR5435
 __uint128_t b = (__uint128_t)-1;
+
+// PR11916: Support for libstdc++ 4.7
+__int128 i = (__int128)0;
+unsigned __int128 u = (unsigned __int128)-1;
diff --git a/test/Sema/types.c b/test/Sema/types.c
index 332b525..3bec83e 100644
--- a/test/Sema/types.c
+++ b/test/Sema/types.c
@@ -19,7 +19,21 @@
   int __int128_t;
   int __uint128_t;
 }
+// __int128 is a keyword
+int c() {
+  __int128 i;
+  unsigned __int128 j;
+  long unsigned __int128 k; // expected-error {{'long __int128' is invalid}}
+  int __int128; // expected-error {{cannot combine with previous}} expected-warning {{does not declare anything}}
+}
+// __int128_t is __int128; __uint128_t is unsigned __int128.
+typedef __int128 check_int_128; // expected-note {{here}}
+typedef __int128_t check_int_128; // expected-note {{here}} expected-warning {{redefinition}}
+typedef int check_int_128; // expected-error {{different types ('int' vs '__int128_t' (aka '__int128'))}}
 
+typedef unsigned __int128 check_uint_128; // expected-note {{here}}
+typedef __uint128_t check_uint_128; // expected-note {{here}} expected-warning {{redefinition}}
+typedef int check_uint_128; // expected-error {{different types ('int' vs '__uint128_t' (aka 'unsigned __int128'))}}
 
 // Array type merging should convert array size to whatever matches the target
 // pointer size.