-
Notifications
You must be signed in to change notification settings - Fork 15k
[Clang] Make rewrite-includes-bom.c work with internal shell #158463
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
[Clang] Make rewrite-includes-bom.c work with internal shell #158463
Conversation
Created using spr 1.3.6 [skip ci]
Created using spr 1.3.6
|
@llvm/pr-subscribers-clang Author: Aiden Grossman (boomanaiden154) ChangesThis test was using $'<content with escapes' to have bash interpret Full diff: https://github.com/llvm/llvm-project/pull/158463.diff 1 Files Affected:
diff --git a/clang/test/Frontend/rewrite-includes-bom.c b/clang/test/Frontend/rewrite-includes-bom.c
index caa431ad9aaff..059cfa3be5bc8 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 bb 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 bb bf'
// RUN: %clang_cc1 -fsyntax-only -verify %t.c
// expected-no-diagnostics
-// REQUIRES: shell
#include "rewrite-includes-bom.h"
|
Created using spr 1.3.6 [skip ci]
Created using spr 1.3.6 [skip ci]
Created using spr 1.3.6 [skip ci]
This test was using $'<content with escapes' to have bash interpret shell escapes and then passing them to grep. The lexer/parser for lit's internal shell does not support such sequences. Given this is the only test in-tree that uses this functionality, it makes much more sense to use a POSIX compliant utility like od to transform the file into hex and then grep over that rather than modify the internal shell. This test should remain portable as od should be widely available and we are only using options specified in POSIX. Pull Request: llvm#158463
Created using spr 1.3.6 [skip ci]
Created using spr 1.3.6 [skip ci]
Created using spr 1.3.6 [skip ci]
This test was using $'<content with escapes' to have bash interpret shell escapes and then passing them to grep. The lexer/parser for lit's internal shell does not support such sequences. Given this is the only test in-tree that uses this functionality, it makes much more sense to use a POSIX compliant utility like od to transform the file into hex and then grep over that rather than modify the internal shell. This test should remain portable as od should be widely available and we are only using options specified in POSIX. Reviewers: cmtice, petrhosek, ilovepi Reviewed By: petrhosek, ilovepi Pull Request: llvm/llvm-project#158463
This test was using $'<content with escapes' to have bash interpret
shell escapes and then passing them to grep. The lexer/parser for lit's
internal shell does not support such sequences. Given this is the only
test in-tree that uses this functionality, it makes much more sense to
use a POSIX compliant utility like od to transform the file into hex and
then grep over that rather than modify the internal shell. This test
should remain portable as od should be widely available and we are only
using options specified in POSIX.