Doing this caught missing "return" statements in the examples.
This brings the result I see in jit.sum to: # of expected passes 4286
Committed to branch dmalcolm/jit:
gcc/jit/ChangeLog.jit:
* docs/examples/install-hello-world.c (main): Fix missing
"return".
* docs/examples/tut01-square.c (main): Likewise.
* docs/examples/tut02-sum-of-squares.c (main): Likewise.
gcc/testsuite/ChangeLog.jit:
* jit.dg/jit.exp: When constructing "tests", add the example files
from the documentation, to ensure that they compile.
(I accidentally committed this to gcc/testsuite/ChangeLog; I've fixed
it up to use ChangeLog.jit in a subsequent commit)
---
gcc/jit/ChangeLog.jit | 7 +++++++
gcc/jit/docs/examples/install-hello-world.c | 1 +
gcc/jit/docs/examples/tut01-square.c | 1 +
gcc/jit/docs/examples/tut02-sum-of-squares.c | 1 +
gcc/testsuite/ChangeLog | 5 +++++
gcc/testsuite/jit.dg/jit.exp | 7 +++++++
6 files changed, 22 insertions(+)
diff --git a/gcc/jit/ChangeLog.jit b/gcc/jit/ChangeLog.jit
index b42038e..7ee7ebf 100644
--- a/gcc/jit/ChangeLog.jit
+++ b/gcc/jit/ChangeLog.jit
@@ -1,3 +1,10 @@
+2014-09-18 David Malcolm <[email protected]>
+
+ * docs/examples/install-hello-world.c (main): Fix missing
+ "return".
+ * docs/examples/tut01-square.c (main): Likewise.
+ * docs/examples/tut02-sum-of-squares.c (main): Likewise.
+
2014-09-17 David Malcolm <[email protected]>
* docs/Makefile: New file.
diff --git a/gcc/jit/docs/examples/install-hello-world.c
b/gcc/jit/docs/examples/install-hello-world.c
index c75543d..29afad9 100644
--- a/gcc/jit/docs/examples/install-hello-world.c
+++ b/gcc/jit/docs/examples/install-hello-world.c
@@ -100,4 +100,5 @@ main (int argc, char **argv)
gcc_jit_context_release (ctxt);
gcc_jit_result_release (result);
+ return 0;
}
diff --git a/gcc/jit/docs/examples/tut01-square.c
b/gcc/jit/docs/examples/tut01-square.c
index ddb218e..ea07b92 100644
--- a/gcc/jit/docs/examples/tut01-square.c
+++ b/gcc/jit/docs/examples/tut01-square.c
@@ -84,4 +84,5 @@ main (int argc, char **argv)
error:
gcc_jit_context_release (ctxt);
gcc_jit_result_release (result);
+ return 0;
}
diff --git a/gcc/jit/docs/examples/tut02-sum-of-squares.c
b/gcc/jit/docs/examples/tut02-sum-of-squares.c
index e2811ac..1970a36 100644
--- a/gcc/jit/docs/examples/tut02-sum-of-squares.c
+++ b/gcc/jit/docs/examples/tut02-sum-of-squares.c
@@ -149,4 +149,5 @@ main (int argc, char **argv)
error:
gcc_jit_context_release (ctxt);
gcc_jit_result_release (result);
+ return 0;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 448a7ef..942e219 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-18 David Malcolm <[email protected]>
+
+ * jit.dg/jit.exp: When constructing "tests", add the example files
+ from the documentation, to ensure that they compile.
+
2014-09-09 Bill Schmidt <[email protected]>
* gcc.target/powerpc/swaps-p8-15.c: Remove scan-assembler-not for
diff --git a/gcc/testsuite/jit.dg/jit.exp b/gcc/testsuite/jit.dg/jit.exp
index 878ff4b..7986185 100644
--- a/gcc/testsuite/jit.dg/jit.exp
+++ b/gcc/testsuite/jit.dg/jit.exp
@@ -33,7 +33,14 @@ if ![info exists GCC_UNDER_TEST] {
dg-init
# Gather a list of all tests.
+
+# Tests within the testsuite: gcc/testsuite/jit.dg/test-*.c
set tests [lsort [find $srcdir/$subdir test-*.c]]
+
+# We also test the examples within the documentation, to ensure that
+# they compile:
+set tests [lsort [concat $tests [find $srcdir/../jit/docs/examples *.c]]]
+
verbose "tests: $tests"
proc jit-dg-test { prog do_what extra_tool_flags } {
--
1.7.11.7