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-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 // Make sure that the executor pipes standard input to the test-executable being run.
10
11 // XFAIL: LIBCXX-PICOLIBC-FIXME
12
13 // RUN: %{build}
14 // RUN: echo "abc" | %{exec} %t.exe
15
16 #include <cstdio>
17
main(int,char **)18 int main(int, char**) {
19 int input[] = {std::getchar(), std::getchar(), std::getchar()};
20
21 if (input[0] == 'a' && input[1] == 'b' && input[2] == 'c')
22 return 0;
23 return 1;
24 }
25