diff --git a/gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp b/gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp
index a353f386ec0e8c33448497565bf34de98a4528c1..a00c4dbe2ffd8c12dbb97714e52af23a5baa8514 100644
--- a/gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp
+++ b/gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp
@@ -15,13 +15,11 @@
 load_lib "trace-support.exp"
 
 standard_testfile insn-reloc.c
-set executable $testfile
-set expfile $testfile.exp
 
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags]
 
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
+if [prepare_for_testing "failed to prepare" $testfile-no-ipa $srcfile \
 	[list debug $additional_flags]] {
     return -1
 }
@@ -47,7 +45,7 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
     untested "failed to compile"
     return -1
 }
-clean_restart ${executable}
+clean_restart $testfile
 
 if ![runto_main] {
     return 0