[ELF] Make tests with undefined symbols more explicit.

Differential Revision: https://reviews.llvm.org/D40253

llvm-svn: 318939
This commit is contained in:
Igor Kudrin 2017-11-24 06:42:32 +00:00
parent 15475e92c6
commit d95c74ec81
6 changed files with 12 additions and 7 deletions

View File

@ -1,3 +1,3 @@
.global baz
.type barz, @function
.type baz, @function
baz:

View File

@ -1,6 +1,6 @@
# REQUIRES: x86,ppc
# RUN: echo ".globl foo" > %te.s
# RUN: echo ".globl foo; .data; .dc.a foo" > %te.s
# RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %te.s -o %te-i386.o
# RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %s -o %t-i386.o
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t-x86_64.o
@ -244,3 +244,5 @@ foo:
bar:
.weak zed
.global xyz
.data
.dc.a baz

View File

@ -1,6 +1,6 @@
; REQUIRES: x86
; RUN: llvm-as %s -o %t.o
; RUN: echo .global __progname > %t2.s
; RUN: echo ".global __progname; .data; .dc.a __progname" > %t2.s
; RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t2.s -o %t2.o
; RUN: ld.lld -shared %t2.o -o %t2.so
; RUN: ld.lld -o %t %t.o %t2.so

View File

@ -1,6 +1,6 @@
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
// RUN: echo .global __progname > %t2.s
// RUN: echo ".global __progname; .data; .dc.a __progname" > %t2.s
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t2.s -o %t2.o
// RUN: ld.lld -shared %t2.o -o %t2.so
// RUN: ld.lld -o %t %t.o %t2.so

View File

@ -3,9 +3,6 @@
# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
# RUN: llvm-readobj -dyn-symbols %t.so | FileCheck %s
# This does not match gold's behavior because gold does not create undefined
# symbols in dynsym without an appropriate (e.g. PLT) relocation in the input.
# CHECK: DynamicSymbols [
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: @
@ -38,3 +35,6 @@
.global foo
.weak bar
.data
.dc.a foo
.dc.a bar

View File

@ -28,3 +28,6 @@
.globl _start
_start:
.data
.dc.a foo