Files
clang-p2996/flang/test/Driver/target-machine-error.f90
Nadeem, Usman f67b481098 [Flang] Exit gracefully with a useful message when we fail to lookup a target
Without this patch we were asserting with a generic message `Failed to
create Target`, but we already have a detailed error message stored in
the variable `error` after calling `lookupTarget()` but this error was not
getting used/printed.

With this patch we will emit a message with more details instead of a
stack dump with a generic message.

Differential Revision: https://reviews.llvm.org/D146333

Change-Id: I7ddee917cf921a2133ca3e6b35791b2142f770a2
2023-03-20 12:08:34 -07:00

7 lines
313 B
Fortran

! RUN: not %flang --target=some-invalid-triple -S %s -o \
! RUN: /dev/null 2>&1 | FileCheck %s
! RUN: not %flang_fc1 -triple some-invalid-triple -S %s -o \
! RUN: /dev/null 2>&1 | FileCheck %s
! CHECK: error: unable to create target: 'No available targets are compatible with triple "some-invalid-triple"'