diff mbox

[testsuite] PR61453 gfortran.dg/bind_c_array_params_2.f90 for targets where a call insn isn't "call"

Message ID 20140705155654.20DD5105@mailhost.lps.ens.fr
State New
Headers show

Commit Message

Dominique d'Humières July 5, 2014, 3:56 p.m. UTC
Is the following patch OK for trunk?

2014-07-05  Dominique d'Humieres <dominiq@lps.ens.fr>

	PR testsuite/61453
	* gfortran.dg/gfortran.dg/bind_c_array_params_2.f90:
	Adjust regexp for more targets.

Comments

John David Anglin July 5, 2014, 5:24 p.m. UTC | #1
On 5-Jul-14, at 11:56 AM, Dominique Dhumieres wrote:

> Is the following patch OK for trunk?
>
> 2014-07-05  Dominique d'Humieres <dominiq@lps.ens.fr>
>
> 	PR testsuite/61453
> 	* gfortran.dg/gfortran.dg/bind_c_array_params_2.f90:
> 	Adjust regexp for more targets.
>
> --- ../_clean/gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90	 
> 2014-05-24 16:17:53.000000000 +0200
> +++ gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90	2014-05-29  
> 11:34:40.000000000 +0200
> @@ -16,7 +16,7 @@ integer :: aa(4,4)
> call test(aa)
> end
>
> -! { dg-final { scan-assembler-times "call\[^\n\r\]*myBindC" 1  
> { target { ! { hppa*-*-hpux* } } } } }
> -! { dg-final { scan-assembler-times "call\[^\n\r\]*myBindC,%r2" 1  
> { target { hppa*-*-hpux* } } } }
> +! { dg-final { scan-assembler-times "\[ \t\]\[$,_0-9\]*myBindC" 1  
> { target { ! { hppa*-*-hpux* } } } } }
> +! { dg-final { scan-assembler-times "\[ \t\]\[$,_0-9\]*myBindC,%r2"  
> 1 { target { hppa*-*-hpux* } } } }

"myBindC,%r2" will work on hppa*-*-*.  I don't believe preceding stuff  
is needed on hppa.

Dave
--
John David Anglin	dave.anglin@bell.net
Dominique d'Humières July 5, 2014, 5:55 p.m. UTC | #2
> "myBindC,%r2" will work on hppa*-*-*.  I don't believe preceding stuff
> is needed on hppa.

Sorry, the relation with -flto has been lost in my repost of this patch.
Without something before 'myBindC', the symbol appears twice when compiled
with -flto, once in the assembly itself and once in the addition produced
by -flto. The goal of the stuff before 'myBindC' is to rule out this
addition. Use something such as

make -k check-gfortran RUNTESTFLAGS="dg.exp=bind_c_array_params_2.f90 --target_board=unix'{-m32,-m64,-m32/-flto,-m64/-flto}'"

to see the difference.

Dominique
John David Anglin July 5, 2014, 6:44 p.m. UTC | #3
On 5-Jul-14, at 1:55 PM, Dominique Dhumieres wrote:

>> "myBindC,%r2" will work on hppa*-*-*.  I don't believe preceding  
>> stuff
>> is needed on hppa.
>
> Sorry, the relation with -flto has been lost in my repost of this  
> patch.
> Without something before 'myBindC', the symbol appears twice when  
> compiled
> with -flto, once in the assembly itself and once in the addition  
> produced
> by -flto. The goal of the stuff before 'myBindC' is to rule out this
> addition. Use something such as
>
> make -k check-gfortran  
> RUNTESTFLAGS="dg.exp=bind_c_array_params_2.f90 --target_board=unix'{- 
> m32,-m64,-m32/-flto,-m64/-flto}'"
>
> to see the difference.


On hppa, the ",%r2" uniquely identifies the call.  The test passes  
with -flto.

Dave
--
John David Anglin	dave.anglin@bell.net
Dominique d'Humières July 6, 2014, 9:22 a.m. UTC | #4
> On hppa, the ",%r2" uniquely identifies the call.  The test passes
> with -flto.

Then is the following patch OK for hppa*-*-*?

+++ gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90	2014-07-05 22:20:49.000000000 +0200
@@ -16,7 +16,7 @@ integer :: aa(4,4)
 call test(aa)
 end
 
-! { dg-final { scan-assembler-times "call\[^\n\r\]*myBindC" 1 { target { ! { hppa*-*-hpux* } } } } }
-! { dg-final { scan-assembler-times "call\[^\n\r\]*myBindC,%r2" 1 { target { hppa*-*-hpux* } } } }
+! { dg-final { scan-assembler-times "\[ \t\]_*myBindC" 1 { target { ! { hppa*-*-hpux* } } } } }
+! { dg-final { scan-assembler-times "myBindC,%r2" 1 { target { hppa*-*-hpux* } } } }
 ! { dg-final { scan-tree-dump-times "test \\\(&parm\\." 1 "original" } }
 ! { dg-final { cleanup-tree-dump "original" } }

Dominique
John David Anglin July 6, 2014, 2:42 p.m. UTC | #5
I would change hppa*-*-hpux* to hppa*-*-*.  That's what I tested on  
hppa-linux.

I guess if "\[ \t\]_*myBindC" worked on hppa*-*-linux*, then it would  
probably work
on hpux and the target condition could be removed.  The reason hpux  
needed
special treatment originally is for every function call to an external  
symbol, there
is an .import directive containing the symbol name.

Dave

On 6-Jul-14, at 5:22 AM, Dominique Dhumieres wrote:

>> On hppa, the ",%r2" uniquely identifies the call.  The test passes
>> with -flto.
>
> Then is the following patch OK for hppa*-*-*?
>
> +++ gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90	2014-07-05  
> 22:20:49.000000000 +0200
> @@ -16,7 +16,7 @@ integer :: aa(4,4)
> call test(aa)
> end
>
> -! { dg-final { scan-assembler-times "call\[^\n\r\]*myBindC" 1  
> { target { ! { hppa*-*-hpux* } } } } }
> -! { dg-final { scan-assembler-times "call\[^\n\r\]*myBindC,%r2" 1  
> { target { hppa*-*-hpux* } } } }
> +! { dg-final { scan-assembler-times "\[ \t\]_*myBindC" 1 { target  
> { ! { hppa*-*-hpux* } } } } }
> +! { dg-final { scan-assembler-times "myBindC,%r2" 1 { target  
> { hppa*-*-hpux* } } } }
> ! { dg-final { scan-tree-dump-times "test \\\(&parm\\." 1  
> "original" } }
> ! { dg-final { cleanup-tree-dump "original" } }
>
> Dominique
>

--
John David Anglin	dave.anglin@bell.net
diff mbox

Patch

--- ../_clean/gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90	2014-05-24 16:17:53.000000000 +0200
+++ gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90	2014-05-29 11:34:40.000000000 +0200
@@ -16,7 +16,7 @@  integer :: aa(4,4)
 call test(aa)
 end
 
-! { dg-final { scan-assembler-times "call\[^\n\r\]*myBindC" 1 { target { ! { hppa*-*-hpux* } } } } }
-! { dg-final { scan-assembler-times "call\[^\n\r\]*myBindC,%r2" 1 { target { hppa*-*-hpux* } } } }
+! { dg-final { scan-assembler-times "\[ \t\]\[$,_0-9\]*myBindC" 1 { target { ! { hppa*-*-hpux* } } } } }
+! { dg-final { scan-assembler-times "\[ \t\]\[$,_0-9\]*myBindC,%r2" 1 { target { hppa*-*-hpux* } } } }
 ! { dg-final { scan-tree-dump-times "test \\\(&parm\\." 1 "original" } }
 ! { dg-final { cleanup-tree-dump "original" } }