File: icf-non-mergeable.s

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (28 lines) | stat: -rw-r--r-- 679 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// REQUIRES: x86

// This file contains two functions. They are themselves identical,
// but because they have relocations against different data sections,
// 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

// 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'

.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