[PATCH] Skip jit tests for targets that don't support -lgccjit
H.J. Lu
hjl.tools@gmail.com
Fri May 8 19:12:50 GMT 2020
Since libgccjit.so is linked into jit tests, skip jit tests for targets
that don't support -lgccjit.
OK for master?
H.J.
---
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.
---
gcc/testsuite/jit.dg/jit.exp | 5 +++++
gcc/testsuite/lib/target-supports.exp | 15 +++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/gcc/testsuite/jit.dg/jit.exp b/gcc/testsuite/jit.dg/jit.exp
index 13e8ab4dbfe..2f54681713b 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 13761491e63..61351738c97 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -10226,3 +10226,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"]
+}
--
2.26.2
More information about the Gcc-patches
mailing list