Skip to content

Commit 98418c2

Browse files
authored
[libc++][AIX] Use input redirection instead of piping for cin tests (#83184)
When echo is used for piping, lit uses the system echo rather than the builtin echo. The system echo on AIX doesn't support the `-n` option, which causes these tests to fail. Use input redirection, so the builtin echo can be used.
1 parent 0097fd2 commit 98418c2

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// TODO: Investigate
10-
// UNSUPPORTED: LIBCXX-AIX-FIXME
11-
129
// QEMU does not detect EOF, when reading from stdin
1310
// "echo -n" suppresses any characters after the output and so the test hangs.
1411
// https://gitlab.com/qemu-project/qemu/-/issues/1963
@@ -23,7 +20,8 @@
2320
// istream cin;
2421

2522
// RUN: %{build}
26-
// RUN: echo -n 1234 | %{exec} %t.exe
23+
// RUN: echo -n 1234 > %t.input
24+
// RUN: %{exec} %t.exe < %t.input
2725

2826
#include <iostream>
2927
#include <cassert>

libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin-imbue.sh.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// TODO: Investigate
10-
// UNSUPPORTED: LIBCXX-AIX-FIXME
11-
129
// This test hangs on Android devices that lack shell_v2, which was added in
1310
// Android N (API 24).
1411
// UNSUPPORTED: LIBCXX-ANDROID-FIXME && android-device-api={{2[1-3]}}
@@ -20,7 +17,8 @@
2017
// UNSUPPORTED: no-wide-characters
2118

2219
// RUN: %{build}
23-
// RUN: echo -n 1234 | %{exec} %t.exe
20+
// RUN: echo -n 1234 > %t.input
21+
// RUN: %{exec} %t.exe < %t.input
2422

2523
#include <iostream>
2624
#include <cassert>

libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// TODO: Investigate
10-
// UNSUPPORTED: LIBCXX-AIX-FIXME
11-
129
// This test hangs on Android devices that lack shell_v2, which was added in
1310
// Android N (API 24).
1411
// UNSUPPORTED: LIBCXX-ANDROID-FIXME && android-device-api={{2[1-3]}}
@@ -20,7 +17,8 @@
2017
// UNSUPPORTED: no-wide-characters
2118

2219
// RUN: %{build}
23-
// RUN: echo -n 1234 | %{exec} %t.exe
20+
// RUN: echo -n 1234 > %t.input
21+
// RUN: %{exec} %t.exe < %t.input
2422

2523
#include <iostream>
2624
#include <cassert>

0 commit comments

Comments
 (0)