39 lines · plain
1; REQUIRES: x862; RUN: llvm-as %s -o %t.o3 4;;5;; Verify that symbols given by -init and -fini are preserved and6;; DT_INIT/DT_FINI are created.7;;8 9; RUN: ld.lld -o %t.exe -pie %t.o10; RUN: llvm-nm %t.exe | FileCheck -check-prefix=TEST1 --allow-empty %s11; RUN: llvm-readelf -d %t.exe | FileCheck -check-prefix=TEST2 %s12 13; TEST1-NOT: foo14; TEST1-NOT: bar15 16; TEST2-NOT: INIT17; TEST2-NOT: FINI18 19; RUN: ld.lld -o %t.exe -pie -init=foo -fini=bar %t.o20; RUN: llvm-nm %t.exe | FileCheck -check-prefix=TEST3 %s21; RUN: llvm-readelf -d %t.exe | FileCheck -check-prefix=TEST4 %s22 23; TEST3: bar24; TEST3: foo25 26; TEST4: INIT27; TEST4: FINI28 29target triple = "x86_64-unknown-linux-gnu"30target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"31 32define void @foo() {33 ret void34}35 36define void @bar() {37 ret void38}39