[ELF][test] Fix several LLD ICF tests
authorAndrew Ng <andrew.ng@sony.com>
Thu, 23 Sep 2021 17:42:31 +0000 (18:42 +0100)
committerAndrew Ng <andrew.ng@sony.com>
Mon, 4 Oct 2021 10:10:10 +0000 (11:10 +0100)
A number of the ICF tests were not updated to use --print-icf-sections
instead of --verbose and various '-NOT' checks were not updated to the
latest output format of --print-icf-sections. Because these are all
'negative' tests, these issues have gone unnoticed.

Differential Revision: https://reviews.llvm.org/D110353

lld/test/ELF/icf-non-mergeable.s
lld/test/ELF/icf-none.s
lld/test/ELF/icf3.s
lld/test/ELF/icf4.s
lld/test/ELF/icf5.s
lld/test/ELF/icf6.s

index 978ac15..2e3cbe8 100644 (file)
@@ -8,10 +8,7 @@
 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
 // RUN:    %p/Inputs/icf-non-mergeable.s -o %t2
 
-// RUN: ld.lld %t1 %t2 -o /dev/null --icf=all --verbose 2>&1 | FileCheck %s
-
-// CHECK-NOT: selected section '.text.f1'
-// CHECK-NOT:   removing identical section '.text.f2'
+// RUN: ld.lld %t1 %t2 -o /dev/null --icf=all --print-icf-sections | count 0
 
 .globl _start, f1, f2, d1, d2
 _start:
index 7c73361..86f6a38 100644 (file)
@@ -1,9 +1,7 @@
 # REQUIRES: x86
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-# RUN: ld.lld %t -o /dev/null --icf=all --icf=none --verbose 2>&1 | FileCheck %s
-
-# CHECK-NOT: selected section '.text.f1'
+# RUN: ld.lld %t -o /dev/null --icf=all --icf=none --print-icf-sections | count 0
 
 .globl _start, f1, f2
 _start:
index 7ae4acf..3636dee 100644 (file)
@@ -2,10 +2,7 @@
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/icf2.s -o %t2
-# RUN: ld.lld %t1 %t2 -o /dev/null --icf=all --print-icf-sections 2>&1 | FileCheck -allow-empty %s
-
-# CHECK-NOT: selected section '.text.f1' from file
-# CHECK-NOT: selected section '.text.f2' from file
+# RUN: ld.lld %t1 %t2 -o /dev/null --icf=all --print-icf-sections | count 0
 
 .globl _start, f1, f2
 _start:
index 2b04796..ff13a7e 100644 (file)
@@ -1,10 +1,7 @@
 # REQUIRES: x86
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-# RUN: ld.lld %t -o /dev/null --icf=all --print-icf-sections 2>&1 | FileCheck -allow-empty %s
-
-# CHECK-NOT: selected section '.text.f1'
-# CHECK-NOT: selected section '.text.f2'
+# RUN: ld.lld %t -o /dev/null --icf=all --print-icf-sections | count 0
 
 .globl _start, f1, f2
 _start:
index 86c0bc4..068ed7f 100644 (file)
@@ -1,10 +1,7 @@
 # REQUIRES: x86
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-# RUN: ld.lld %t -o /dev/null --icf=all --print-icf-sections 2>&1 | FileCheck -allow-empty %s
-
-# CHECK-NOT: selected section '.text.f1'
-# CHECK-NOT: selected section '.text.f2'
+# RUN: ld.lld %t -o /dev/null --icf=all --print-icf-sections | count 0
 
 .globl _start, f1, f2
 _start:
index 0819d51..f01657e 100644 (file)
@@ -1,10 +1,7 @@
 # REQUIRES: x86
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-# RUN: ld.lld %t -o /dev/null --icf=all --print-icf-sections 2>&1 | FileCheck -allow-empty %s
-
-# CHECK-NOT: selected section '.text.f1'
-# CHECK-NOT: selected section '.text.f2'
+# RUN: ld.lld %t -o /dev/null --icf=all --print-icf-sections | count 0
 
 .globl _start, f1, f2
 _start: