From 44174b3d518ed70482ff5df2879523a4e26f92cc Mon Sep 17 00:00:00 2001 From: Hubert Tong Date: Tue, 24 Nov 2020 12:14:03 -0500 Subject: [PATCH] [NFC][tests] Replace non-portable grep with FileCheck After commit 2482648a795afbe12774168bbbf70dc14c031267, a GNU grep option is just passed unconditionally to `grep` in general. This patch fixes the test for platforms where `grep` is not GNU grep. --- clang/test/CodeGen/thinlto_embed_bitcode.ll | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clang/test/CodeGen/thinlto_embed_bitcode.ll b/clang/test/CodeGen/thinlto_embed_bitcode.ll index 971d400..590cadb 100644 --- a/clang/test/CodeGen/thinlto_embed_bitcode.ll +++ b/clang/test/CodeGen/thinlto_embed_bitcode.ll @@ -18,7 +18,7 @@ ; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t.o -x ir %t1.bc -c -fthinlto-index=%t.o.thinlto.bc -mllvm -lto-embed-bitcode=post-merge-pre-opt ; RUN: llvm-readelf -S %t.o | FileCheck %s --check-prefixes=CHECK-ELF,CHECK-ELF-CMD ; RUN: llvm-objcopy --dump-section=.llvmcmd=%t-embedded.cmd %t.o /dev/null -; RUN: grep --text x86_64-unknown-linux-gnu %t-embedded.cmd | count 1 +; RUN: FileCheck %s --check-prefixes=CHECK-EMBEDDED-CMD <%t-embedded.cmd ; RUN: llvm-objcopy --dump-section=.llvmbc=%t-embedded.bc %t.o /dev/null ; RUN: llvm-dis %t-embedded.bc -o - | FileCheck %s --check-prefixes=CHECK,CHECK-NOOPT ; We should only need the index and the post-thinlto merged module to generate @@ -43,3 +43,6 @@ ; CHECK-NOOPT-NEXT: call void @bar() ; CHECK-NOOPT: define available_externally void @bar() ; CHECK-NOOPT-NEXT: ret void + +; CHECK-EMBEDDED-CMD: x86_64-unknown-linux-gnu{{.*$}} +; CHECK-EMBEDDED-CMD-NOT: x86_64-unknown-linux-gnu -- 2.7.4