pow tests: Defeat compiler optimizations.
authorBruno Haible <bruno@clisp.org>
Sat, 8 Oct 2011 12:03:06 +0000 (14:03 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 8 Oct 2011 12:03:06 +0000 (14:03 +0200)
* tests/test-pow.c (main): Assign arguments to x and y before use.

ChangeLog
tests/test-pow.c

index 6adcad6..942ee76 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-10-08  Bruno Haible  <bruno@clisp.org>
 
+       pow tests: Defeat compiler optimizations.
+       * tests/test-pow.c (main): Assign arguments to x and y before use.
+
+2011-10-08  Bruno Haible  <bruno@clisp.org>
+
        gnulib-tool: Improve last commit.
        * gnulib-tool (func_modules_transitive_closure): Simplify code.
        (func_emit_autoconf_snippets): Instead of invoking func_acceptable,
index 629b908..539feff 100644 (file)
@@ -33,7 +33,9 @@ int
 main ()
 {
   /* A particular value.  */
-  z = pow (243.0, 1.2);
+  x = 243.0;
+  y = 1.2;
+  z = pow (x, y);
   ASSERT (z >= 728.9999999 && z <= 729.0000001);
 
   return 0;