2016-02-26 02:43:51 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
2017-12-12 05:57:31 +08:00
|
|
|
# RUN: ld.lld %t -o %t2 --icf=all --verbose 2>&1 | FileCheck %s
|
2016-02-26 02:43:51 +08:00
|
|
|
# RUN: llvm-objdump -t %t2 | FileCheck -check-prefix=ALIGN %s
|
|
|
|
|
2018-02-02 00:00:46 +08:00
|
|
|
# CHECK: selected section '.text.f1' from file [[T:'.*']]
|
|
|
|
# CHECK: removing identical section '.text.f2' from file [[T]]
|
2016-02-26 02:43:51 +08:00
|
|
|
|
2016-11-24 01:44:02 +08:00
|
|
|
# ALIGN: 0000000000201000 .text 00000000 _start
|
|
|
|
# ALIGN: 0000000000201100 .text 00000000 f1
|
2016-02-26 02:43:51 +08:00
|
|
|
|
|
|
|
.globl _start, f1, f2
|
|
|
|
_start:
|
|
|
|
ret
|
|
|
|
|
|
|
|
.section .text.f1, "ax"
|
|
|
|
.align 1
|
|
|
|
f1:
|
|
|
|
mov $60, %rax
|
|
|
|
mov $42, %rdi
|
|
|
|
syscall
|
|
|
|
|
|
|
|
.section .text.f2, "ax"
|
|
|
|
.align 256
|
|
|
|
f2:
|
|
|
|
mov $60, %rax
|
|
|
|
mov $42, %rdi
|
|
|
|
syscall
|