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

44 lines
1.1 KiB
Plaintext
Raw Normal View History

# RUN: lld -core --dead-strip --keep-globals %s %p/Inputs/dead-strip-globals.objtxt %p/Inputs/dead-strip-globals2.objtxt | FileCheck -check-prefix=CHK1 %s
# RUN: lld -core --dead-strip %s %p/Inputs/dead-strip-globals.objtxt %p/Inputs/dead-strip-globals2.objtxt | FileCheck -check-prefix=CHK2 %s
#
# Test that -keep-globals prevents -dead-strip from removing globals.
#
---
defined-atoms:
- name: entry
dead-strip: never
references:
- offset: 1
kind: pcrel32
target: bar
- offset: 6
kind: pcrel32
target: baz
- name: myglobal1
scope: global
undefined-atoms:
- name: bar
- name: baz
...
# CHK1: name: entry
# CHK1: name: myglobal1
# CHK1: name: myglobal2
# CHK1: name: bar
# CHK1: name: baz
# CHK1-NOT: name: mydead
# CHK1: ...
# CHK2: name: entry
# CHK2-NOT: name: myglobal1
# CHK2-NOT: name: myglobal2
# CHK2: name: bar
# CHK2: name: baz
# CHK2-NOT: name: mydead
# CHK2: ...