[lld] r369516 - [LLD][ELF] - Simplify the bad-archive.s test case.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 04:19:50 PDT 2019


Author: grimar
Date: Wed Aug 21 04:19:50 2019
New Revision: 369516

URL: http://llvm.org/viewvc/llvm-project?rev=369516&view=rev
Log:
[LLD][ELF] - Simplify the bad-archive.s test case.

This removes the precompiled binary and improves the
check of the error reported.

Differential revision: https://reviews.llvm.org/D66523

Removed:
    lld/trunk/test/ELF/Inputs/bad-archive.a
Modified:
    lld/trunk/test/ELF/bad-archive.s

Removed: lld/trunk/test/ELF/Inputs/bad-archive.a
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/Inputs/bad-archive.a?rev=369515&view=auto
==============================================================================
--- lld/trunk/test/ELF/Inputs/bad-archive.a (original)
+++ lld/trunk/test/ELF/Inputs/bad-archive.a (removed)
@@ -1,2 +0,0 @@
-!<arch>
-this is malformed archive used in bad-archive.s

Modified: lld/trunk/test/ELF/bad-archive.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/bad-archive.s?rev=369516&r1=369515&r2=369516&view=diff
==============================================================================
--- lld/trunk/test/ELF/bad-archive.s (original)
+++ lld/trunk/test/ELF/bad-archive.s Wed Aug 21 04:19:50 2019
@@ -2,10 +2,13 @@
 
 // Check bad archive error reporting with --whole-archive
 // and without it.
+
+// RUN: echo "!<arch>" > %t.a
+// RUN: echo "foo" >> %t.a
 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
-// RUN: not ld.lld %t.o %p/Inputs/bad-archive.a -o %t 2>&1 | FileCheck %s
-// RUN: not ld.lld %t.o --whole-archive %p/Inputs/bad-archive.a -o %t 2>&1 | FileCheck %s
-// CHECK: bad-archive.a: failed to parse archive
+// RUN: not ld.lld %t.o %t.a -o %t 2>&1 | FileCheck -DFILE=%t.a %s
+// RUN: not ld.lld %t.o --whole-archive %t.a -o %t 2>&1 | FileCheck -DFILE=%t.a %s
+// CHECK: error: [[FILE]]: failed to parse archive: truncated or malformed archive (remaining size of archive too small for next archive member header at offset 8)
 
 .globl _start
 _start:




More information about the llvm-commits mailing list