diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2009-03-23 09:34:13 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-03-23 09:34:13 (GMT) |
commit | 67ad0519fd165acee4a4d2a94fa502e9e4847bd0 (patch) | |
tree | 1dbf50b3dff8d5ca7e9344733968c72704eb15ff /config.tests/unix/doubleformat/doubleformattest.cpp | |
download | Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.zip Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.gz Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.bz2 |
Long live Qt!
Diffstat (limited to 'config.tests/unix/doubleformat/doubleformattest.cpp')
-rw-r--r-- | config.tests/unix/doubleformat/doubleformattest.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/config.tests/unix/doubleformat/doubleformattest.cpp b/config.tests/unix/doubleformat/doubleformattest.cpp new file mode 100644 index 0000000..d71caba --- /dev/null +++ b/config.tests/unix/doubleformat/doubleformattest.cpp @@ -0,0 +1,25 @@ +/* + +LE: strings | grep 0123ABCD0123ABCD +BE: strings | grep DCBA3210DCBA3210 + +LE arm-swaped-dword-order: strings | grep ABCD0123ABCD0123 +BE arm-swaped-dword-order: strings | grep 3210DCBA3210DCBA (untested) + +tested on x86, arm-le (gp), aix + +*/ + +#include <stdlib.h> + +// equals static char c [] = "0123ABCD0123ABCD\0\0\0\0\0\0\0" +static double d [] = { 710524581542275055616.0, 710524581542275055616.0}; + +int main(int argc, char **argv) +{ + // make sure the linker doesn't throw away the arrays + double *d2 = (double *) d; + if (argc > 3) + d[1] += 1; + return d2[0] + d[2] + atof(argv[1]); +} |