diff options
author | Tim Northover <Tim.Northover@arm.com> | 2013-01-22 09:46:51 +0000 |
---|---|---|
committer | Tim Northover <Tim.Northover@arm.com> | 2013-01-22 09:46:51 +0000 |
commit | 9ec55f24b8f848bb37a9971100cf2fca379d5572 (patch) | |
tree | fdb28f0db2d5d873ef4c3bbfa1ce7aaddf5b5399 /test/PCH | |
parent | 6a94c1ea2d9ee397cc9d75045117a39e8f62235d (diff) |
Switch to APFloat constructor taking fltSemantics.
This change also makes the serialisation store the required semantics,
fixing an issue where PPC128 was always assumed when re-reading a
128-bit value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173139 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/PCH')
-rw-r--r-- | test/PCH/floating-literal.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/PCH/floating-literal.c b/test/PCH/floating-literal.c new file mode 100644 index 0000000000..7bf10d4e79 --- /dev/null +++ b/test/PCH/floating-literal.c @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -triple mips64-none-linux-gnu -emit-pch -o %t %s +// RUN: %clang_cc1 -x ast -ast-print %t | FileCheck %s + +// Make sure the semantics of FloatingLiterals are stored correctly in +// the AST. Previously, the ASTWriter didn't store anything and the +// reader assumed PPC 128-bit float semantics, which is incorrect for +// targets with 128-bit IEEE long doubles. + +long double foo = 1.0E4000L; +// CHECK: long double foo = 1.0E+4000L; + +// Just as well check the others are still sane while we're here... + +double bar = 1.0E300; +// CHECK: double bar = 1.0E+300; + +float wibble = 1.0E40; +// CHECK: float wibble = 1.0E+40; |