initial support for __[u]int128_t, which should be basically
compatible with VC++ and GCC.  The codegen/mangling angle hasn't
been fully ironed out yet.  Note that we accept int128_t even in
32-bit mode, unlike gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70464 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/uint128_t.c b/test/CodeGen/uint128_t.c
new file mode 100644
index 0000000..b3261dd
--- /dev/null
+++ b/test/CodeGen/uint128_t.c
@@ -0,0 +1,18 @@
+// RUN: clang-cc %s -emit-llvm -o -
+
+typedef unsigned long long uint64_t;
+extern uint64_t numer;
+extern uint64_t denom;
+
+uint64_t
+f(uint64_t val)
+{
+    __uint128_t tmp;
+
+    tmp = val;
+    tmp *= numer;
+    tmp /= denom;
+
+    return tmp;
+}
+
diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp
index 0f13527..5540a68 100644
--- a/test/CodeGenCXX/mangle.cpp
+++ b/test/CodeGenCXX/mangle.cpp
@@ -46,5 +46,8 @@
 namespace N { int f(int, int) { static int b; return b; } }
 
 // RUN: grep "_ZZN1N1gEvE1a =" %t | count 1 &&
-// RUN: grep "_ZGVZN1N1gEvE1a =" %t | count 1
+// RUN: grep "_ZGVZN1N1gEvE1a =" %t | count 1 &&
 namespace N { int h(); void g() { static int a = h(); } }
+
+// RUN: grep "_Z1fno" %t | count 1
+void f(__int128_t, __uint128_t) { } 
diff --git a/test/CodeGenObjC/encode-test-5.m b/test/CodeGenObjC/encode-test-5.m
index 970df3d..bf1a0a6 100644
--- a/test/CodeGenObjC/encode-test-5.m
+++ b/test/CodeGenObjC/encode-test-5.m
@@ -6,6 +6,11 @@
 // RUN: grep jf %t | count 1 &&
 char *b = @encode(_Complex float);
 
-// RUN: grep jd %t | count 1
+// RUN: grep jd %t | count 1 &&
 char *c = @encode(_Complex double);
 
+// RUN: grep "t.00" %t | count 1 &&
+char *e = @encode(__int128_t);
+
+// RUN: grep "T.00" %t | count 1
+char *f = @encode(__uint128_t);
diff --git a/test/Sema/types.c b/test/Sema/types.c
index 40dfd89..d1e9fcc 100644
--- a/test/Sema/types.c
+++ b/test/Sema/types.c
@@ -8,3 +8,14 @@
 restrict S y; // expected-error {{restrict requires a pointer or reference ('S' (aka 'int *[2]') is invalid)}}
 
 
+
+// int128_t is available.
+int a() {
+  __int128_t s;
+  __uint128_t t;
+}
+// but not a keyword
+int b() {
+  int __int128_t;
+  int __uint128_t;
+}