2017-08-27 14:46:59 -07:00
|
|
|
// REQUIRES: x86
|
|
|
|
|
|
|
|
// This file contains two functions. They are themselves identical,
|
2018-01-17 14:29:21 -08:00
|
|
|
// but because they have relocations against different data sections,
|
2017-08-27 14:46:59 -07:00
|
|
|
// they are not mergeable.
|
|
|
|
|
|
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
|
|
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
|
|
|
|
// RUN: %p/Inputs/icf-non-mergeable.s -o %t2
|
|
|
|
|
2018-08-04 14:47:16 -07:00
|
|
|
// RUN: ld.lld %t1 %t2 -o /dev/null --icf=all --verbose 2>&1 | FileCheck %s
|
2017-08-27 14:46:59 -07:00
|
|
|
|
2018-08-04 14:47:16 -07:00
|
|
|
// CHECK-NOT: selected section '.text.f1'
|
|
|
|
// CHECK-NOT: removing identical section '.text.f2'
|
2017-08-27 14:46:59 -07:00
|
|
|
|
|
|
|
.globl _start, f1, f2, d1, d2
|
|
|
|
_start:
|
|
|
|
ret
|
|
|
|
|
|
|
|
.section .text.f1, "ax"
|
|
|
|
f1:
|
|
|
|
movl $5, d1
|
|
|
|
ret
|
|
|
|
|
|
|
|
.section .text.f2, "ax"
|
|
|
|
f2:
|
|
|
|
movl $5, d2
|
|
|
|
ret
|