Author: Alison Zhang
Date: 2026-01-14T17:44:30-05:00
New Revision: 8ac6c4adbdf014b6d384d9a9120dc2318aab10a4

URL: 
https://github.com/llvm/llvm-project/commit/8ac6c4adbdf014b6d384d9a9120dc2318aab10a4
DIFF: 
https://github.com/llvm/llvm-project/commit/8ac6c4adbdf014b6d384d9a9120dc2318aab10a4.diff

LOG: [Clang] Fix rewrite-includes-bom.c to use POSIX-compliant regex (#176043)

As `\s` is a GNU extension, it is not supported by the system grep on
AIX and thus fails in the
[buildbot](https://lab.llvm.org/buildbot/#/builders/64/builds/6835):

```
******************** TEST 'Clang :: Frontend/rewrite-includes-bom.c' FAILED 
********************
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
cat 
/home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/Frontend/Inputs/rewrite-includes-bom.h
 | od -t x1 | grep -q 'ef\s*bb\s*bf'
# executed command: cat 
/home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/Frontend/Inputs/rewrite-includes-bom.h
# executed command: od -t x1
# executed command: grep -q 'ef\s*bb\s*bf'
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1
--
********************
```

This change replaces `\s` with the POSIX-compliant `[[:space::]]` so the
test is supported on AIX.

Co-authored-by: Alison Zhang <[email protected]>

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 27bf470ba1fd1..0c60ee66c8e73 100644
--- a/clang/test/Frontend/rewrite-includes-bom.c
+++ b/clang/test/Frontend/rewrite-includes-bom.c
@@ -1,6 +1,6 @@
-// RUN: cat %S/Inputs/rewrite-includes-bom.h | od -t x1 | grep -q 
'ef\s*bb\s*bf'
+// RUN: cat %S/Inputs/rewrite-includes-bom.h | od -t x1 | grep -q 
'ef[[:space:]]*bb[[:space:]]*bf'
 // RUN: %clang_cc1 -E -frewrite-includes -I %S/Inputs %s -o %t.c
-// RUN: cat %t.c | od -t x1 | not grep -q 'ef\s*bb\s*bf'
+// RUN: cat %t.c | od -t x1 | not grep -q 'ef[[:space:]]*bb[[:space:]]*bf'
 // RUN: %clang_cc1 -fsyntax-only -verify %t.c
 // expected-no-diagnostics
 // UNSUPPORTED: system-windows


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

Reply via email to