blob: 5055c6e06b697c616641a745518056ed05c84758 [file] [log] [blame]
# Test for section group members be preserved even if there is a
# reference to only one functions in the group.
# RUN: lld -core --dead-strip %s %p/Inputs/sectiongroup-deadstrip.objtxt | FileCheck %s
#
# Test that section groups are parsed properly when there is a reference to a
# group atom from outside a group.
#
---
defined-atoms:
- name: entry
dead-strip: never
references:
- offset: 1
kind: pcrel32
target: d1
- name: f1
scope: global
type: code
references:
- kind: layout-after
target: anotherfunction
- name: f2
scope: global
type: code
- name: g1
scope: global
type: code
- name: d1
scope: global
type: data
- name: g1
scope: global
type: group-comdat
references:
- kind: group-child
target: f1
- kind: group-child
target: f2
- kind: group-child
target: d1
- kind: group-child
target: g1
- name: anotherfunction
scope: global
type: data
...
#CHECK: defined-atoms:
#CHECK: - name: g1
#CHECK: ref-name: [[PARENT:[a-zA-Z\.0-9_]+]]
#CHECK: scope: global
#CHECK: type: group-comdat
#CHECK: references:
#CHECK: - kind: group-child
#CHECK: offset: 0
#CHECK: target: f1
#CHECK: - kind: group-child
#CHECK: offset: 0
#CHECK: target: f2
#CHECK: - kind: group-child
#CHECK: offset: 0
#CHECK: target: d1
#CHECK: - kind: group-child
#CHECK: offset: 0
#CHECK: target: [[GCHILD:[a-zA-Z\.0-9_]+]]
#CHECK: - name: f1
#CHECK: scope: global
#CHECK: references:
#CHECK: - kind: layout-after
#CHECK: offset: 0
#CHECK: target: anotherfunction
#CHECK: - name: f2
#CHECK: scope: global
#CHECK: - name: d1
#CHECK: scope: global
#CHECK: type: data
#CHECK: - name: g1
#CHECK: ref-name: [[GCHILD]]
#CHECK: scope: global
#CHECK: - name: anotherfunction
#CHECK: scope: global
#CHECK: type: data