llvm-project/lld/test/core/dead-strip-basic.objtxt

63 lines
1.3 KiB
Plaintext
Raw Normal View History

# RUN: lld -core --dead-strip %s | FileCheck -check-prefix=CHK1 %s
# RUN: lld -core %s | FileCheck -check-prefix=CHK2 %s
#
# Test that -dead-strip removes unreachable code and data
# and that not using that option leaves them.
#
---
defined-atoms:
- name: entry
dead-strip: never
references:
- offset: 1
kind: pcrel32
target: bar
- offset: 6
kind: pcrel32
target: baz
- name: mydead1
scope: global
undefined-atoms:
- name: bar
- name: baz
---
defined-atoms:
- name: mydead2
scope: global
type: data
- name: bar
scope: global
type: data
---
defined-atoms:
- name: baz
scope: global
type: code
- name: mydead3
type: code
...
# CHK1: name: entry
# CHK1-NOT: name: mydead1
# CHK1: name: bar
# CHK1-NOT: name: mydead2
# CHK1: name: baz
# CHK1-NOT: name: mydead3
# CHK1: ...
# CHK2: name: entry
# CHK2: name: mydead1
# CHK2: name: mydead2
# CHK2: name: bar
# CHK2: name: baz
# CHK2: name: mydead3
# CHK2: ...