testsuite: new require effective target indirect_calls
authorJose E. Marchesi <jose.marchesi@oracle.com>
Mon, 9 Sep 2019 09:55:10 +0000 (11:55 +0200)
committerJose E. Marchesi <jemarch@gcc.gnu.org>
Mon, 9 Sep 2019 09:55:10 +0000 (11:55 +0200)
This patch adds a new dg_require_effective_target procedure to the
testsuite infrastructure: indirect_calls.  This new function tells
whether a target supports calls to non-constant call targets.

This patch also annotates the tests in the gcc.c-torture testuite that
require support for indirect calls.

    gcc/ChangeLog:

            * doc/sourcebuild.texi (Effective-Target Keywords): Document
            indirect_calls.

    gcc/testsuite/ChangeLog:

            * 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.

From-SVN: r275505

53 files changed:
gcc/ChangeLog
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20010102-1.c
gcc/testsuite/gcc.c-torture/compile/20010107-1.c
gcc/testsuite/gcc.c-torture/compile/20011109-1.c
gcc/testsuite/gcc.c-torture/compile/20011218-1.c
gcc/testsuite/gcc.c-torture/compile/20011229-1.c
gcc/testsuite/gcc.c-torture/compile/20020129-1.c
gcc/testsuite/gcc.c-torture/compile/20020320-1.c
gcc/testsuite/gcc.c-torture/compile/20020706-1.c
gcc/testsuite/gcc.c-torture/compile/20020706-2.c
gcc/testsuite/gcc.c-torture/compile/20021205-1.c
gcc/testsuite/gcc.c-torture/compile/20030921-1.c
gcc/testsuite/gcc.c-torture/compile/20031023-1.c
gcc/testsuite/gcc.c-torture/compile/20031023-2.c
gcc/testsuite/gcc.c-torture/compile/20031023-3.c
gcc/testsuite/gcc.c-torture/compile/20031023-4.c
gcc/testsuite/gcc.c-torture/compile/20040614-1.c
gcc/testsuite/gcc.c-torture/compile/20040909-1.c
gcc/testsuite/gcc.c-torture/compile/20050122-1.c
gcc/testsuite/gcc.c-torture/compile/20050202-1.c
gcc/testsuite/gcc.c-torture/compile/20060208-1.c
gcc/testsuite/gcc.c-torture/compile/20081108-1.c
gcc/testsuite/gcc.c-torture/compile/20150327.c
gcc/testsuite/gcc.c-torture/compile/920428-2.c
gcc/testsuite/gcc.c-torture/compile/920928-5.c
gcc/testsuite/gcc.c-torture/compile/930117-1.c
gcc/testsuite/gcc.c-torture/compile/930607-1.c
gcc/testsuite/gcc.c-torture/compile/991213-2.c
gcc/testsuite/gcc.c-torture/compile/callind.c
gcc/testsuite/gcc.c-torture/compile/calls-void.c
gcc/testsuite/gcc.c-torture/compile/calls.c
gcc/testsuite/gcc.c-torture/compile/pr21840.c
gcc/testsuite/gcc.c-torture/compile/pr32139.c
gcc/testsuite/gcc.c-torture/compile/pr35607.c
gcc/testsuite/gcc.c-torture/compile/pr37433-1.c
gcc/testsuite/gcc.c-torture/compile/pr37433.c
gcc/testsuite/gcc.c-torture/compile/pr39941.c
gcc/testsuite/gcc.c-torture/compile/pr40080.c
gcc/testsuite/gcc.c-torture/compile/pr43635.c
gcc/testsuite/gcc.c-torture/compile/pr43791.c
gcc/testsuite/gcc.c-torture/compile/pr43845.c
gcc/testsuite/gcc.c-torture/compile/pr44043.c
gcc/testsuite/gcc.c-torture/compile/pr51694.c
gcc/testsuite/gcc.c-torture/compile/pr77754-2.c
gcc/testsuite/gcc.c-torture/compile/pr77754-3.c
gcc/testsuite/gcc.c-torture/compile/pr77754-4.c
gcc/testsuite/gcc.c-torture/compile/pr89663-2.c
gcc/testsuite/gcc.c-torture/compile/pta-1.c
gcc/testsuite/gcc.c-torture/compile/stack-check-1.c
gcc/testsuite/gcc.dg/Walloc-size-larger-than-18.c
gcc/testsuite/lib/target-supports.exp

index a8c3a2a2aab4a44bc0442941310e46873b7e3d79..cb28809b556444c323b7bf4148aa0df444afa4df 100644 (file)
@@ -1,3 +1,8 @@
+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
index d713c08f762598b377b78f0f9f902db07d51c289..e4180ccaabb706b16410ce84b49f09c1720756b9 100644 (file)
@@ -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}
index 0a8c405e8aac313bbea7e2ca8568254610a78350..9533da6e8190699e3ed15bd2665fa0c7e4726996 100644 (file)
@@ -1,3 +1,58 @@
+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
index a409b566098f51c72bb9d3f1c11e7f03b262a922..3d9cc9edf72a7b011c2ee5d253cb5b67cfd407d3 100644 (file)
@@ -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
index 222def4d9efaa7a1f6413bafe6b3d455a301c7dc..22461a0521fdbc7f799cd4c810d58eb02ac0b594 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 unsigned long x[4];
 
 void foo(void)
index f1987a74bf2819c1df8c4ac77a3e496a51913f46..1deba2a52df3deedbc9893144403f11e73c737b8 100644 (file)
@@ -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;
 
index bf63489b855854b8f3de509903572c007bc66ed1..8db5b777089dc143cce32a525dbc6f95d2b79af2 100644 (file)
@@ -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);
index 97b2655434adbc0b6fe848a6f496279458736020..99aeab7d7cd25a27fe75ec6713848d17be5a85a5 100644 (file)
@@ -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 *);
index 7b17ba475e488a1876a13edf400495c65784ed74..c14ac07655ed02738429bf75029db33c30a30f24 100644 (file)
@@ -1,5 +1,7 @@
 /* Test call to static variable.  */
 
+/* { dg-require-effective-target indirect_calls } */
+
 typedef struct
 {
   long long a[10];
index 385c061e19321bdb2c096cb153ffe06a3b6e1271..5b7a17a308064998e10c5c3aae0da9018ae523c4 100644 (file)
@@ -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[];
 
index c8811bc68ff8772c0d1bf80b5d7064c848774a7e..9bbfc8a66dd8b3fa376845db0d6cc9c66a854777 100644 (file)
@@ -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;
index b84dda60fd31200e915e82ffdf3fa2d2e24b1b6a..2391f2085e802d0047f71a64f690762bd12b01ee 100644 (file)
@@ -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)
index 73648e94951512caa851544859bef13f31d0aa9a..27f458751086a87e3f80551967c5f3a2363a7776 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 typedef struct x x;
 extern void *baz(char *);
 struct x { char * (*bar) (int); };
index 8199dc657f24a140bee6631c3d40482f3ee8abe5..4bb3f4645af15c225a1c20fe15d71e69663f5dfe 100644 (file)
@@ -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();}
index be837762e665e13650cc4a902798bb54d1dd2a6f..1ee1ff7aaa68560dd2c3366cc4cb77e98dd48da6 100644 (file)
@@ -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
index 66d66458c85c999085cf41da17b45f1391ba41fb..50965169adcaec9abea115fb567962a8a920b3b7 100644 (file)
@@ -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"
index 5859634c34332e21b2717d2368356d68e2a710a7..1bb692f45a984c1cadaf8adb24a2a915d586b9f9 100644 (file)
@@ -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"
index 5c61f3743d4f994aabd7c93901fc5b839aa352ee..85c4dca9cb507e758454aa99d97e105a1f628c62 100644 (file)
@@ -1,2 +1,4 @@
+/* { dg-require-effective-target indirect_calls } */
+
 #define ASIZE 0x80000000UL
 #include "20031023-1.c"
index b692ab569f277b7c1a9e0b72e949fec771886778..c889bb251c8bc9cac2aaad25b05e4b8f7cd8cbde 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target label_values } */
+/* { dg-require-effective-target indirect_calls } */
 
 void f(int r1, int *fp) 
 {     
index 8bbf90191b4224d85b66e437303ac703901ce311..0f66cb261db1e7b62db7118f89f6ea0e1bdc8dc8 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 static __inline__ int
 one_utf8_to_utf16 () { }
 
index a70907d905146adf2d333d7d7127ba2fd6f89318..7bb7cee5a3251951ca6ba7425eb4559926df4973 100644 (file)
@@ -1,4 +1,6 @@
 /* From PR 19484.  */
+/* { dg-require-effective-target indirect_calls } */
+
 extern void foo (void) __attribute__((noreturn));
 int n;
 
index b3f81764538336c8cb291e6f93589fe42d753ecc..58ed54eceb3260f9760446fffddbf7feb338e4c8 100644 (file)
@@ -1,4 +1,6 @@
 /* From PR 19578.  */
+/* { dg-require-effective-target indirect_calls } */
+
 extern void foo (void) __attribute__((noreturn));
 
 void
index 3881474f7228b9235108ed3ddcef46d7a1ceb791..5025463d7efa04080de5094e30d07c6f0af03ef8 100644 (file)
@@ -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);
 
index 3209a90c83bc8683b89705df656221e3b43657b7..a1f54e8c5fe67e2daf8f7e24a4b5e4dca331451d 100644 (file)
@@ -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.  */
 
index 373ea6183c3c5b8ec918b2e3a82c80f18eb9bae8..125b722a6eba1bef0f859b47af7b460e66d29084 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 int a;
 int (*b)(), (*c)();
 int fn1(int p1) {
index f313b32986ba945f8fe59a5b3bb138aa8e55add2..817fff061e9b31df53c479c1391ef4a78460e036 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 double sin(double x);
 double cos(double x);
 double tan(double x);
index 8c975f0c05164f10592cd6dd1a84b6653c08d756..b9f9dcbaeb067fc51a0e55ead121a5f123825851 100644 (file)
@@ -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)())
 {
index 83317cdd07bcf3741a19c5f68bf43d708be6cd93..06466f5e58716b349951edcf05593e93ff07ff44 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 f(x)
 {
   (*(void (*)())&x)();
index 97c94b25ec3b2f0b579b46fd045d8aa661951610..360bbbc15083f25d9d4e3009740976eaf6f2465d 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 typedef void f ();
 typedef f *pf;
 long long i;
index 98385d562632ea5b37ccbc99831a629c80e6b0e0..dfbedf7d6741f9162f4d21aa8cbb9a20f73df070 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 typedef long           __kernel_time_t;
 typedef __kernel_time_t                time_t;
 time2(
index 5938d1b88fcfa59fbe2bb1772434584e6d41bd7c..893f4e764acbdf7c7f0ad63bbc5ae87a3ba6d526 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 bar (foo, a)
      int (**foo) ();
 {
index eeed4fdfdc1d125867335d2ba1b99de71c455ed8..7e6f56c16fb96fb4d15760cc458d1d84cee01fc9 100644 (file)
@@ -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 ()
index ca07122a786af7ee1575895ef7105dea80a06bd3..48a3b7c77a53ba3b2a0ddd1624992752a41cc6b6 100644 (file)
@@ -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 ()
index bec3d6bf5d7e2c23c79da897fdfe316504e9d25c..f6f2a5dc13339176e564fbcac255602ff2abaf0a 100644 (file)
@@ -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];
index 7b8522f5174950185bc50caaf564447f38950a65..3cc541cb328f6e64633aed348434cb9ab03a2486 100644 (file)
@@ -1,4 +1,6 @@
 /* PR tree-optimization/32139 */
+/* { dg-require-effective-target indirect_calls } */
+
 int foo (void);
 int bar (void) __attribute__ ((const));
 
index 7f5aa7a2b7c22aa3e2776bbc57e8bd6dd1420a51..9debd46df583bca9a734bffbfa0260ffe723e177 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 extern void (*__fini_array_start []) (void);
 extern void (*__fini_array_end []) (void);
 void
index 322c167d682688fba8aaae9b4fd21df8cc561291..48a57b637d7ef378278659fc0c0321abcc8659cc 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 void regex_subst(void)
 {
   const void *subst = "";
index 0ba1179886cd9d1dc358362183aec55ddb6a4bfa..95d168afa2f3c6350d05c0527e358411ac618b87 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 int regex_subst(void)
 {
   const void *subst = "";
index b6209086be920f86b4a9fce663dd23aa4316633e..5cb3b0554ee4b360ea19ea55c05d6874ae3f17d5 100644 (file)
@@ -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)
index e36f14273e87f7b6829d278ba337f7ce4dc93853..37c5a918ad4f1d18e8841c9483c1820690987236 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 extern void *ff(void*,int);
 
 struct lpgl { struct lpgl *next; };
index df826b6f4c0f12964e1500a8f0df10f46ca2fc4f..3875f4efcd46895ecfa95d007108db0bbfa57b4a 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-require-effective-target untyped_assembly } */
+/* { dg-require-effective-target indirect_calls } */
+
 extern void d (void);
 
 void (*foo (void)) (float)
index 2b1d06ff78912cd83749c2de8ff4fdfd133848a5..710bf7e9ec9d60068c9c883029b74c5319c308b6 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 int owner();
 int clear();
 
index bdb45e7d2a8b6db667001f2b24ee3d25fefc7fe0..83442decd1cdc76e6130e94188d147f2e282b3b1 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 typedef int __attribute__ ((const)) (*x264_pixel_cmp_t)(void);
 
 typedef struct {
index 943501b40915b9438995ca8ecda434bf79833deb..bd51089a70ae835149c50ebbd58d3b47ab954ec6 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target indirect_calls } */
+
 typedef unsigned char __u8;
 typedef unsigned short __u16;
 typedef unsigned int __u32;
index f5c1a40df861176eac40b03a6d0aff96a033f40d..c06bc2118aad54eb5fc2ee861c17b2638b4f0aee 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-require-effective-target untyped_assembly } */
+/* { dg-require-effective-target indirect_calls } */
+
 void
 foo (x, fn)
   void (*fn) ();
index d088961963de793520661704944e5119532587e7..d649d7197222a606191f5970e0b9592241d9ca20 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-require-effective-target alloca }
+// { dg-require-effective-target indirect_calls }
 /* PR c/77754 */
 
 int fn3();
index fb25e234fe23ee27e7affd7e2917db80c3e65399..51d7ca71966cb87562dccfc1f9a8db6210d454c4 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-require-effective-target alloca }
+// { dg-require-effective-target indirect_calls }
 /* PR c/77754 */
 
 int fn3();
index 1c5c4619a33f68d42ed002e13ec8a9ddc9b52b1f..53216bb6e7c22b068d0a4ce9df62b046b76c6194 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-require-effective-target alloca }
+// { dg-require-effective-target indirect_calls }
 /* PR c/77754 */
 
 int fn3();
index 052fe69f40ecd3a312e9bc089814da36225deb15..efac68233f63c07ec1884b7dda83c90ff75cb3bf 100644 (file)
@@ -1,4 +1,5 @@
 /* PR middle-end/89663 */
+/* { dg-require-effective-target indirect_calls } */
 
 int irint (double);
 long lrint (double);
index 515e5ff13f431eca2a05f828c1cbc690e2494b84..07dad8a16a78d4aeb7540148a3fbdce1e13d8fe9 100644 (file)
@@ -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);
index 2a03f7c29ae3ef605a16c09857626dae45fcb019..c06f5a19b0170645d3fcdd651545a9dcc3294d62 100644 (file)
@@ -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" } */
index b4aa167f655e46ac2ed6f1acc9f6d08dd9d56fef..7888cb1b1daccf847183847b6a0ea508cc21caad 100644 (file)
@@ -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__))
index e32d42491d96959ad04547263f2cc3631f4994d9..4d03cc0718bc6c9d3230d0af03bf538111b7c1de 100644 (file)
@@ -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
+}