diff mbox series

testsuite: ctf: make array in ctf-file-scope-1 fixed length

Message ID 20240301190122.162094-1-david.faust@oracle.com
State New
Headers show
Series testsuite: ctf: make array in ctf-file-scope-1 fixed length | expand

Commit Message

David Faust March 1, 2024, 7:01 p.m. UTC
The array member of struct SFOO in the ctf-file-scope-1 caused the test
to fail for the BPF target, since BPF does not support dynamic stack
allocation. The array does not need to variable length for the sake of
the test, so make it fixed length instead to allow the test to run
successfully for the bpf-unknown-none target.

Tested on x86_64-linux-gnu, and on x86_64-linux-gnu host for
bpf-unknown-none target.

gcc/testsuite/

	* gcc.dg/debug/ctf/ctf-file-scope-1.c (SFOO): Make array member
	fixed-length.
---
 gcc/testsuite/gcc.dg/debug/ctf/ctf-file-scope-1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Indu Bhagat March 1, 2024, 7:03 p.m. UTC | #1
On 3/1/24 11:01, David Faust wrote:
> The array member of struct SFOO in the ctf-file-scope-1 caused the test
> to fail for the BPF target, since BPF does not support dynamic stack
> allocation. The array does not need to variable length for the sake of
> the test, so make it fixed length instead to allow the test to run
> successfully for the bpf-unknown-none target.
> 
> Tested on x86_64-linux-gnu, and on x86_64-linux-gnu host for
> bpf-unknown-none target.
> 

LGTM.
Thanks!

> gcc/testsuite/
> 
> 	* gcc.dg/debug/ctf/ctf-file-scope-1.c (SFOO): Make array member
> 	fixed-length.
> ---
>   gcc/testsuite/gcc.dg/debug/ctf/ctf-file-scope-1.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/testsuite/gcc.dg/debug/ctf/ctf-file-scope-1.c b/gcc/testsuite/gcc.dg/debug/ctf/ctf-file-scope-1.c
> index a683113e505..ddfb31da405 100644
> --- a/gcc/testsuite/gcc.dg/debug/ctf/ctf-file-scope-1.c
> +++ b/gcc/testsuite/gcc.dg/debug/ctf/ctf-file-scope-1.c
> @@ -9,7 +9,7 @@
>   
>   int foo (int n)
>   {
> -  typedef struct { int a[n]; } SFOO;
> +  typedef struct { int a[6]; } SFOO;
>   
>     SFOO a;
>     __attribute__ ((noinline)) SFOO gfoo (void) { return a; }
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.dg/debug/ctf/ctf-file-scope-1.c b/gcc/testsuite/gcc.dg/debug/ctf/ctf-file-scope-1.c
index a683113e505..ddfb31da405 100644
--- a/gcc/testsuite/gcc.dg/debug/ctf/ctf-file-scope-1.c
+++ b/gcc/testsuite/gcc.dg/debug/ctf/ctf-file-scope-1.c
@@ -9,7 +9,7 @@ 
 
 int foo (int n)
 {
-  typedef struct { int a[n]; } SFOO;
+  typedef struct { int a[6]; } SFOO;
 
   SFOO a;
   __attribute__ ((noinline)) SFOO gfoo (void) { return a; }