llvm-project/flang/test/Driver/code-gen-rv64.f90
Sergio Afonso 41a1415dc3 [Flang][Driver][NFC] Improve -emit-obj unit tests
Instead of looking for the existence of a `ret` instruction after disassembly
as a way to check that the right ISA is present in the produced binary, check
instead the ELF header of the file. This is a more reliable solution, since the
alternative can easily result in false positives.

Differential Revision: https://reviews.llvm.org/D149578
2023-05-04 10:13:07 +01:00

19 lines
560 B
Fortran

! Test -emit-obj (RISC-V 64)
! REQUIRES: riscv-registered-target
! RUN: %flang_fc1 -triple riscv64-unknown-linux-gnu \
! RUN: -target-feature +d -target-feature +c -emit-obj %s -o - | \
! RUN: llvm-readobj -h - | FileCheck %s
! RUN: %flang --target=riscv64-unknown-linux-gnu -c %s -o - | \
! RUN: llvm-readobj -h - | FileCheck %s
! If Flang failed to emit target-feature info, then Flags will be 0x0.
! CHECK: Arch: riscv64
! CHECK: Flags [ (0x5)
! CHECK-NEXT: EF_RISCV_FLOAT_ABI_DOUBLE (0x4)
! CHECK-NEXT: EF_RISCV_RVC (0x1)
! CHECK-NEXT: ]
end program