brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.6 KiB · 1e6da7b Raw
87 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t3 4# Simple symbol assignment. Should raise conflict in case we5# have duplicates in any input section, but currently simply6# replaces the value.7# RUN: echo "SECTIONS {.text : {*(.text.*)} text_end = .;}" > %t.script8# RUN: ld.lld -o %t1 --script %t.script %t9# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=SIMPLE %s10# SIMPLE: .text  0000000000000000 text_end11 12# The symbol is not referenced. Don't provide it.13# RUN: echo "SECTIONS { PROVIDE(newsym = 1);}" > %t.script14# RUN: ld.lld -o %t1 --script %t.script %t15# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=DONTPROVIDE %s16# DONTPROVIDE-NOT: newsym17 18# The symbol is not referenced. Don't provide it.19# RUN: echo "SECTIONS { PROVIDE_HIDDEN(newsym = 1);}" > %t.script20# RUN: ld.lld -o %t1 --script %t.script %t21# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=DONTPROVIDE %s22 23# Provide existing symbol. The value should be 0, even though we24# have value of 1 in PROVIDE()25# RUN: echo "SECTIONS { PROVIDE(somesym =1);}" > %t.script26# RUN: ld.lld -o %t1 --script %t.script %t27# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=PROVIDE2 %s28# PROVIDE2: 0000000000000000 g       *ABS*  0000000000000000 somesym29 30# Provide existing symbol. The value should be 0, even though we31# have value of 1 in PROVIDE_HIDDEN(). Visibility should not change32# RUN: echo "SECTIONS { PROVIDE_HIDDEN(somesym =1);}" > %t.script33# RUN: ld.lld -o %t1 --script %t.script %t34# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=HIDDEN2 %s35# HIDDEN2: 0000000000000000 g       *ABS*  0000000000000000 somesym36 37# Hidden symbol assignment.38# RUN: echo "SECTIONS { HIDDEN(newsym =1);}" > %t.script39# RUN: ld.lld -o %t1 --script %t.script %t40# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=HIDDEN3 %s41# HIDDEN3: 0000000000000001 l       *ABS*  0000000000000000 .hidden newsym42 43# The symbol is not referenced. Don't provide it.44# RUN: echo "PROVIDE(newsym = 1);" > %t.script45# RUN: ld.lld -o %t1 --script %t.script %t46# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=DONTPROVIDE %s47 48# The symbol is not referenced. Don't provide it.49# RUN: echo "PROVIDE_HIDDEN(newsym = 1);" > %t.script50# RUN: ld.lld -o %t1 --script %t.script %t51# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=DONTPROVIDE %s52 53# Provide existing symbol. The value should be 0, even though we54# have value of 1 in PROVIDE()55# RUN: echo "PROVIDE(somesym = 1);" > %t.script56# RUN: ld.lld -o %t1 --script %t.script %t57# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=PROVIDE5 %s58# PROVIDE5: 0000000000000000 g       *ABS*  0000000000000000 somesym59 60# Provide existing symbol. The value should be 0, even though we61# have value of 1 in PROVIDE_HIDDEN(). Visibility should not change62# RUN: echo "PROVIDE_HIDDEN(somesym = 1);" > %t.script63# RUN: ld.lld -o %t1 --script %t.script %t64# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=HIDDEN5 %s65# HIDDEN5: 0000000000000000 g       *ABS*  0000000000000000 somesym66 67# Simple symbol assignment. All three symbols should have the68# same value.69# RUN: echo "foo = 0x100; SECTIONS { bar = foo; } baz = bar;" > %t.script70# RUN: ld.lld -o %t1 --script %t.script %t71# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=SIMPLE2 %s72# SIMPLE2: 0000000000000100 g       *ABS*  0000000000000000 foo73# SIMPLE2: 0000000000000100 g       *ABS*  0000000000000000 bar74# SIMPLE2: 0000000000000100 g       *ABS*  0000000000000000 baz75 76# RUN: echo 'PROVIDE(somesym + 1);' > %t.script77# RUN: not ld.lld -T %t.script %t -o /dev/null 2>&1 | FileCheck %s --check-prefix=PROVIDE-ERR78 79# PROVIDE-ERR: {{.*}}:1: = expected, but got +80 81.global _start82_start:83 nop84 85.global somesym86somesym = 087