[lld] r248820 - Update test to use invalid elf file in archives.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 11:44:18 PDT 2015


Author: rafael
Date: Tue Sep 29 13:44:18 2015
New Revision: 248820

URL: http://llvm.org/viewvc/llvm-project?rev=248820&view=rev
Log:
Update test to use invalid elf file in archives.

The code in driver is about to change so that the invalid files would no
longer be seen as ELF.

This makes sure that the error path will remain tested.

Added:
    lld/trunk/test/elf2/Inputs/invalid-data-encoding.a
    lld/trunk/test/elf2/Inputs/invalid-file-class.a
Removed:
    lld/trunk/test/elf2/Inputs/invalid-data-encoding.elf
    lld/trunk/test/elf2/Inputs/invalid-file-class.elf
Modified:
    lld/trunk/test/elf2/invalid-elf.test

Added: lld/trunk/test/elf2/Inputs/invalid-data-encoding.a
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/Inputs/invalid-data-encoding.a?rev=248820&view=auto
==============================================================================
Binary files lld/trunk/test/elf2/Inputs/invalid-data-encoding.a (added) and lld/trunk/test/elf2/Inputs/invalid-data-encoding.a Tue Sep 29 13:44:18 2015 differ

Removed: lld/trunk/test/elf2/Inputs/invalid-data-encoding.elf
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/Inputs/invalid-data-encoding.elf?rev=248819&view=auto
==============================================================================
Binary files lld/trunk/test/elf2/Inputs/invalid-data-encoding.elf (original) and lld/trunk/test/elf2/Inputs/invalid-data-encoding.elf (removed) differ

Added: lld/trunk/test/elf2/Inputs/invalid-file-class.a
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/Inputs/invalid-file-class.a?rev=248820&view=auto
==============================================================================
Binary files lld/trunk/test/elf2/Inputs/invalid-file-class.a (added) and lld/trunk/test/elf2/Inputs/invalid-file-class.a Tue Sep 29 13:44:18 2015 differ

Removed: lld/trunk/test/elf2/Inputs/invalid-file-class.elf
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/Inputs/invalid-file-class.elf?rev=248819&view=auto
==============================================================================
Binary files lld/trunk/test/elf2/Inputs/invalid-file-class.elf (original) and lld/trunk/test/elf2/Inputs/invalid-file-class.elf (removed) differ

Modified: lld/trunk/test/elf2/invalid-elf.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/invalid-elf.test?rev=248820&r1=248819&r2=248820&view=diff
==============================================================================
--- lld/trunk/test/elf2/invalid-elf.test (original)
+++ lld/trunk/test/elf2/invalid-elf.test Tue Sep 29 13:44:18 2015
@@ -1,22 +1,26 @@
-RUN: not lld -flavor gnu2 %p/Inputs/invalid-data-encoding.elf -o %t2 2>&1 | \
-RUN:   FileCheck --check-prefix=INVALID-DATA-ENC %s
-INVALID-DATA-ENC: Invalid data encoding: {{.*}}/invalid-data-encoding.elf
-
-RUN: not lld -flavor gnu2 %p/Inputs/invalid-file-class.elf -o %t2 2>&1 | \
-RUN:   FileCheck --check-prefix=INVALID-FILE-CLASS %s
-INVALID-FILE-CLASS: Invalid file class: {{.*}}/invalid-file-class.elf
-
-RUN: not lld -flavor gnu2 %p/Inputs/invalid-symtab-sh_info.elf -o %t2 2>&1 | \
-RUN:   FileCheck --check-prefix=INVALID-SYMTAB-SHINFO %s
-INVALID-SYMTAB-SHINFO: Invalid sh_info in symbol table
-
-RUN: not lld -flavor gnu2 %p/Inputs/invalid-binding.elf -o %t2 2>&1 | \
-RUN:   FileCheck --check-prefix=INVALID-BINDING %s
-INVALID-BINDING: unexpected binding
-
-RUN: not lld -flavor gnu2 %p/Inputs/invalid-section-index.elf -o %t2 2>&1 | \
-RUN:   FileCheck --check-prefix=INVALID-SECTION-INDEX %s
-INVALID-SECTION-INDEX: Invalid section index
+# RUN: llvm-mc %s -o %t -filetype=obj -triple x86_64-pc-linux
 
-RUN: not lld -flavor gnu2 %p/Inputs/invalid-shstrndx.so -o %t2 2>&1 | \
-RUN:   FileCheck --check-prefix=INVALID-SECTION-INDEX %s
+# RUN: not lld -flavor gnu2 %t %p/Inputs/invalid-data-encoding.a -o %t2 2>&1 | \
+# RUN:   FileCheck --check-prefix=INVALID-DATA-ENC %s
+# INVALID-DATA-ENC: Invalid data encoding: test.o
+
+# RUN: not lld -flavor gnu2 %t %p/Inputs/invalid-file-class.a -o %t2 2>&1 | \
+# RUN:   FileCheck --check-prefix=INVALID-FILE-CLASS %s
+# INVALID-FILE-CLASS: Invalid file class: test.o
+
+# RUN: not lld -flavor gnu2 %p/Inputs/invalid-symtab-sh_info.elf -o %t2 2>&1 | \
+# RUN:   FileCheck --check-prefix=INVALID-SYMTAB-SHINFO %s
+# INVALID-SYMTAB-SHINFO: Invalid sh_info in symbol table
+
+# RUN: not lld -flavor gnu2 %p/Inputs/invalid-binding.elf -o %t2 2>&1 | \
+# RUN:   FileCheck --check-prefix=INVALID-BINDING %s
+# INVALID-BINDING: unexpected binding
+
+# RUN: not lld -flavor gnu2 %p/Inputs/invalid-section-index.elf -o %t2 2>&1 | \
+# RUN:   FileCheck --check-prefix=INVALID-SECTION-INDEX %s
+# INVALID-SECTION-INDEX: Invalid section index
+
+# RUN: not lld -flavor gnu2 %p/Inputs/invalid-shstrndx.so -o %t2 2>&1 | \
+# RUN:   FileCheck --check-prefix=INVALID-SECTION-INDEX %s
+
+.long foo




More information about the llvm-commits mailing list