forked from OSchip/llvm-project
64 lines
1.3 KiB
Plaintext
64 lines
1.3 KiB
Plaintext
|
# RUN: lld-core -dead-strip=true %s | FileCheck -check-prefix=CHK1 %s
|
||
|
# RUN: lld-core -dead-strip=false %s | FileCheck -check-prefix=CHK2 %s
|
||
|
|
||
|
#
|
||
|
# Test that -dead-strip removes unreachable code and data
|
||
|
# and that not using that option leaves them.
|
||
|
#
|
||
|
|
||
|
---
|
||
|
atoms:
|
||
|
- name: entry
|
||
|
dead-strip: never
|
||
|
fixups:
|
||
|
- offset: 1
|
||
|
kind: pcrel32
|
||
|
target: bar
|
||
|
- offset: 6
|
||
|
kind: pcrel32
|
||
|
target: baz
|
||
|
|
||
|
- name: mydead1
|
||
|
scope: global
|
||
|
|
||
|
- name: bar
|
||
|
definition: undefined
|
||
|
|
||
|
- name: baz
|
||
|
definition: undefined
|
||
|
---
|
||
|
atoms:
|
||
|
- name: mydead2
|
||
|
scope: global
|
||
|
type: data
|
||
|
|
||
|
- name: bar
|
||
|
scope: global
|
||
|
type: data
|
||
|
---
|
||
|
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: ...
|