Skip to content

[libc++] tests with picolibc: handle stdin #74712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

domin144
Copy link
Contributor

@domin144 domin144 commented Dec 7, 2023

Add proper explanation for cin.sh.cpp fail.
The stdin-is-piped.sh.cpp used to fail with old qemu (4.2.0), but should pass now, as the qemu is updated now to 8.1.3 in CI.

Add proper explanation for cin.sh.cpp fail.
The stdin-is-piped.sh.cpp used to fail with old qemu (4.2.0),
but should pass now, as the qemu is updated now to 8.1.3 in CI.
@domin144 domin144 marked this pull request as ready for review December 7, 2023 12:54
@domin144 domin144 requested a review from a team as a code owner December 7, 2023 12:54
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Dec 7, 2023
@llvmbot
Copy link
Member

llvmbot commented Dec 7, 2023

@llvm/pr-subscribers-libcxx

Author: Dominik Wójt (domin144)

Changes

Add proper explanation for cin.sh.cpp fail.
The stdin-is-piped.sh.cpp used to fail with old qemu (4.2.0), but should pass now, as the qemu is updated now to 8.1.3 in CI.


Full diff: https://github.com/llvm/llvm-project/pull/74712.diff

2 Files Affected:

  • (modified) libcxx/test/libcxx/selftest/stdin-is-piped.sh.cpp (-2)
  • (modified) libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp (+5-1)
diff --git a/libcxx/test/libcxx/selftest/stdin-is-piped.sh.cpp b/libcxx/test/libcxx/selftest/stdin-is-piped.sh.cpp
index 897e10e94783c..ffd10631c6a67 100644
--- a/libcxx/test/libcxx/selftest/stdin-is-piped.sh.cpp
+++ b/libcxx/test/libcxx/selftest/stdin-is-piped.sh.cpp
@@ -8,8 +8,6 @@
 
 // Make sure that the executor pipes standard input to the test-executable being run.
 
-// XFAIL: LIBCXX-PICOLIBC-FIXME
-
 // RUN: %{build}
 // RUN: echo "abc" | %{exec} %t.exe
 
diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp
index ad6cc192e2f48..ce6a7f37801e1 100644
--- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp
@@ -8,7 +8,11 @@
 
 // TODO: Investigate
 // UNSUPPORTED: LIBCXX-AIX-FIXME
-// XFAIL: LIBCXX-PICOLIBC-FIXME
+
+// QEMU does not detect EOF, when reading from stdin
+// "echo -n" suppresses any characters after the output and so the test hangs.
+// https://gitlab.com/qemu-project/qemu/-/issues/1963
+// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME
 
 // This test hangs on Android devices that lack shell_v2, which was added in
 // Android N (API 24).

@domin144
Copy link
Contributor Author

domin144 commented Dec 7, 2023

@DavidSpickett @ldionne

Copy link
Collaborator

@DavidSpickett DavidSpickett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldionne
Copy link
Member

ldionne commented Dec 7, 2023

Merging since this passed on Picolibc.

@ldionne ldionne merged commit ed61123 into llvm:main Dec 7, 2023
@domin144 domin144 deleted the libcxx_picolibc_stdin branch January 29, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants