This is a dg-do compile test using check-function-bodies.  Under slim
LTO (-flto -fno-fat-lto-objects) a compile-only run emits only LTO
bytecode with no assembly, and no LTRANS output is produced since the
test never links, so check-function-bodies finds no output file to scan.
Unlike scan-assembler*, check-function-bodies has no required-options
hook to force -ffat-lto-objects.  Skip the -flto variant.

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/ext-dce-3.c: Skip under -flto.
        * gcc.target/riscv/ext-dce-4.c: Skip under -flto.
---
 gcc/testsuite/gcc.target/riscv/ext-dce-3.c | 2 ++
 gcc/testsuite/gcc.target/riscv/ext-dce-4.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/gcc/testsuite/gcc.target/riscv/ext-dce-3.c 
b/gcc/testsuite/gcc.target/riscv/ext-dce-3.c
index e62655ae286..6988a0f08f0 100644
--- a/gcc/testsuite/gcc.target/riscv/ext-dce-3.c
+++ b/gcc/testsuite/gcc.target/riscv/ext-dce-3.c
@@ -3,6 +3,8 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target rv64 } */
 /* { dg-options "-march=rv64gc -mabi=lp64d -O2" } */
+/* Slim LTO compile-only produces no assembly to scan.  */
+/* { dg-skip-if "" { *-*-* } { "-flto" } } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
 /*
diff --git a/gcc/testsuite/gcc.target/riscv/ext-dce-4.c 
b/gcc/testsuite/gcc.target/riscv/ext-dce-4.c
index 21f2d9a13eb..8a4f3637652 100644
--- a/gcc/testsuite/gcc.target/riscv/ext-dce-4.c
+++ b/gcc/testsuite/gcc.target/riscv/ext-dce-4.c
@@ -2,6 +2,8 @@
    when the upper bits are dead.  */
 /* { dg-do compile } */
 /* { dg-options "-O2" } */
+/* Slim LTO compile-only produces no assembly to scan.  */
+/* { dg-skip-if "" { *-*-* } { "-flto" } } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
 /*
-- 
2.52.0

Reply via email to