2020-09-03 22:08:24 +08:00
|
|
|
# REQUIRES: ppc, system-linux
|
2020-08-28 23:40:48 +08:00
|
|
|
# RUN: echo 'SECTIONS { \
|
|
|
|
# RUN: .text_low 0x2000: { *(.text_low) } \
|
2020-09-03 22:08:24 +08:00
|
|
|
# RUN: .text_high 0x200002010 : { *(.text_high) } \
|
2020-08-28 23:40:48 +08:00
|
|
|
# RUN: }' > %t.script
|
|
|
|
|
2020-09-03 22:08:24 +08:00
|
|
|
## In this test, we do not use -o /dev/null like other similar cases do since
|
|
|
|
## it will fail in some enviroments with out-of-memory errors associated with
|
|
|
|
## buffering the output in memeory. The test is enabled for ppc linux only since
|
|
|
|
## writing to an allocated file will cause time out error for this case on freebsd.
|
|
|
|
|
2020-08-28 23:40:48 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=ppc64le %s -o %t.o
|
2020-09-03 22:08:24 +08:00
|
|
|
# RUN: not ld.lld -T %t.script %t.o -o %t 2>&1 | FileCheck %s
|
2020-08-28 23:40:48 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=ppc64le -defsym HIDDEN=1 %s -o %t.o
|
2020-09-03 22:08:24 +08:00
|
|
|
# RUN: not ld.lld -shared -T %t.script %t.o -o %t 2>&1 | FileCheck %s
|
2020-08-28 23:40:48 +08:00
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=ppc64 %s -o %t.o
|
2020-09-03 22:08:24 +08:00
|
|
|
# RUN: not ld.lld -T %t.script %t.o -o %t 2>&1 | FileCheck %s
|
2020-08-28 23:40:48 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=ppc64 -defsym HIDDEN=1 %s -o %t.o
|
2020-09-03 22:08:24 +08:00
|
|
|
# RUN: not ld.lld -shared -T %t.script %t.o -o %t 2>&1 | FileCheck %s
|
2020-08-28 23:40:48 +08:00
|
|
|
|
|
|
|
# CHECK: error: offset overflow 34 bits, please compile using the large code model
|
|
|
|
|
|
|
|
.section .text_low, "ax", %progbits
|
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
bl high@notoc
|
|
|
|
blr
|
|
|
|
|
|
|
|
.section .text_high, "ax", %progbits
|
|
|
|
.ifdef HIDDEN
|
|
|
|
.hidden high
|
|
|
|
.endif
|
|
|
|
.globl high
|
|
|
|
high:
|
|
|
|
blr
|