From bc8fc0f5e0c00d2d09840c615b145e2e2ab35fb7 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 11 Jun 2013 21:56:55 +0000 Subject: Use llvm::APFloat for formatting if a target is available. Each target when debugging has a "ASTContext" that helps us to use the correct floating point semantics. Now that APFloat supports toString we now use that. If we don't have a target, we still fall back on the old display methodology, but the important formatting should always have a target available and thus use the compiler floating point code. Modified the test programs to use floating point constants that always will display correctly. We had some numbers that were being rounded, and now that we are using clang, we no longer round them and we get more correct results. llvm-svn: 183792 --- .../data-formatter/data-formatter-smart-array/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lldb/test/functionalities/data-formatter/data-formatter-smart-array/main.cpp') diff --git a/lldb/test/functionalities/data-formatter/data-formatter-smart-array/main.cpp b/lldb/test/functionalities/data-formatter/data-formatter-smart-array/main.cpp index 24ee5be9e9c..9279e414be3 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-smart-array/main.cpp +++ b/lldb/test/functionalities/data-formatter/data-formatter-smart-array/main.cpp @@ -36,12 +36,12 @@ struct SomeOtherData intarr[4] = 5; flarr[0] = 25.5; - flarr[1] = 25.7; - flarr[2] = 25.9; - flarr[3] = 26.4; - flarr[4] = 27.1; - flarr[5] = 27.3; - flarr[6] = 26.9; + flarr[1] = 25.25; + flarr[2] = 25.125; + flarr[3] = 26.75; + flarr[4] = 27.375; + flarr[5] = 27.5; + flarr[6] = 26.125; } }; @@ -51,7 +51,7 @@ int main (int argc, const char * argv[]) char *strptr = NULL; strptr = "Hello world!"; int intarr[5] = {1,1,2,3,5}; - float flarr[7] = {78.5,77.4,78.0,76.1,76.7,76.8,77.0}; + float flarr[7] = {78.5,77.25,78.0,76.125,76.75,76.875,77.0}; SomeData data; -- cgit v1.2.3