[LLD][ELF] - Add a test for ScriptParser::readPhdrType().
authorGeorge Rimar <grimar@accesssoftek.com>
Thu, 9 Aug 2018 13:19:10 +0000 (13:19 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Thu, 9 Aug 2018 13:19:10 +0000 (13:19 +0000)
This adds a test for https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L1289.

llvm-svn: 339342

lld/test/ELF/linkerscript/phdrs.s

index 077433c..c688bef 100644 (file)
 # RUN: not ld.lld -o /dev/null --script %t1.script %t 2>&1 | FileCheck --check-prefix=FOOHDR %s
 # FOOHDR: error: {{.*}}.script:1: unexpected header attribute: FOOHDR
 
+# RUN: echo "PHDRS { text PT_FOO FOOHDR; }" > %t1.script
+# RUN: not ld.lld -o /dev/null --script %t1.script %t 2>&1 | FileCheck --check-prefix=PTFOO %s
+# PTFOO: invalid program header type: PT_FOO
+
 .global _start
 _start:
  nop