From 4f277763cf7daacb7f91478c04454da046c70545 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Sun, 1 May 2016 22:51:14 +0000 Subject: [PATCH] [GlobalDCE] Modernize. Use FileCheck instead of grep. llvm-svn: 268207 --- llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll | 3 ++- llvm/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll | 4 +++- llvm/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll | 4 +++- llvm/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll | 4 ++-- llvm/test/Transforms/GlobalDCE/basicvariabletest.ll | 3 ++- llvm/test/Transforms/GlobalDCE/externally_available.ll | 4 +++- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll b/llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll index 49a87d9..3da0fd5 100644 --- a/llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll +++ b/llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll @@ -1,8 +1,9 @@ ; Make sure that functions are removed successfully if they are referred to by ; a global that is dead. Make sure any globals they refer to die as well. -; RUN: opt < %s -globaldce -S | not grep foo +; RUN: opt < %s -globaldce -S | FileCheck %s +; CHECK-NOT: foo ;; Unused, kills %foo @b = internal global i32 ()* @foo ; [#uses=0] diff --git a/llvm/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll b/llvm/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll index 58d3f4c..4e45e2b 100644 --- a/llvm/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll +++ b/llvm/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll @@ -1,7 +1,9 @@ ; This testcase tests that a worklist is being used, and that globals can be ; removed if they are the subject of a constexpr and ConstantPointerRef -; RUN: opt < %s -globaldce -S | not grep global +; RUN: opt < %s -globaldce -S | FileCheck %s + +; CHECK-NOT: global @t0 = internal global [4 x i8] c"foo\00" ; <[4 x i8]*> [#uses=1] @t1 = internal global [4 x i8] c"bar\00" ; <[4 x i8]*> [#uses=1] diff --git a/llvm/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll b/llvm/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll index 781c57e..0b1b279 100644 --- a/llvm/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll +++ b/llvm/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll @@ -1,5 +1,7 @@ ; distilled from 255.vortex -; RUN: opt < %s -globaldce -S | not grep testfunc +; RUN: opt < %s -globaldce -S | FileCheck %s + +; CHECK-NOT: testfunc declare i1 ()* @getfunc() diff --git a/llvm/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll b/llvm/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll index 5b2c97f..ded3165 100644 --- a/llvm/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll +++ b/llvm/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll @@ -1,6 +1,6 @@ ; Weak variables should be preserved by global DCE! -; RUN: opt < %s -globaldce -S | grep @A - +; RUN: opt < %s -globaldce -S | FileCheck %s +; CHECK: @A @A = weak global i32 54 diff --git a/llvm/test/Transforms/GlobalDCE/basicvariabletest.ll b/llvm/test/Transforms/GlobalDCE/basicvariabletest.ll index a97b66d..af7d2fe 100644 --- a/llvm/test/Transforms/GlobalDCE/basicvariabletest.ll +++ b/llvm/test/Transforms/GlobalDCE/basicvariabletest.ll @@ -1,5 +1,6 @@ -; RUN: opt < %s -globaldce -S | not grep global +; RUN: opt < %s -globaldce -S | FileCheck %s +; CHECK-NOT: global @X = external global i32 @Y = internal global i32 7 diff --git a/llvm/test/Transforms/GlobalDCE/externally_available.ll b/llvm/test/Transforms/GlobalDCE/externally_available.ll index cc88cb1..fca49b2 100644 --- a/llvm/test/Transforms/GlobalDCE/externally_available.ll +++ b/llvm/test/Transforms/GlobalDCE/externally_available.ll @@ -1,10 +1,12 @@ -; RUN: opt < %s -globaldce -S | not grep test_ +; RUN: opt < %s -globaldce -S | FileCheck %s ; test_function should not be emitted to the .s file. +; CHECK-NOT: test_function define available_externally i32 @test_function() { ret i32 4 } ; test_global should not be emitted to the .s file. +; CHECK-NOT: test_global @test_global = available_externally global i32 4 -- 2.7.4