]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[testsuite] fix pr70321.c PIC expectations
authorAlexandre Oliva <oliva@adacore.com>
Thu, 7 Nov 2024 05:46:57 +0000 (02:46 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 7 Nov 2024 05:46:57 +0000 (02:46 -0300)
When we select a non-bx get_pc_thunk, we get an extra mov to set up
the PIC register before the abort call.  Expect that mov or a
get_pc_thunk.bx call.

for  gcc/testsuite/ChangeLog

* gcc.target/i386/pr70321.c: Cope with non-bx get_pc_thunk.

gcc/testsuite/gcc.target/i386/pr70321.c

index 58f5f5661c7a2327b8726cb5169c6d7572c13e19..287b7da1b95011674f02ee76681816595e57b0f0 100644 (file)
@@ -9,4 +9,8 @@ void foo (long long ixi)
 
 /* { dg-final { scan-assembler-times "mov" 1 { target nonpic } } } */
 /* get_pc_thunk adds an extra mov insn.  */
-/* { dg-final { scan-assembler-times "mov" 2 { target { ! nonpic } } } } */
+/* Choosing a non-bx get_pc_thunk requires another mov before the abort call.
+   So we require a match of either that mov or the get_pc_thunk.bx call, in
+   addition to the other 2 movs.  (Hopefully there won't be more calls for a
+   false positive.)  */
+/* { dg-final { scan-assembler-times "mov|call\[^\n\r]*get_pc_thunk\.bx" 3 { target { ! nonpic } } } } */