xref: /llvm-project/lld/test/ELF/lto/undefined-puts.ll (revision f01fdd17b4d202727023da23bdd120eb0bd94f9f)
1; REQUIRES: x86
2; RUN: llvm-mc %p/Inputs/shared.s -o %t1.o -filetype=obj -triple=x86_64-unknown-linux
3; RUN: ld.lld %t1.o -o %t1.so -shared
4; RUN: llvm-as %s -o %t2.o
5; RUN: ld.lld %t1.so %t2.o -o %t
6; RUN: llvm-readobj --dyn-syms --dyn-relocations %t | FileCheck %s
7
8target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
9target triple = "x86_64-unknown-linux-gnu"
10
11@.str = private unnamed_addr constant [6 x i8] c"blah\0A\00", align 1
12
13define i32 @_start() {
14  %str = call i32 (ptr, ...) @printf(ptr @.str)
15  ret i32 0
16}
17
18declare i32 @printf(ptr, ...)
19
20; Check that puts symbol is present in the dynamic symbol table and
21; there's a relocation for it.
22; CHECK:      Dynamic Relocations {
23; CHECK-NEXT:   R_X86_64_JUMP_SLOT puts 0x0
24; CHECK-NEXT: }
25
26; CHECK: DynamicSymbols [
27; CHECK: Symbol {
28; CHECK:    Name: puts
29