aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/doc/sourcebuild.texi4
-rw-r--r--gcc/testsuite/ChangeLog55
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010102-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010107-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20011109-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20011218-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20011229-1.c3
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20020129-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20020320-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20020706-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20020706-2.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20021205-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030921-1.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031023-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031023-2.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031023-3.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031023-4.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20040614-1.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20040909-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20050122-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20050202-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20060208-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20081108-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20150327.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/920428-2.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/920928-5.c3
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/930117-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/930607-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/991213-2.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/callind.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/calls-void.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/calls.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr21840.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr32139.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr35607.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr37433-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr37433.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr39941.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr40080.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr43635.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr43791.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr43845.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr44043.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr51694.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr77754-2.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr77754-3.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr77754-4.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr89663-2.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pta-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/stack-check-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/Walloc-size-larger-than-18.c1
-rw-r--r--gcc/testsuite/lib/target-supports.exp8
53 files changed, 162 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a8c3a2a..cb28809 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2019-09-09 Jose E. Marchesi <jose.marchesi@oracle.com>
+ * doc/sourcebuild.texi (Effective-Target Keywords): Document
+ indirect_calls.
+
+2019-09-09 Jose E. Marchesi <jose.marchesi@oracle.com>
+
* opt-functions.awk (integer_range_info): Make sure values are in
numeric context before operating with them.
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index d713c08..e4180cc 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2374,6 +2374,10 @@ Target supports @code{wchar_t} that is compatible with @code{char32_t}.
@item comdat_group
Target uses comdat groups.
+
+@item indirect_calls
+Target supports indirect calls, i.e. calls where the target is not
+constant.
@end table
@subsubsection Local to tests in @code{gcc.target/i386}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0a8c405..9533da6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,60 @@
2019-09-09 Jose E. Marchesi <jose.marchesi@oracle.com>
+ * lib/target-supports.exp (check_effective_target_indirect_calls):
+ New proc.
+ * gcc.c-torture/compile/20010102-1.c: Annotate with
+ dg-require-effective-target indirect_calls.
+ * gcc.c-torture/compile/20010107-1.c: Likewise.
+ * gcc.c-torture/compile/20011109-1.c: Likewise.
+ * gcc.c-torture/compile/20011218-1.c: Likewise.
+ * gcc.c-torture/compile/20011229-1.c: Likewise.
+ * gcc.c-torture/compile/20020129-1.c: Likewise.
+ * gcc.c-torture/compile/20020320-1.c: Likewise.
+ * gcc.c-torture/compile/20020706-1.c: Likewise.
+ * gcc.c-torture/compile/20020706-2.c: Likewise.
+ * gcc.c-torture/compile/20021205-1.c: Likewise.
+ * gcc.c-torture/compile/20030921-1.c: Likewise.
+ * gcc.c-torture/compile/20031023-1.c: Likewise.
+ * gcc.c-torture/compile/20031023-2.c: Likewise.
+ * gcc.c-torture/compile/20031023-3.c: Likewise.
+ * gcc.c-torture/compile/20031023-4.c: Likewise.
+ * gcc.c-torture/compile/20040614-1.c: Likewise.
+ * gcc.c-torture/compile/20040909-1.c: Likewise.
+ * gcc.c-torture/compile/20050122-1.c: Likewise.
+ * gcc.c-torture/compile/20050202-1.c: Likewise.
+ * gcc.c-torture/compile/20060208-1.c: Likewise.
+ * gcc.c-torture/compile/20081108-1.c: Likewise.
+ * gcc.c-torture/compile/20150327.c: Likewise.
+ * gcc.c-torture/compile/920428-2.c: Likewise.
+ * gcc.c-torture/compile/920928-5.c: Likewise.
+ * gcc.c-torture/compile/930117-1.c: Likewise.
+ * gcc.c-torture/compile/930607-1.c: Likewise.
+ * gcc.c-torture/compile/991213-2.c: Likewise.
+ * gcc.c-torture/compile/callind.c: Likewise.
+ * gcc.c-torture/compile/calls-void.c: Likewise.
+ * gcc.c-torture/compile/calls.c: Likewise.
+ * gcc.c-torture/compile/pr21840.c: Likewise.
+ * gcc.c-torture/compile/pr32139.c: Likewise.
+ * gcc.c-torture/compile/pr35607.c: Likewise.
+ * gcc.c-torture/compile/pr37433-1.c: Likewise.
+ * gcc.c-torture/compile/pr37433.c: Likewise.
+ * gcc.c-torture/compile/pr39941.c: Likewise.
+ * gcc.c-torture/compile/pr40080.c: Likewise.
+ * gcc.c-torture/compile/pr43635.c: Likewise.
+ * gcc.c-torture/compile/pr43791.c: Likewise.
+ * gcc.c-torture/compile/pr43845.c: Likewise.
+ * gcc.c-torture/compile/pr44043.c: Likewise.
+ * gcc.c-torture/compile/pr51694.c: Likewise.
+ * gcc.c-torture/compile/pr77754-2.c: Likewise.
+ * gcc.c-torture/compile/pr77754-3.c: Likewise.
+ * gcc.c-torture/compile/pr77754-4.c: Likewise.
+ * gcc.c-torture/compile/pr89663-2.c: Likewise.
+ * gcc.c-torture/compile/pta-1.c: Likewise.
+ * gcc.c-torture/compile/stack-check-1.c: Likewise.
+ * gcc.dg/Walloc-size-larger-than-18.c: Likewise.
+
+2019-09-09 Jose E. Marchesi <jose.marchesi@oracle.com>
+
* gcc.c-torture/compile/20000609-1.c: Annotate with
dg-require-stack-size.
* gcc.c-torture/compile/20000804-1.c: Likewise.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010102-1.c b/gcc/testsuite/gcc.c-torture/compile/20010102-1.c
index a409b56..3d9cc9e 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20010102-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20010102-1.c
@@ -4,6 +4,8 @@
Copyright (C) 2001 Free Software Foundation. */
+/* { dg-require-effective-target indirect_calls } */
+
# define PTR_INT_TYPE __PTRDIFF_TYPE__
struct _obstack_chunk
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010107-1.c b/gcc/testsuite/gcc.c-torture/compile/20010107-1.c
index 222def4..22461a0 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20010107-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20010107-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
unsigned long x[4];
void foo(void)
diff --git a/gcc/testsuite/gcc.c-torture/compile/20011109-1.c b/gcc/testsuite/gcc.c-torture/compile/20011109-1.c
index f1987a74..1deba2a 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20011109-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20011109-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
typedef struct { short x[4]; } S;
typedef struct { unsigned int a, b, c; S *d; } T;
diff --git a/gcc/testsuite/gcc.c-torture/compile/20011218-1.c b/gcc/testsuite/gcc.c-torture/compile/20011218-1.c
index bf63489..8db5b77 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20011218-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20011218-1.c
@@ -2,6 +2,8 @@
for the indirect call was exposed too early and reload couldn't
allocate it for multiplication and division. */
+/* { dg-require-effective-target indirect_calls } */
+
struct S {
int a, b;
void (*f) (long, int);
diff --git a/gcc/testsuite/gcc.c-torture/compile/20011229-1.c b/gcc/testsuite/gcc.c-torture/compile/20011229-1.c
index 97b2655..99aeab7 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20011229-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20011229-1.c
@@ -1,5 +1,8 @@
/* ICE: call insn does not satisfy its constraints, MMIX port.
Origin: ghostscript-6.52, reduction from hp@bitrange.com. */
+
+/* { dg-require-effective-target indirect_calls } */
+
struct s0
{
void (*init_color)(void *, void *);
diff --git a/gcc/testsuite/gcc.c-torture/compile/20020129-1.c b/gcc/testsuite/gcc.c-torture/compile/20020129-1.c
index 7b17ba4..c14ac07 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20020129-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20020129-1.c
@@ -1,5 +1,7 @@
/* Test call to static variable. */
+/* { dg-require-effective-target indirect_calls } */
+
typedef struct
{
long long a[10];
diff --git a/gcc/testsuite/gcc.c-torture/compile/20020320-1.c b/gcc/testsuite/gcc.c-torture/compile/20020320-1.c
index 385c061..5b7a17a 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20020320-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20020320-1.c
@@ -2,6 +2,8 @@
This testcase caused infinite loop in flow (several places),
because flow assumes gen_jump generates simple_jump_p. */
+/* { dg-require-effective-target indirect_calls } */
+
typedef void (*T) (void);
extern T x[];
diff --git a/gcc/testsuite/gcc.c-torture/compile/20020706-1.c b/gcc/testsuite/gcc.c-torture/compile/20020706-1.c
index c8811bc..9bbfc8a 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20020706-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20020706-1.c
@@ -1,6 +1,8 @@
// Contributed by Alexandre Oliva <aoliva@redhat.com>
// From Red Hat case 106165.
+/* { dg-require-effective-target indirect_calls } */
+
typedef struct s1
{
unsigned short v1;
diff --git a/gcc/testsuite/gcc.c-torture/compile/20020706-2.c b/gcc/testsuite/gcc.c-torture/compile/20020706-2.c
index b84dda6..2391f20 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20020706-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20020706-2.c
@@ -1,6 +1,8 @@
// Contributed by Alexandre Oliva <aoliva@redhat.com>
// From Red Hat case 106165.
+/* { dg-require-effective-target indirect_calls } */
+
typedef unsigned short (FUNC_P) (void *, unsigned char *, unsigned short);
void crashIt(int id, FUNC_P *func, unsigned char *funcparm)
diff --git a/gcc/testsuite/gcc.c-torture/compile/20021205-1.c b/gcc/testsuite/gcc.c-torture/compile/20021205-1.c
index 73648e9..27f4587 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20021205-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20021205-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
typedef struct x x;
extern void *baz(char *);
struct x { char * (*bar) (int); };
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030921-1.c b/gcc/testsuite/gcc.c-torture/compile/20030921-1.c
index 8199dc6..4bb3f46 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20030921-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20030921-1.c
@@ -2,6 +2,7 @@
f is not being emitted. TREE_SYMBOL_REFERENCED was being set
instead of calling mark_referenced. */
+/* { dg-require-effective-target indirect_calls } */
static void f(void);
void g(void (*x) (void)){x();}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031023-1.c b/gcc/testsuite/gcc.c-torture/compile/20031023-1.c
index be83776..1ee1ff7 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20031023-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20031023-1.c
@@ -1,5 +1,7 @@
/* Declaration of the frame size doesn't work on ptx. */
/* { dg-require-effective-target untyped_assembly } */
+/* { dg-require-effective-target indirect_calls } */
+
#ifndef ASIZE
# define ASIZE 0x10000000000UL
#endif
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031023-2.c b/gcc/testsuite/gcc.c-torture/compile/20031023-2.c
index 66d6645..5096516 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20031023-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20031023-2.c
@@ -1,4 +1,6 @@
/* Declaration of the frame size doesn't work on ptx. */
/* { dg-require-effective-target untyped_assembly } */
+/* { dg-require-effective-target indirect_calls } */
+
#define ASIZE 0x1000000000UL
#include "20031023-1.c"
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031023-3.c b/gcc/testsuite/gcc.c-torture/compile/20031023-3.c
index 5859634..1bb692f 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20031023-3.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20031023-3.c
@@ -1,4 +1,6 @@
/* Declaration of the frame size doesn't work on ptx. */
/* { dg-require-effective-target untyped_assembly } */
+/* { dg-require-effective-target indirect_calls } */
+
#define ASIZE 0x100000000UL
#include "20031023-1.c"
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031023-4.c b/gcc/testsuite/gcc.c-torture/compile/20031023-4.c
index 5c61f37..85c4dca 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20031023-4.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20031023-4.c
@@ -1,2 +1,4 @@
+/* { dg-require-effective-target indirect_calls } */
+
#define ASIZE 0x80000000UL
#include "20031023-1.c"
diff --git a/gcc/testsuite/gcc.c-torture/compile/20040614-1.c b/gcc/testsuite/gcc.c-torture/compile/20040614-1.c
index b692ab5..c889bb2 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20040614-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20040614-1.c
@@ -1,4 +1,5 @@
/* { dg-require-effective-target label_values } */
+/* { dg-require-effective-target indirect_calls } */
void f(int r1, int *fp)
{
diff --git a/gcc/testsuite/gcc.c-torture/compile/20040909-1.c b/gcc/testsuite/gcc.c-torture/compile/20040909-1.c
index 8bbf901..0f66cb2 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20040909-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20040909-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
static __inline__ int
one_utf8_to_utf16 () { }
diff --git a/gcc/testsuite/gcc.c-torture/compile/20050122-1.c b/gcc/testsuite/gcc.c-torture/compile/20050122-1.c
index a70907d..7bb7cee 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20050122-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20050122-1.c
@@ -1,4 +1,6 @@
/* From PR 19484. */
+/* { dg-require-effective-target indirect_calls } */
+
extern void foo (void) __attribute__((noreturn));
int n;
diff --git a/gcc/testsuite/gcc.c-torture/compile/20050202-1.c b/gcc/testsuite/gcc.c-torture/compile/20050202-1.c
index b3f8176..58ed54e 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20050202-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20050202-1.c
@@ -1,4 +1,6 @@
/* From PR 19578. */
+/* { dg-require-effective-target indirect_calls } */
+
extern void foo (void) __attribute__((noreturn));
void
diff --git a/gcc/testsuite/gcc.c-torture/compile/20060208-1.c b/gcc/testsuite/gcc.c-torture/compile/20060208-1.c
index 3881474..5025463 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20060208-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20060208-1.c
@@ -1,5 +1,7 @@
/* PR middle-end/26092 */
+/* { dg-require-effective-target indirect_calls } */
/* { dg-skip-if "can't take address of malloc" { nvptx-*-* } } */
+
typedef __SIZE_TYPE__ size_t;
extern void *malloc (size_t);
diff --git a/gcc/testsuite/gcc.c-torture/compile/20081108-1.c b/gcc/testsuite/gcc.c-torture/compile/20081108-1.c
index 3209a90..a1f54e8 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20081108-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20081108-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
/* Test function call with function designator involving VLA
side-effects does not lead to an ICE. */
diff --git a/gcc/testsuite/gcc.c-torture/compile/20150327.c b/gcc/testsuite/gcc.c-torture/compile/20150327.c
index 373ea61..125b722 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20150327.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20150327.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
int a;
int (*b)(), (*c)();
int fn1(int p1) {
diff --git a/gcc/testsuite/gcc.c-torture/compile/920428-2.c b/gcc/testsuite/gcc.c-torture/compile/920428-2.c
index f313b32..817fff0 100644
--- a/gcc/testsuite/gcc.c-torture/compile/920428-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/920428-2.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
double sin(double x);
double cos(double x);
double tan(double x);
diff --git a/gcc/testsuite/gcc.c-torture/compile/920928-5.c b/gcc/testsuite/gcc.c-torture/compile/920928-5.c
index 8c975f0..b9f9dcb 100644
--- a/gcc/testsuite/gcc.c-torture/compile/920928-5.c
+++ b/gcc/testsuite/gcc.c-torture/compile/920928-5.c
@@ -1,4 +1,7 @@
/* REPRODUCED:CC1:SIGNAL MACHINE:m68k OPTIONS:-fpcc-struct-return */
+
+/* { dg-require-effective-target indirect_calls } */
+
struct b{};
f(struct b(*f)())
{
diff --git a/gcc/testsuite/gcc.c-torture/compile/930117-1.c b/gcc/testsuite/gcc.c-torture/compile/930117-1.c
index 83317cd..06466f5 100644
--- a/gcc/testsuite/gcc.c-torture/compile/930117-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/930117-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
f(x)
{
(*(void (*)())&x)();
diff --git a/gcc/testsuite/gcc.c-torture/compile/930607-1.c b/gcc/testsuite/gcc.c-torture/compile/930607-1.c
index 97c94b2..360bbbc 100644
--- a/gcc/testsuite/gcc.c-torture/compile/930607-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/930607-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
typedef void f ();
typedef f *pf;
long long i;
diff --git a/gcc/testsuite/gcc.c-torture/compile/991213-2.c b/gcc/testsuite/gcc.c-torture/compile/991213-2.c
index 98385d5..dfbedf7d 100644
--- a/gcc/testsuite/gcc.c-torture/compile/991213-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/991213-2.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
typedef long __kernel_time_t;
typedef __kernel_time_t time_t;
time2(
diff --git a/gcc/testsuite/gcc.c-torture/compile/callind.c b/gcc/testsuite/gcc.c-torture/compile/callind.c
index 5938d1b..893f4e7 100644
--- a/gcc/testsuite/gcc.c-torture/compile/callind.c
+++ b/gcc/testsuite/gcc.c-torture/compile/callind.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
bar (foo, a)
int (**foo) ();
{
diff --git a/gcc/testsuite/gcc.c-torture/compile/calls-void.c b/gcc/testsuite/gcc.c-torture/compile/calls-void.c
index eeed4fd..7e6f56c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/calls-void.c
+++ b/gcc/testsuite/gcc.c-torture/compile/calls-void.c
@@ -1,5 +1,6 @@
/* { dg-require-effective-target ptr32plus } */
/* { dg-require-effective-target untyped_assembly } */
+/* { dg-require-effective-target indirect_calls } */
typedef void (*T)(void);
f1 ()
diff --git a/gcc/testsuite/gcc.c-torture/compile/calls.c b/gcc/testsuite/gcc.c-torture/compile/calls.c
index ca07122a..48a3b7c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/calls.c
+++ b/gcc/testsuite/gcc.c-torture/compile/calls.c
@@ -1,5 +1,6 @@
/* { dg-require-effective-target ptr32plus } */
/* { dg-require-effective-target untyped_assembly } */
+/* { dg-require-effective-target indirect_calls } */
typedef void *(*T)(void);
f1 ()
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr21840.c b/gcc/testsuite/gcc.c-torture/compile/pr21840.c
index bec3d6b..f6f2a5d 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr21840.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr21840.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
void fn_show_state(void);
typedef void (*fn_handler_fn)(void);
static fn_handler_fn fn_handler[1];
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr32139.c b/gcc/testsuite/gcc.c-torture/compile/pr32139.c
index 7b8522f..3cc541c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr32139.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr32139.c
@@ -1,4 +1,6 @@
/* PR tree-optimization/32139 */
+/* { dg-require-effective-target indirect_calls } */
+
int foo (void);
int bar (void) __attribute__ ((const));
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr35607.c b/gcc/testsuite/gcc.c-torture/compile/pr35607.c
index 7f5aa7a..9debd46 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr35607.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr35607.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
extern void (*__fini_array_start []) (void);
extern void (*__fini_array_end []) (void);
void
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37433-1.c b/gcc/testsuite/gcc.c-torture/compile/pr37433-1.c
index 322c167..48a57b6 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr37433-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr37433-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
void regex_subst(void)
{
const void *subst = "";
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37433.c b/gcc/testsuite/gcc.c-torture/compile/pr37433.c
index 0ba1179..95d168a 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr37433.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr37433.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
int regex_subst(void)
{
const void *subst = "";
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39941.c b/gcc/testsuite/gcc.c-torture/compile/pr39941.c
index b620908..5cb3b05 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr39941.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr39941.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
typedef void (*entry_func) (void) __attribute__ ((noreturn));
extern entry_func entry_addr;
static void bsd_boot_entry (void)
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr40080.c b/gcc/testsuite/gcc.c-torture/compile/pr40080.c
index e36f142..37c5a91 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr40080.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr40080.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
extern void *ff(void*,int);
struct lpgl { struct lpgl *next; };
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr43635.c b/gcc/testsuite/gcc.c-torture/compile/pr43635.c
index df826b6..3875f4e 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr43635.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr43635.c
@@ -1,4 +1,6 @@
/* { dg-require-effective-target untyped_assembly } */
+/* { dg-require-effective-target indirect_calls } */
+
extern void d (void);
void (*foo (void)) (float)
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr43791.c b/gcc/testsuite/gcc.c-torture/compile/pr43791.c
index 2b1d06f..710bf7e 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr43791.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr43791.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
int owner();
int clear();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr43845.c b/gcc/testsuite/gcc.c-torture/compile/pr43845.c
index bdb45e7..83442de 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr43845.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr43845.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
typedef int __attribute__ ((const)) (*x264_pixel_cmp_t)(void);
typedef struct {
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44043.c b/gcc/testsuite/gcc.c-torture/compile/pr44043.c
index 943501b..bd51089 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr44043.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr44043.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
typedef unsigned char __u8;
typedef unsigned short __u16;
typedef unsigned int __u32;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr51694.c b/gcc/testsuite/gcc.c-torture/compile/pr51694.c
index f5c1a40..c06bc21 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr51694.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr51694.c
@@ -1,4 +1,6 @@
/* { dg-require-effective-target untyped_assembly } */
+/* { dg-require-effective-target indirect_calls } */
+
void
foo (x, fn)
void (*fn) ();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr77754-2.c b/gcc/testsuite/gcc.c-torture/compile/pr77754-2.c
index d088961..d649d71 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr77754-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr77754-2.c
@@ -1,4 +1,5 @@
// { dg-require-effective-target alloca }
+// { dg-require-effective-target indirect_calls }
/* PR c/77754 */
int fn3();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr77754-3.c b/gcc/testsuite/gcc.c-torture/compile/pr77754-3.c
index fb25e23..51d7ca7 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr77754-3.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr77754-3.c
@@ -1,4 +1,5 @@
// { dg-require-effective-target alloca }
+// { dg-require-effective-target indirect_calls }
/* PR c/77754 */
int fn3();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr77754-4.c b/gcc/testsuite/gcc.c-torture/compile/pr77754-4.c
index 1c5c461..53216bb 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr77754-4.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr77754-4.c
@@ -1,4 +1,5 @@
// { dg-require-effective-target alloca }
+// { dg-require-effective-target indirect_calls }
/* PR c/77754 */
int fn3();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr89663-2.c b/gcc/testsuite/gcc.c-torture/compile/pr89663-2.c
index 052fe69..efac682 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr89663-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr89663-2.c
@@ -1,4 +1,5 @@
/* PR middle-end/89663 */
+/* { dg-require-effective-target indirect_calls } */
int irint (double);
long lrint (double);
diff --git a/gcc/testsuite/gcc.c-torture/compile/pta-1.c b/gcc/testsuite/gcc.c-torture/compile/pta-1.c
index 515e5ff..07dad8a 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pta-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pta-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
typedef struct JSObject JSObject;
typedef struct JSObjectMap *(*JSNewObjectMapOp) (JSObject *obj);
typedef JSObject *(*JSGetMethodOp) (JSObject *obj);
diff --git a/gcc/testsuite/gcc.c-torture/compile/stack-check-1.c b/gcc/testsuite/gcc.c-torture/compile/stack-check-1.c
index 2a03f7c..c06f5a1 100644
--- a/gcc/testsuite/gcc.c-torture/compile/stack-check-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/stack-check-1.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target indirect_calls } */
/* { dg-require-effective-target untyped_assembly } */
/* { dg-require-stack-check "" } */
/* { dg-additional-options "-fstack-check" } */
diff --git a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-18.c b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-18.c
index b4aa167..7888cb1 100644
--- a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-18.c
+++ b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-18.c
@@ -4,6 +4,7 @@
with zero or excessive size trigger either -Walloc-zero or
-Walloc-size-larger-than warnings.
{ dg-do compile }
+ { dg-require-effective-target indirect_calls }
{ dg-options "-O2 -Wall -Walloc-zero -ftrack-macro-expansion=0" } */
#define ATTR(...) __attribute__ ((__VA_ARGS__))
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index e32d424..4d03cc0 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -9502,3 +9502,11 @@ proc check_effective_target_mfentry { } {
void foo (void) { }
} "-mfentry"]
}
+
+# Return 1 if this target supports indirect calls
+proc check_effective_target_indirect_calls { } {
+ if { [istarget bpf-*-*] } {
+ return 0
+ }
+ return 1
+}