Description: Fix __float80 and __float128 support
 .
 cbmc (5.10-3) unstable; urgency=low
 .
   * Fix regression tests using __float128, which is not available on all
     architectures.
Author: Michael Tautschnig <mt@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2018-10-01

--- cbmc-5.10.orig/regression/ansi-c/gcc_float_types1/main.c
+++ cbmc-5.10/regression/ansi-c/gcc_float_types1/main.c
@@ -1,9 +1,12 @@
 // for gcc, __float80 and __float128 are typedefs
 // for clang, __float128 is a keyword, and __float80 doesn't exist.
 
-#ifdef __clang__
+#if defined(__clang__) || \
+    !(defined(__ia64__) || defined(__x86_64__) || defined(__i386__))
 int __float80;
+#if (defined(__hppa__) || defined(__powerpc__))
 __float128 f128;
+#endif
 #else
 __float80 f80;
 __float128 f128;
--- cbmc-5.10.orig/regression/ansi-c/gcc_types_compatible_p1/main.c
+++ cbmc-5.10/regression/ansi-c/gcc_types_compatible_p1/main.c
@@ -98,7 +98,8 @@ STATIC_ASSERT(!__builtin_types_compatibl
 STATIC_ASSERT(!__builtin_types_compatible_p(__int128, unsigned __int128));
 
 // clang doesn't have these
-#if !defined(__clang__)
+#if !defined(__clang__) && \
+    (defined(__ia64__) || defined(__x86_64__) || defined(__i386__))
 #if __GNUC__ >= 7
 STATIC_ASSERT(!__builtin_types_compatible_p(_Float32, float));
 STATIC_ASSERT(!__builtin_types_compatible_p(_Float64, double));
--- cbmc-5.10.orig/src/ansi-c/ansi_c_internal_additions.cpp
+++ cbmc-5.10/src/ansi-c/ansi_c_internal_additions.cpp
@@ -194,9 +194,8 @@ void ansi_c_internal_additions(std::stri
 
     if(
       config.ansi_c.arch == "i386" || config.ansi_c.arch == "x86_64" ||
-      config.ansi_c.arch == "x32" || config.ansi_c.arch == "powerpc" ||
-      config.ansi_c.arch == "ppc64" || config.ansi_c.arch == "ppc64le" ||
-      config.ansi_c.arch == "ia64")
+      config.ansi_c.arch == "x32" || config.ansi_c.arch == "ia64" ||
+      config.ansi_c.arch == "powerpc" || config.ansi_c.arch == "ppc64")
     {
       // https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html
       // For clang, __float128 is a keyword.
@@ -204,6 +203,12 @@ void ansi_c_internal_additions(std::stri
       if(config.ansi_c.mode != configt::ansi_ct::flavourt::CLANG)
         code += "typedef __CPROVER_Float128 __float128;\n";
     }
+    else if(config.ansi_c.arch == "ppc64le")
+    {
+      // https://patchwork.ozlabs.org/patch/792295/
+      if(config.ansi_c.mode != configt::ansi_ct::flavourt::CLANG)
+        code += "typedef __CPROVER_Float128 __ieee128;\n";
+    }
     else if(config.ansi_c.arch == "hppa")
     {
       // https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html
