[PATCH] D66523: [LLD][ELF] - Simplify the bad-archive.s test case.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 04:23:09 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL369516: [LLD][ELF] - Simplify the bad-archive.s test case. (authored by grimar, committed by ).
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D66523?vs=216364&id=216369#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66523/new/

https://reviews.llvm.org/D66523

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


Index: lld/trunk/test/ELF/bad-archive.s
===================================================================
--- lld/trunk/test/ELF/bad-archive.s
+++ lld/trunk/test/ELF/bad-archive.s
@@ -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:
Index: lld/trunk/test/ELF/Inputs/bad-archive.a
===================================================================
--- lld/trunk/test/ELF/Inputs/bad-archive.a
+++ lld/trunk/test/ELF/Inputs/bad-archive.a
@@ -1,2 +0,0 @@
-!<arch>
-this is malformed archive used in bad-archive.s


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66523.216369.patch
Type: text/x-patch
Size: 1249 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190821/884ea154/attachment.bin>


More information about the llvm-commits mailing list