[v1,4/8] LoongArch: testsuite:Fix FAIL in file bind_c_array_params_2.f90.

Message ID 20231229021256.24210-1-chenxiaolong@loongson.cn
State Committed
Commit 4ae1ab1fd3ba287dbc6eeed34e60f5b7c2686f90
Headers
Series LoongArch:Enable testing for common |

Commit Message

chenxiaolong Dec. 29, 2023, 2:12 a.m. UTC
  In the GCC regression test result, it is found that the
bind_c_array_params_2.f90 test fails. After analysis, it is found that the
reason why the test fails is that the regular expression in the test result
cannot correctly detect the correct assembly code (such as bl %plt(myBindC))
generated on the LoongArch architecture, such as the assembly code generated
on the x86 function call (call myBindC).

gcc/testsuite/ChangeLog:

	* gfortran.dg/bind_c_array_params_2.f90:Add code test rules to
	support testing of the loongArch architecture.
---
 gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90 b/gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90
index 0825efc7a2f..aa6a37b4850 100644
--- a/gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90
+++ b/gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90
@@ -2,6 +2,7 @@ 
 ! { dg-options "-std=f2008ts -fdump-tree-original" }
 ! { dg-additional-options "-mno-explicit-relocs" { target alpha*-*-* } }
 ! { dg-additional-options "-mno-relax-pic-calls" { target mips*-*-* } }
+! { dg-additional-options "-fplt -mcmodel=normal" { target loongarch*-*-* } }
 !
 ! Check that assumed-shape variables are correctly passed to BIND(C)
 ! as defined in TS 29913
@@ -16,7 +17,8 @@  integer :: aa(4,4)
 call test(aa)
 end
 
-! { dg-final { scan-assembler-times "\[ \t\]\[$,_0-9\]*myBindC" 1 { target { ! { hppa*-*-* s390*-*-* *-*-cygwin* amdgcn*-*-* powerpc-ibm-aix* *-*-ming* } } } } }
+! { dg-final { scan-assembler-times "\[ \t\]\[$,_0-9\]*myBindC" 1 { target { ! { hppa*-*-* s390*-*-* *-*-cygwin* amdgcn*-*-* powerpc-ibm-aix* *-*-ming* loongarch*-*-* } } } } }
+! { dg-final { scan-assembler-times "bl\t%plt\\(myBindC\\)" 1 { target loongarch*-*-* } } }
 ! { dg-final { scan-assembler-times "myBindC,%r2" 1 { target { hppa*-*-* } } } }
 ! { dg-final { scan-assembler-times "call\tmyBindC" 1 { target { *-*-cygwin* *-*-ming* } } } }
 ! { dg-final { scan-assembler-times "brasl\t%r\[0-9\]*,myBindC" 1 { target { s390*-*-* } } } }