From db367ff2d8d038f61d09521d5e6a293528df3d54 Mon Sep 17 00:00:00 2001 From: Victor Huang Date: Thu, 3 Sep 2020 09:08:24 -0500 Subject: [PATCH] [LLD][PowerPC][test] Fix out-of-memory issue running ppc64-pcrel-long-branch-error.s Following 97febb1, fix the out-of-memory error associated with buffering the output in-memory by writing to an allocated file with the minimum offset and running it on ppc system-linux only. Peer reviewed by: nemanjai --- lld/test/ELF/ppc64-pcrel-long-branch-error.s | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lld/test/ELF/ppc64-pcrel-long-branch-error.s b/lld/test/ELF/ppc64-pcrel-long-branch-error.s index b990490..2db9d15 100644 --- a/lld/test/ELF/ppc64-pcrel-long-branch-error.s +++ b/lld/test/ELF/ppc64-pcrel-long-branch-error.s @@ -1,22 +1,23 @@ -## The test as-is needs a large heap size. -## Disabled until we know how to check for that prerequisite. -# UNSUPPORTED: ppc - -# REQUIRES: ppc +# REQUIRES: ppc, system-linux # RUN: echo 'SECTIONS { \ # RUN: .text_low 0x2000: { *(.text_low) } \ -# RUN: .text_high 0x800002000 : { *(.text_high) } \ +# RUN: .text_high 0x200002010 : { *(.text_high) } \ # RUN: }' > %t.script +## 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. + # RUN: llvm-mc -filetype=obj -triple=ppc64le %s -o %t.o -# RUN: not ld.lld -T %t.script %t.o -o /dev/null 2>&1 | FileCheck %s +# RUN: not ld.lld -T %t.script %t.o -o %t 2>&1 | FileCheck %s # RUN: llvm-mc -filetype=obj -triple=ppc64le -defsym HIDDEN=1 %s -o %t.o -# RUN: not ld.lld -shared -T %t.script %t.o -o /dev/null 2>&1 | FileCheck %s +# RUN: not ld.lld -shared -T %t.script %t.o -o %t 2>&1 | FileCheck %s # RUN: llvm-mc -filetype=obj -triple=ppc64 %s -o %t.o -# RUN: not ld.lld -T %t.script %t.o -o /dev/null 2>&1 | FileCheck %s +# RUN: not ld.lld -T %t.script %t.o -o %t 2>&1 | FileCheck %s # RUN: llvm-mc -filetype=obj -triple=ppc64 -defsym HIDDEN=1 %s -o %t.o -# RUN: not ld.lld -shared -T %t.script %t.o -o /dev/null 2>&1 | FileCheck %s +# RUN: not ld.lld -shared -T %t.script %t.o -o %t 2>&1 | FileCheck %s # CHECK: error: offset overflow 34 bits, please compile using the large code model -- 2.7.4