diff --git a/gcc/testsuite/gcc.target/riscv/cmo-32.c b/gcc/testsuite/gcc.target/riscv/cmo-32.c
index 8e733cc05fc12f8b914a2cb7055c8b0717c62542..071586beacc31f9ec53c48ae7c37704cdbf955b9 100644
--- a/gcc/testsuite/gcc.target/riscv/cmo-32.c
+++ b/gcc/testsuite/gcc.target/riscv/cmo-32.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target rv32} */
-/* { dg-options "-march=rv32gc_zicbom_zicbop_zicboz -mabi=ilp32" } */
+/* { dg-options "-march=rv32gc_zicbom_zicbop_zicboz -mabi=ilp32 -std=gnu17" } */
 
 #include "riscv_cmo.h"
 
diff --git a/gcc/testsuite/gcc.target/riscv/cmo-64.c b/gcc/testsuite/gcc.target/riscv/cmo-64.c
index e83eddbeb6f7cd3a3e1ec426fea825673004caba..dc9fc97b94bb9d55f764b11b9ff7d893890833df 100644
--- a/gcc/testsuite/gcc.target/riscv/cmo-64.c
+++ b/gcc/testsuite/gcc.target/riscv/cmo-64.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target rv64 } */
-/* { dg-options "-march=rv64gc_zicbom_zicbop_zicboz -mabi=lp64d" } */
+/* { dg-options "-march=rv64gc_zicbom_zicbop_zicboz -mabi=lp64d -std=gnu17" } */
 
 #include "riscv_cmo.h"
 
diff --git a/gcc/testsuite/gcc.target/riscv/pr98777.c b/gcc/testsuite/gcc.target/riscv/pr98777.c
index 0be734b30caf8b9b4f69dcd4e3922e692b2ddbb2..9eab01b8e2e2ac3efe463d7ccad538ae4eb3cb6e 100644
--- a/gcc/testsuite/gcc.target/riscv/pr98777.c
+++ b/gcc/testsuite/gcc.target/riscv/pr98777.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fstrict-aliasing" } */
+/* { dg-options "-fstrict-aliasing -std=gnu17" } */
 /* { dg-skip-if "" { *-*-* } { "-O0" } } */
 
 typedef struct {
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr111391-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr111391-1.c
index a7f64c937c62c7b888011406e191baa64a662101..162d185d406123e4c71d8c321cd21077db9471e3 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr111391-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr111391-1.c
@@ -1,11 +1,11 @@
 /* { dg-do compile } */
 /* { dg-options "-march=rv64gcv -mabi=lp64d -Wno-int-conversion -Wno-implicit-function -Wno-incompatible-pointer-types -Wno-implicit-function-declaration -Ofast -ftree-vectorize" } */
 
-int d ();
 typedef struct
 {
   int b;
 } c;
+int d (c *);
 int
 e (char *f, long g)
 {
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113469.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113469.c
index f86084bdb40f2d00d18c2b4151129d6f47154b90..52e2580c53e67cc49002eae0fffb5fe67cf1e794 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113469.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113469.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-vect-cost-model" } */
+/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -fno-vect-cost-model -std=gnu17" } */
 
 struct a {
  int b;
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr115214.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr115214.c
index fce2e9da7661b4c318c648822fb2960d5a7c54fe..b76760b028148b03291645f5c923fdf9eed08acb 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr115214.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr115214.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-mrvv-vector-bits=scalable -march=rv64gcv -mabi=lp64d -O3 -w" } */
+/* { dg-options "-mrvv-vector-bits=scalable -march=rv64gcv -mabi=lp64d -O3 -w -std=gnu17" } */
 /* { dg-skip-if "" { *-*-* } { "-flto" } } */
 
 #include <riscv_vector.h>
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-1.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-1.c
index 96bea3a7dc22482dd416f8b9b88e058cbd82bc56..87bfd8f8e723306fbf89d3fa04c7dcf36cfb34e5 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-1.c
@@ -13,9 +13,7 @@ int yabba = 1;
 
 
 int
-f (a, b)
-     unsigned char a;
-     unsigned long b;
+f (unsigned char a, unsigned long b)
 {
   long i, j, p, q, r, s;
 
diff --git a/gcc/testsuite/gcc.target/riscv/sum-of-two-s12-const-2.c b/gcc/testsuite/gcc.target/riscv/sum-of-two-s12-const-2.c
index 9343b43c3106db322cfe9f377c207b0025a94e6c..9febc6903effba104e388008e2c97f1414c30829 100644
--- a/gcc/testsuite/gcc.target/riscv/sum-of-two-s12-const-2.c
+++ b/gcc/testsuite/gcc.target/riscv/sum-of-two-s12-const-2.c
@@ -6,7 +6,7 @@
 /* { dg-options { -march=rv64gcv -mabi=lp64d -O2 } } */
 /* { dg-skip-if "" { *-*-* } { "-O0" "O1" "-Og" "-Os" "-Oz" } } */
 
-int a() {
+int a(char x[]) {
   char b[4096];
   if (a(b))
     a(b);
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-01.c b/gcc/testsuite/gcc.target/riscv/target-attr-01.c
index 9830ab2f1b6898319fc7a5277fa3719831df0fa2..71331203fafdb544a9538ffe4f95d36e6714d5b4 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-01.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-01.c
@@ -10,7 +10,7 @@
 **   ...
 */
 /* { dg-final { scan-assembler ".option arch, rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0_zba1p0" } } */
-long foo () __attribute__((target("arch=rv64gc_zba")));
+long foo (long a, long b) __attribute__((target("arch=rv64gc_zba")));
 long foo (long a, long b)
 {
   return a + (b * 2);
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-02.c b/gcc/testsuite/gcc.target/riscv/target-attr-02.c
index 3338ae4694227e51fa8f3eae2c03b7753e09dccd..d2ad912ffa4dc17e7421c887904113d23a593975 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-02.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-02.c
@@ -10,7 +10,7 @@
 **   ...
 */
 /* { dg-final { scan-assembler ".option arch, rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0_zba1p0" } } */
-long foo () __attribute__((target("arch=+zba")));
+long foo (long a, long b) __attribute__((target("arch=+zba")));
 long foo (long a, long b)
 {
   return a + (b * 2);
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-03.c b/gcc/testsuite/gcc.target/riscv/target-attr-03.c
index 673c06701062627ef60bbca9f84cc45cfcebd718..3199a8838764568c1bd61f387d16e21a76d01368 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-03.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-03.c
@@ -11,7 +11,7 @@
 **   ...
 */
 /* { dg-final { scan-assembler ".option arch, rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0" } } */
-long foo () __attribute__((target("arch=rv64gc")));
+long foo (long a, long b) __attribute__((target("arch=rv64gc")));
 long foo (long a, long b)
 {
   return a + (b * 2);
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-04.c b/gcc/testsuite/gcc.target/riscv/target-attr-04.c
index 58c1698fac30fd9974b2496b48b14c3dd91bc7f7..19188594df9e8cd0310f1387ab8e98e40b555b2b 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-04.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-04.c
@@ -13,7 +13,7 @@
 **   ...
 */
 /* { dg-final { scan-assembler ".option arch, rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zmmul1p0_zaamo1p0_zalrsc1p0" } } */
-long foo () __attribute__((target("cpu=sifive-u74")));
+long foo (long a, long b) __attribute__((target("cpu=sifive-u74")));
 long foo (long a, long b)
 {
   return a + (b * 2);
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-05.c b/gcc/testsuite/gcc.target/riscv/target-attr-05.c
index 1474f319e414d2bf753bec5b03d687913bb590eb..3e8d7f06daec2397603ca5283c63f9ee2a4591dd 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-05.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-05.c
@@ -11,7 +11,7 @@
 **   sh1add\s*a0,a1,a0
 **   ...
 */
-long foo () __attribute__((target("cpu=sifive-u74;arch=rv64gc_zba")));
+long foo (long a, long b) __attribute__((target("cpu=sifive-u74;arch=rv64gc_zba")));
 long foo (long a, long b)
 {
   return a + (b * 2);
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-06.c b/gcc/testsuite/gcc.target/riscv/target-attr-06.c
index 32ecfaee319ac4cf085edf7b8ffb1d5682fbcff7..033bb0cddfd428a79caaf6991129efd38230edf9 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-06.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-06.c
@@ -11,7 +11,7 @@
 **   sh1add\s*a0,a1,a0
 **   ...
 */
-long foo ()
+long foo (long a, long b)
 __attribute__((target("cpu=sifive-u74;tune=sifive-5-series;arch=rv64gc_zba")));
 long foo (long a, long b)
 {
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-07.c b/gcc/testsuite/gcc.target/riscv/target-attr-07.c
index f3066f4fcfea20e4dd2e0906722396c4296de1d3..62ea4a0951932b36a8debad65d503b26f09b8798 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-07.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-07.c
@@ -9,7 +9,7 @@
 **   # tune = sifive-5-series
 **   ...
 */
-long foo () __attribute__((target("tune=sifive-5-series")));
+long foo (long a, long b) __attribute__((target("tune=sifive-5-series")));
 long foo (long a, long b)
 {
   return a + (b * 2);
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-08.c b/gcc/testsuite/gcc.target/riscv/target-attr-08.c
index 3cab5ff803c031d5c6f8a8d5b2372170016a02cd..3df4a7adb4ca9348918c3f4bf1ba114ded9587bf 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-08.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-08.c
@@ -3,7 +3,7 @@
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
-long foo ()
+long foo (long a, long b)
 __attribute__((target("arch=rv64gc_zbb")))
 __attribute__((target("arch=rv64gc_zba")));
 
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-09.c b/gcc/testsuite/gcc.target/riscv/target-attr-09.c
index ec43ce95998b8ba40420d1ac6726d86825b4cb3c..a47ea3cbeff9c9d74105abde2273b4f548e16ad7 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-09.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-09.c
@@ -3,7 +3,7 @@
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
-long foo ()
+long foo (long a, long b)
 __attribute__((target("cpu=sifive-e20")))
 __attribute__((target("cpu=sifive-u74")));
 
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-10.c b/gcc/testsuite/gcc.target/riscv/target-attr-10.c
index 86a79c7d6ccfd0c9b127782534e4de3fca50e5bd..2e0e30e6ef70743d8a5cc34b43087601e7a2422a 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-10.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-10.c
@@ -3,7 +3,7 @@
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
-long foo ()
+long foo (long a, long b)
 __attribute__((target("tune=rocket")))
 __attribute__((target("tune=sifive-u74")));
 
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-11.c b/gcc/testsuite/gcc.target/riscv/target-attr-11.c
index 0a215b4ae9c39223d2b28e4ac665132f052c2d25..89ec22f392d9181aa3e7eecb128741ad85d6acb5 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-11.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-11.c
@@ -3,10 +3,10 @@
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
-long foo ()
+long foo (long a, long b)
 __attribute__((target("arch=rv64gc_zbb")));
 
-long foo ()
+long foo (long a, long b)
 __attribute__((target("arch=rv64gc_zba")));
 
 /*
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-12.c b/gcc/testsuite/gcc.target/riscv/target-attr-12.c
index e0f8eafa040a12e033c9def155c2e05fea4e9412..d241db20d22ff2d2ad71a75ffbe57eb857775f67 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-12.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-12.c
@@ -3,10 +3,10 @@
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
-long foo ()
+long foo (long a, long b)
 __attribute__((target("cpu=sifive-e20")));
 
-long foo ()
+long foo (long a, long b)
 __attribute__((target("cpu=sifive-u74")));
 
 /*
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-13.c b/gcc/testsuite/gcc.target/riscv/target-attr-13.c
index 0a26111956b9dacd4f0d417177c4d96bf5bfbe32..90a35eddb8f3b9335da14e62967ae9af57b5daf6 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-13.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-13.c
@@ -3,10 +3,10 @@
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
-long foo ()
+long foo (long a, long b)
 __attribute__((target("tune=rocket")));
 
-long foo ()
+long foo (long a, long b)
 __attribute__((target("tune=sifive-u74")));
 
 /*
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-14.c b/gcc/testsuite/gcc.target/riscv/target-attr-14.c
index 4e615dbb323177b592e80948506c50f4b0cbacaf..a8a90d4d917eefb4e70c780a84f936c83ac046c3 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-14.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-14.c
@@ -10,7 +10,7 @@
 **   ...
 */
 /* { dg-final { scan-assembler ".option arch, rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0_zba1p0" } } */
-long foo () __attribute__((target("arch=rv64gc_zba")));
+long foo (long a, long b) __attribute__((target("arch=rv64gc_zba")));
 long foo (long a, long b)
 {
   return a + (b * 2);
@@ -35,7 +35,7 @@ long bar (long a, long b)
 **   ...
 */
 /* { dg-final { scan-assembler ".option arch, rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0_xtheadba1p0" } } */
-long foo_th () __attribute__((target("arch=rv64gc_xtheadba")));
+long foo_th (long, long) __attribute__((target("arch=rv64gc_xtheadba")));
 long foo_th (long a, long b)
 {
   return a + (b * 2);
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-15.c b/gcc/testsuite/gcc.target/riscv/target-attr-15.c
index bccb81aaad94e3c2e364032b8a02c90028f12ffc..34afe51bc579a4b200c4e827330c191ee9469771 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-15.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-15.c
@@ -10,7 +10,7 @@
 **   ...
 */
 /* { dg-final { scan-assembler ".option arch, rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0_zba1p0" } } */
-long foo () __attribute__((target("arch=rv64gc_zba")));
+long foo (long a, long b) __attribute__((target("arch=rv64gc_zba")));
 long foo (long a, long b)
 {
   return a + (b * 2);
@@ -35,7 +35,7 @@ long bar (long a, long b)
 **   ...
 */
 /* { dg-final { scan-assembler ".option arch, rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0_xtheadba1p0" } } */
-long foo_th () __attribute__((target("arch=+xtheadba")));
+long foo_th (long, long) __attribute__((target("arch=+xtheadba")));
 long foo_th (long a, long b)
 {
   return a + (b * 2);
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-bad-01.c b/gcc/testsuite/gcc.target/riscv/target-attr-bad-01.c
index 91cbcaac21d445d1839e36ba8eb621a3120276bf..747ca1209a9e409bb796a5e43c88206b485e440e 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-bad-01.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-bad-01.c
@@ -3,7 +3,7 @@
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 
 
-long foo() __attribute__((target("arch=rv64gc_zba;;"))); /* { dg-error "malformed" } */
+long foo(long a, long b) __attribute__((target("arch=rv64gc_zba;;"))); /* { dg-error "malformed" } */
 long foo(long a, long b){
   return a + (b * 2);
 }
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-bad-02.c b/gcc/testsuite/gcc.target/riscv/target-attr-bad-02.c
index 0c838bb3ca7e5ef24c9e63298cb99de70dea9c04..3b2b1bb4a28b3c7d0dcb63a1496449ea301ef596 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-bad-02.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-bad-02.c
@@ -3,7 +3,7 @@
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 
 
-long foo() __attribute__((target("cpu=xyz-cpu"))); /* { dg-error "unknown CPU" } */
+long foo(long a, long b) __attribute__((target("cpu=xyz-cpu"))); /* { dg-error "unknown CPU" } */
 long foo(long a, long b){
   return a + (b * 2);
 }
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-bad-03.c b/gcc/testsuite/gcc.target/riscv/target-attr-bad-03.c
index 09702d1690a181c5ea8b4674febefb74413313d3..70e005510497ccb3de60a113f1410404906919cc 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-bad-03.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-bad-03.c
@@ -3,7 +3,7 @@
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 
 
-long foo() __attribute__((target("tune=xyz-cpu"))); /* { dg-error "unknown TUNE" } */
+long foo(long a, long b) __attribute__((target("tune=xyz-cpu"))); /* { dg-error "unknown TUNE" } */
 long foo(long a, long b){
   return a + (b * 2);
 }
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-bad-04.c b/gcc/testsuite/gcc.target/riscv/target-attr-bad-04.c
index 1d9a0ffdd888a1b366e9d662ccb9cff9005f1429..8aaf0f5b217cb2c0266e77d5c4b70a1c589388bb 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-bad-04.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-bad-04.c
@@ -3,7 +3,7 @@
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 
 
-long foo() __attribute__((target(123))); /* { dg-error "argument not a string" } */
+long foo(long a, long b) __attribute__((target(123))); /* { dg-error "argument not a string" } */
 long foo(long a, long b){
   return a + (b * 2);
 }
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-bad-05.c b/gcc/testsuite/gcc.target/riscv/target-attr-bad-05.c
index 24a81c5279b84351def4a30dd07b11f2b8c89fb0..0b575a96fed2d5524a620987eb34e8cf2e122750 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-bad-05.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-bad-05.c
@@ -3,7 +3,7 @@
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 
 
-long foo() __attribute__((target(""))); /* { dg-warning "empty string in attribute .target." } */
+long foo(long a, long b) __attribute__((target(""))); /* { dg-warning "empty string in attribute .target." } */
 long foo(long a, long b){
   return a + (b * 2);
 }
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-bad-06.c b/gcc/testsuite/gcc.target/riscv/target-attr-bad-06.c
index a0d65859d40456c2fd26c6fdd68e717d8beae366..fba34e09003e1dca73d2afbb180c0cab529f7553 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-bad-06.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-bad-06.c
@@ -3,7 +3,7 @@
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 
 
-long foo() __attribute__((target("arch=*x"))); /* { dg-error "must start with \\+ or rv" } */
+long foo(long a, long b) __attribute__((target("arch=*x"))); /* { dg-error "must start with \\+ or rv" } */
 long foo(long a, long b){
   return a + (b * 2);
 }
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-bad-07.c b/gcc/testsuite/gcc.target/riscv/target-attr-bad-07.c
index 8aa82504dc1c2a9fbee87cce2f64e8b8ea3c0d43..eebac4bd7b7adbe584e2fd00b26fdcf16e9e0489 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-bad-07.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-bad-07.c
@@ -3,7 +3,7 @@
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 
 
-long foo() __attribute__((target("arch=+zbb_zba"))); /* { dg-error "extension 'zbb_zba' starts with 'z' but is unsupported standard extension" } */
+long foo(long a, long b) __attribute__((target("arch=+zbb_zba"))); /* { dg-error "extension 'zbb_zba' starts with 'z' but is unsupported standard extension" } */
 long foo(long a, long b){
   return a + (b * 2);
 }
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-bad-08.c b/gcc/testsuite/gcc.target/riscv/target-attr-bad-08.c
index 68d211de8877686f8afa559bf0d8412c65c6ab41..aa1d900815bb0a4ba0b06d34397764756c50b02d 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-bad-08.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-bad-08.c
@@ -2,7 +2,7 @@
 /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } } */
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 
-long foo() __attribute__((target("arch=rv64gc_zba;arch=rv64gc_zba"))); /* { dg-error "arch appears more than once" } */
+long foo(long a, long b) __attribute__((target("arch=rv64gc_zba;arch=rv64gc_zba"))); /* { dg-error "arch appears more than once" } */
 long foo(long a, long b){
   return a + (b * 2);
 }
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-bad-09.c b/gcc/testsuite/gcc.target/riscv/target-attr-bad-09.c
index 2b6e498289453790ee880908256e3cb045f4086e..e6d5659ca9b0ed121a9a008ea365cd667680871c 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-bad-09.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-bad-09.c
@@ -2,7 +2,7 @@
 /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } } */
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 
-long foo() __attribute__((target("cpu=sifive-u74;cpu=sifive-u74"))); /* { dg-error "cpu appears more than once" } */
+long foo(long a, long b) __attribute__((target("cpu=sifive-u74;cpu=sifive-u74"))); /* { dg-error "cpu appears more than once" } */
 long foo(long a, long b){
   return a + (b * 2);
 }
diff --git a/gcc/testsuite/gcc.target/riscv/target-attr-bad-10.c b/gcc/testsuite/gcc.target/riscv/target-attr-bad-10.c
index 00cefa03e4145c2f6d7ba050066f47053edcb199..5d85a1aa58be289f159a819240a5256c0001b414 100644
--- a/gcc/testsuite/gcc.target/riscv/target-attr-bad-10.c
+++ b/gcc/testsuite/gcc.target/riscv/target-attr-bad-10.c
@@ -2,7 +2,7 @@
 /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } } */
 /* { dg-options "-march=rv64gc -O2 -mabi=lp64" } */
 
-long foo() __attribute__((target("tune=sifive-u74;tune=sifive-u74"))); /* { dg-error "tune appears more than once" } */
+long foo(long a, long b) __attribute__((target("tune=sifive-u74;tune=sifive-u74"))); /* { dg-error "tune appears more than once" } */
 long foo(long a, long b){
   return a + (b * 2);
 }