diff --git a/flang/test/Driver/code-gen-aarch64.f90 b/flang/test/Driver/code-gen-aarch64.f90 index b6be486395316..e258b59c05f03 100644 --- a/flang/test/Driver/code-gen-aarch64.f90 +++ b/flang/test/Driver/code-gen-aarch64.f90 @@ -1,22 +1,9 @@ ! Test -emit-obj (X86) -! REQUIRES: aarch64-registered-target, x86-registered-target +! REQUIRES: aarch64-registered-target -! RUN: rm -f %t.o -! RUN: %flang_fc1 -emit-obj -triple aarch64-unknown-linux-gnu %s -o %t.o -! RUN: llvm-objdump --triple aarch64-unknown-linux-gnu --disassemble-all %t.o | FileCheck %s --check-prefix=CORRECT_TRIPLE -! RUN: rm -f %t.o -! RUN: %flang -c --target=aarch64-unknown-linux-gnu %s -o %t.o -! RUN: llvm-objdump --triple aarch64-unknown-linux-gnu --disassemble-all %t.o | FileCheck %s --check-prefix=CORRECT_TRIPLE - -! RUN: %flang -c --target=aarch64-unknown-linux-gnu %s -o %t.o -! RUN: llvm-objdump --triple x86_64-unknown-linux-gnu --disassemble-all %t.o | FileCheck %s --check-prefix=INCORRECT_TRIPLE - -! CORRECT_TRIPLE-LABEL: <_QQmain>: -! CORRECT_TRIPLE-NEXT: ret - -! When incorrect triple is used to disassemble, there won't be a ret instruction at all. -! INCORRECT_TRIPLE-LABEL: <_QQmain>: -! INCORRECT_TRIPLE-NOT: ret +! RUN: %flang_fc1 -triple aarch64-unknown-linux-gnu -emit-obj %s -o - | \ +! RUN: llvm-readobj -h - | FileCheck %s +! CHECK: Arch: aarch64 end program diff --git a/flang/test/Driver/code-gen-rv64.f90 b/flang/test/Driver/code-gen-rv64.f90 index c29ec9eff0aa2..f7bdb842559a4 100644 --- a/flang/test/Driver/code-gen-rv64.f90 +++ b/flang/test/Driver/code-gen-rv64.f90 @@ -2,16 +2,15 @@ ! REQUIRES: riscv-registered-target -! RUN: rm -f %t.o ! RUN: %flang_fc1 -triple riscv64-unknown-linux-gnu \ -! RUN: -target-feature +d -target-feature +c -emit-obj %s -o %t.o -! RUN: llvm-readobj -h %t.o | FileCheck %s +! RUN: -target-feature +d -target-feature +c -emit-obj %s -o - | \ +! RUN: llvm-readobj -h - | FileCheck %s -! RUN: rm -f %t.o -! RUN: %flang --target=riscv64-unknown-linux-gnu -c %s -o %t.o -! RUN: llvm-readobj -h %t.o | 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) diff --git a/flang/test/Driver/code-gen-x86.f90 b/flang/test/Driver/code-gen-x86.f90 index b2bf95613efae..a6e5096f0de4b 100644 --- a/flang/test/Driver/code-gen-x86.f90 +++ b/flang/test/Driver/code-gen-x86.f90 @@ -1,22 +1,9 @@ ! Test -emit-obj (X86) -! REQUIRES: x86-registered-target, aarch64-registered-target +! REQUIRES: x86-registered-target -! RUN: rm -f %t.o -! RUN: %flang_fc1 -triple x86_64-unknown-linux-gnu -emit-obj %s -o %t.o -! RUN: llvm-objdump --triple x86_64-unknown-linux-gnu --disassemble-all %t.o | FileCheck %s --check-prefix=CORRECT_TRIPLE -! RUN: rm -f %t.o -! RUN: %flang --target=x86_64-unknown-linux-gnu -c %s -o %t.o -! RUN: llvm-objdump --triple x86_64-unknown-linux-gnu --disassemble-all %t.o | FileCheck %s --check-prefix=CORRECT_TRIPLE - -! RUN: %flang -c --target=x86_64-unknown-linux-gnu %s -o %t.o -! RUN: llvm-objdump --triple aarch64-unknown-linux-gnu --disassemble-all %t.o | FileCheck %s --check-prefix=INCORRECT_TRIPLE - -! CORRECT_TRIPLE-LABEL: <_QQmain>: -! CORRECT_TRIPLE-NEXT: retq - -! When incorrect triple is used to disassemble, there won't be a ret(q) instruction at all. -! INCORRECT_TRIPLE-LABEL: <_QQmain>: -! INCORRECT_TRIPLE-NOT: ret +! RUN: %flang_fc1 -triple x86_64-unknown-linux-gnu -emit-obj %s -o - | \ +! RUN: llvm-readobj -h - | FileCheck %s +! CHECK: Arch: x86_64 end program