aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-05-14 16:34:52 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-05-14 16:35:03 -0700
commitd2a359fe5d72e28433c92e64dcbdaa93eb39caf4 (patch)
treef234e607551cfbe42b02876e829f3ebf39a8eaa0 /gcc
parent3f30a274913bde0a1e01a86ce7c85e3be34ea13f (diff)
downloadgcc-d2a359fe5d72e28433c92e64dcbdaa93eb39caf4.zip
gcc-d2a359fe5d72e28433c92e64dcbdaa93eb39caf4.tar.gz
gcc-d2a359fe5d72e28433c92e64dcbdaa93eb39caf4.tar.bz2
Skip jit tests for targets that don't support -lgccjit
Since libgccjit.so is linked into jit tests, skip jit tests for targets that don't support -lgccjit. gcc/ PR jit/94778 * doc/sourcebuild.texi: Document effective target lgccjit. gcc/testsuite/ PR jit/94778 * jit.dg/jit.exp: Skip jit tests for targets that don't support -lgccjit. * lib/target-supports.exp (check_effective_target_lgccjit): New.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/doc/sourcebuild.texi3
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/jit.dg/jit.exp5
-rw-r--r--gcc/testsuite/lib/target-supports.exp15
5 files changed, 35 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 27b4b04..d855ee6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR jit/94778
+ * doc/sourcebuild.texi: Document effective target lgccjit.
+
2020-05-14 Andrew Stubbs <ams@codesourcery.com>
* config/gcn/gcn-valu.md (add<mode>3_zext_dup): Change to a
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 240d6e4..0f70e4b 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2494,6 +2494,9 @@ Target uses comdat groups.
@item indirect_calls
Target supports indirect calls, i.e. calls where the target is not
constant.
+
+@item lgccjit
+Target supports -lgccjit, i.e. libgccjit.so can be linked into jit tests.
@end table
@subsubsection Local to tests in @code{gcc.target/i386}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7319b20..8dfdfc6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR jit/94778
+ * jit.dg/jit.exp: Skip jit tests for targets that don't support
+ -lgccjit.
+ * lib/target-supports.exp (check_effective_target_lgccjit): New.
+
2020-05-14 Andrew Stubbs <ams@codesourcery.com>
* testsuite/gcc.target/gcn/gcn.exp: New file.
diff --git a/gcc/testsuite/jit.dg/jit.exp b/gcc/testsuite/jit.dg/jit.exp
index 13e8ab4..2f54681 100644
--- a/gcc/testsuite/jit.dg/jit.exp
+++ b/gcc/testsuite/jit.dg/jit.exp
@@ -38,6 +38,11 @@ load_lib gcc.exp
load_lib g++.exp
load_lib dejagnu.exp
+# Skip these tests for targets that don't support -lgccjit
+if { ![check_effective_target_lgccjit] } {
+ return
+}
+
# Look for lines of the form:
# definitely lost: 11,316 bytes in 235 blocks
# indirectly lost: 352 bytes in 4 blocks
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 88f4a9c..3e91a81 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -10234,3 +10234,18 @@ proc check_effective_target_indirect_calls { } {
}
return 1
}
+
+# Return 1 if we can use the -lgccjit option, 0 otherwise.
+
+proc check_effective_target_lgccjit { } {
+ if { [info procs jit_target_compile] == "" } then {
+ global GCC_UNDER_TEST
+ if ![info exists GCC_UNDER_TEST] {
+ set GCC_UNDER_TEST "[find_gcc]"
+ }
+ proc jit_target_compile { source dest type options } [info body gcc_target_compile]
+ }
+ return [check_no_compiler_messages lgccjit executable {
+ int main() { return 0; }
+ } "-lgccjit"]
+}