[clang] 44174b3 - [NFC][tests] Replace non-portable grep with FileCheck

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 09:15:15 PST 2020


Author: Hubert Tong
Date: 2020-11-24T12:15:07-05:00
New Revision: 44174b3d518ed70482ff5df2879523a4e26f92cc

URL: https://github.com/llvm/llvm-project/commit/44174b3d518ed70482ff5df2879523a4e26f92cc
DIFF: https://github.com/llvm/llvm-project/commit/44174b3d518ed70482ff5df2879523a4e26f92cc.diff

LOG: [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.

Added: 
    

Modified: 
    clang/test/CodeGen/thinlto_embed_bitcode.ll

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGen/thinlto_embed_bitcode.ll b/clang/test/CodeGen/thinlto_embed_bitcode.ll
index 971d4005435d..590cadbfd418 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


        


More information about the cfe-commits mailing list