diff mbox series

[V6,08/11] bpf: make target-supports.exp aware of eBPF

Message ID 20190829151347.13536-9-jose.marchesi@oracle.com
State New
Headers show
Series eBPF support for GCC | expand

Commit Message

Jose E. Marchesi Aug. 29, 2019, 3:13 p.m. UTC
This patch makes the several effective target checks in
target-supports.exp to be aware of eBPF targets.

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp
        (check_effective_target_trampolines): Adapt to eBPF.
	(check_effective_target_stack_size): Likewise.
	(dg-effective-target-value): Likewise.
	(check_effective_target_indirect_jumps): Likewise.
	(check_effective_target_nonlocal_goto): Likewise.
	(check_effective_target_global_constructor): Likewise.
	(check_effective_target_return_address): Likewise.
---
 gcc/testsuite/ChangeLog               |  9 +++++++++
 gcc/testsuite/lib/target-supports.exp | 18 +++++++++++-------
 2 files changed, 20 insertions(+), 7 deletions(-)

Comments

Mike Stump Sept. 11, 2019, 6:58 p.m. UTC | #1
On Aug 29, 2019, at 8:13 AM, Jose E. Marchesi <jose.marchesi@oracle.com> wrote:
> 
> This patch makes the several effective target checks in
> target-supports.exp to be aware of eBPF targets.

Ok.

These sort of updates will now be obvious to you, now that you have gotten your feet wet.  This applies to the indirect calls style changes as well.
Mike Stump Sept. 12, 2019, 12:35 a.m. UTC | #2
On Aug 29, 2019, at 8:13 AM, Jose E. Marchesi <jose.marchesi@oracle.com> wrote:
> 
> This patch makes the several effective target checks in
> target-supports.exp to be aware of eBPF targets.

Ok.

These sort of updates will now be obvious to you, now that you have gotten your feet wet.  This applies to the indirect calls style changes as well.
diff mbox series

Patch

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index f457a46a02b..ce08a2f8421 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -526,7 +526,8 @@  proc check_effective_target_trampolines { } {
 	 || [istarget nvptx-*-*]
 	 || [istarget hppa2.0w-hp-hpux11.23]
 	 || [istarget hppa64-hp-hpux11.23]
-	 || [istarget pru-*-*] } {
+	 || [istarget pru-*-*]
+	 || [istarget bpf-*-*] } {
 	return 0;
     }
     return 1
@@ -781,7 +782,7 @@  proc add_options_for_tls { flags } {
 # Return 1 if indirect jumps are supported, 0 otherwise.
 
 proc check_effective_target_indirect_jumps {} {
-    if { [istarget nvptx-*-*] } {
+    if { [istarget nvptx-*-*] || [istarget bpf-*-*] } {
 	return 0
     }
     return 1
@@ -790,7 +791,7 @@  proc check_effective_target_indirect_jumps {} {
 # Return 1 if nonlocal goto is supported, 0 otherwise.
 
 proc check_effective_target_nonlocal_goto {} {
-    if { [istarget nvptx-*-*] } {
+    if { [istarget nvptx-*-*] || [istarget bpf-*-*] } {
 	return 0
     }
     return 1
@@ -799,10 +800,9 @@  proc check_effective_target_nonlocal_goto {} {
 # Return 1 if global constructors are supported, 0 otherwise.
 
 proc check_effective_target_global_constructor {} {
-    if { [istarget nvptx-*-*] } {
-	return 0
-    }
-    if { [istarget amdgcn-*-*] } {
+    if { [istarget nvptx-*-*]
+	 || [istarget amdgcn-*-*]
+	 || [istarget bpf-*-*] } {
 	return 0
     }
     return 1
@@ -825,6 +825,10 @@  proc check_effective_target_return_address {} {
     if { [istarget nvptx-*-*] } {
 	return 0
     }
+    # No notion of return address in eBPF.
+    if { [istarget bpf-*-*] } {
+	return 0
+    }
     # It could be supported on amdgcn, but isn't yet.
     if { [istarget amdgcn*-*-*] } {
 	return 0