[clang] 2272726 - Reapply "[Clang] Make rewrite-includes-bom.c work with internal shell"

Aiden Grossman via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 19 13:09:33 PDT 2025


Author: Aiden Grossman
Date: 2025-10-19T13:05:58-07:00
New Revision: 227272662a02151ad401c0881da46250944dc3e3

URL: https://github.com/llvm/llvm-project/commit/227272662a02151ad401c0881da46250944dc3e3
DIFF: https://github.com/llvm/llvm-project/commit/227272662a02151ad401c0881da46250944dc3e3.diff

LOG: Reapply "[Clang] Make rewrite-includes-bom.c work with internal shell"

This reverts commit 354ad556e17358db2b22507e3ef07ba39991b189.

This was reverted previously for causing test failures on MacOS. It turns out
that od -t x1 prints two spaces between hexadecimal representations of bytes
rather than one like on other *nix systems. This reland updates the original
patch to match any number of whitespace characters in between the bytes rather
than just a single space.

Added: 
    

Modified: 
    clang/test/Frontend/rewrite-includes-bom.c

Removed: 
    


################################################################################
diff  --git a/clang/test/Frontend/rewrite-includes-bom.c b/clang/test/Frontend/rewrite-includes-bom.c
index caa431ad9aaff..46a6c3062a55a 100644
--- a/clang/test/Frontend/rewrite-includes-bom.c
+++ b/clang/test/Frontend/rewrite-includes-bom.c
@@ -1,8 +1,7 @@
-// RUN: grep -q $'^\xEF\xBB\xBF' %S/Inputs/rewrite-includes-bom.h
+// RUN: cat %S/Inputs/rewrite-includes-bom.h | od -t x1 | grep -q 'ef\s*bb\s*bf'
 // RUN: %clang_cc1 -E -frewrite-includes -I %S/Inputs %s -o %t.c
-// RUN: ! grep -q $'\xEF\xBB\xBF' %t.c
+// RUN: cat %t.c | od -t x1 | not grep -q 'ef\s*bb\s*bf'
 // RUN: %clang_cc1 -fsyntax-only -verify %t.c
 // expected-no-diagnostics
-// REQUIRES: shell
 
 #include "rewrite-includes-bom.h"


        


More information about the cfe-commits mailing list