https://github.com/Ariel-Burton created 
https://github.com/llvm/llvm-project/pull/238138

On some platforms this test fails because the "2>&1" merges stdout and stderr. 
This can cause the output to interleaved in unpredictable ways.

The work round is to keep the output streams separate and check each 
independently

>From 7f1fcb0b2f9257b0898bced4060cf3bcb6b0bad2 Mon Sep 17 00:00:00 2001
From: Ariel Burton <[email protected]>
Date: Mon, 2 Nov 2026 16:38:58 -0600
Subject: [PATCH] Fix clang/test/Modules/cxx20-fatal-module-loader-error.cpp

On some platforms this test fails because the "2>&1" merges stdout and stderr.
This can cause the output to interleaved in unpredictable ways.

The work round is to keep the output streams separate and check each 
independently
---
 clang/test/Modules/cxx20-fatal-module-loader-error.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/clang/test/Modules/cxx20-fatal-module-loader-error.cpp 
b/clang/test/Modules/cxx20-fatal-module-loader-error.cpp
index ea2b3a2274fd3b..f7468b530f2b2e 100644
--- a/clang/test/Modules/cxx20-fatal-module-loader-error.cpp
+++ b/clang/test/Modules/cxx20-fatal-module-loader-error.cpp
@@ -1,9 +1,10 @@
 // RUN: rm -rf %t
 // RUN: mkdir %t
 // RUN: touch %t/A.pcm
-// RUN: not %clang_cc1 -std=c++20 -fmodule-file=A=%t/A.pcm -ast-dump %s 2>&1 | 
FileCheck %s
+// RUN: not %clang_cc1 -std=c++20 -fmodule-file=A=%t/A.pcm -ast-dump %s 2> 
%t/A.stderr | FileCheck %s
+// RUN: FileCheck --check-prefix=CHECK-STDERR %s < %t/A.stderr
 
-// CHECK: fatal error: file '{{.*}}A.pcm' is not a valid module file
+// CHECK-STDERR: fatal error: file '{{.*}}A.pcm' is not a valid module file
 // CHECK: VarDecl {{.*}} n 'int'
 
 import A;

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to