33 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// XFAIL: LIBCXX-FREEBSD-FIXME10 11// Make sure that test-executables can appear in RUN lines and be executed12// effectively. This somewhat difficult-to-understand test checks that when13// we run with a remote executor, test-executables are copied to the remote14// host and their path is fixed up (directly in the command-line) to their15// path on the remote host instead of the local host.16//17// We also check that the path of test-executables is replaced whether they18// appear first in the command-line or not.19 20// UNSUPPORTED: executor-has-no-bash21// RUN: %{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe22// RUN: %{exec} %t.exe 023// RUN: %{exec} bash -c '! %t.exe 1'24 25#include <cassert>26#include <cstdlib>27 28int main(int argc, char** argv) {29 assert(argc == 2);30 int ret = std::atoi(argv[1]);31 return ret;32}33