From 2169a39303b7503b9a7965cf120136c44103920b Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Thu, 26 Oct 2017 16:40:11 +0100 Subject: [PATCH] Add _Float128 spelling for 128-bit float type According to https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html, "On i386, x86_64, PowerPC, and IA-64 other than HP-UX, __float128 is an alias for _Float128" and we support __float128 --- regression/ansi-c/gcc_types_compatible_p1/main.c | 7 +++++++ src/ansi-c/scanner.l | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/regression/ansi-c/gcc_types_compatible_p1/main.c b/regression/ansi-c/gcc_types_compatible_p1/main.c index 4f327d51085..09b469b291f 100644 --- a/regression/ansi-c/gcc_types_compatible_p1/main.c +++ b/regression/ansi-c/gcc_types_compatible_p1/main.c @@ -67,6 +67,13 @@ STATIC_ASSERT(__builtin_types_compatible_p(typeof (hot) *, int *)); STATIC_ASSERT(__builtin_types_compatible_p(typeof (hot), typeof (janette))); STATIC_ASSERT(__builtin_types_compatible_p(__int128, signed __int128)); +#ifndef __clang__ +// clang doesn't have these +#if defined(__x86_64__) || defined(__i386__) +STATIC_ASSERT(__builtin_types_compatible_p(__float128, _Float128)); +#endif +#endif + /* Incompatible types */ STATIC_ASSERT(!__builtin_types_compatible_p(char, _Bool)); diff --git a/src/ansi-c/scanner.l b/src/ansi-c/scanner.l index 7a97b0a7b89..1511da8fbf3 100644 --- a/src/ansi-c/scanner.l +++ b/src/ansi-c/scanner.l @@ -466,7 +466,8 @@ void ansi_c_scanner_init() return make_identifier(); } -"__float128" { // clang doesn't have it +"__float128" | +"_Float128" { // clang doesn't have it if(PARSER.mode==configt::ansi_ct::flavourt::GCC) { loc(); return TOK_GCC_FLOAT128; } else