zig/deps/lld/test/ELF/lto/linker-script-symbols-assign.ll

40 lines
1016 B
LLVM
Raw Normal View History

2018-01-18 06:29:21 +08:00
; REQUIRES: x86
; RUN: llvm-as %s -o %t.o
; RUN: echo "foo = 1;" > %t.script
2018-08-05 05:47:16 +08:00
; RUN: ld.lld %t.o -o %t2 --script %t.script -save-temps
2018-01-18 06:29:21 +08:00
; RUN: llvm-readobj -symbols %t2.lto.o | FileCheck %s
; CHECK-NOT: bar
2018-08-05 05:47:16 +08:00
; CHECK-NOT: foo
2018-01-18 06:29:21 +08:00
; RUN: llvm-readobj -symbols %t2 | FileCheck %s --check-prefix=VAL
; VAL: Symbol {
; VAL: Name: foo
; VAL-NEXT: Value: 0x1
; VAL-NEXT: Size:
; VAL-NEXT: Binding: Global
; VAL-NEXT: Type: None
; VAL-NEXT: Other:
; VAL-NEXT: Section: Absolute
; VAL-NEXT: }
; RUN: echo "zed = 1;" > %t2.script
2018-08-05 05:47:16 +08:00
; RUN: ld.lld %t.o -o %t3 --script %t2.script
2018-01-18 06:29:21 +08:00
; RUN: llvm-readobj -symbols %t3 | FileCheck %s --check-prefix=ABS
; ABS: Symbol {
; ABS: Name: zed
; ABS-NEXT: Value: 0x1
; ABS-NEXT: Size: 0
; ABS-NEXT: Binding: Global
; ABS-NEXT: Type: None
; ABS-NEXT: Other: 0
; ABS-NEXT: Section: Absolute
; ABS-NEXT: }
target triple = "x86_64-unknown-linux-gnu"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@foo = global i32 0
@bar = global i32 0