[lld] r338375 - [LLD][ELF] - ICF: add test case testing we do not fold sections with the different flags. NFCI.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 06:32:16 PDT 2018


Author: grimar
Date: Tue Jul 31 06:32:16 2018
New Revision: 338375

URL: http://llvm.org/viewvc/llvm-project?rev=338375&view=rev
Log:
[LLD][ELF] - ICF: add test case testing we do not fold sections with the different flags. NFCI.

Previously the following condition was not tested at all:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L300

Patch adds a test for `A->Flags != B->Flags` part.

Added:
    lld/trunk/test/ELF/icf17.s

Added: lld/trunk/test/ELF/icf17.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/icf17.s?rev=338375&view=auto
==============================================================================
--- lld/trunk/test/ELF/icf17.s (added)
+++ lld/trunk/test/ELF/icf17.s Tue Jul 31 06:32:16 2018
@@ -0,0 +1,15 @@
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
+# RUN: ld.lld %t1 -o /dev/null --icf=all --print-icf-sections 2>&1 | FileCheck -allow-empty %s
+
+# CHECK-NOT: selected
+
+.section .text
+.globl _start
+_start:
+  ret
+
+.section .aaa, "ax",%progbits,unique,1
+.quad _start
+
+.section .aaa, "axS",%progbits,unique,2
+.quad _start




More information about the llvm-commits mailing list