Skip to content

Commit 8d6470f

Browse files
[Clang] Make rewrite-includes-bom.c work with internal shell
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: #158463
1 parent 7a3fa06 commit 8d6470f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
// RUN: grep -q $'^\xEF\xBB\xBF' %S/Inputs/rewrite-includes-bom.h
1+
// RUN: cat %S/Inputs/rewrite-includes-bom.h | od -t x1 | grep -q 'ef bb bf'
22
// RUN: %clang_cc1 -E -frewrite-includes -I %S/Inputs %s -o %t.c
3-
// RUN: ! grep -q $'\xEF\xBB\xBF' %t.c
3+
// RUN: cat %t.c | od -t x1 | not grep -q 'ef bb bf'
44
// RUN: %clang_cc1 -fsyntax-only -verify %t.c
55
// expected-no-diagnostics
6-
// REQUIRES: shell
76

87
#include "rewrite-includes-bom.h"

0 commit comments

Comments
 (0)