blob: 3316becce1dcaff10a2ab9cbbfd6804ac3fcdb97 [file] [log] [blame]
Rui Ueyama327081e2016-02-02 21:58:39 +00001## Different "echo" commands on Windows interpret quoted strings and
2## wildcards in similar but different way (On Windows, ARGV tokenization
3## and wildcard expansion are not done by the shell but by each command.)
4## Because of that reason, this test fails on some Windows environment.
5## We can't write quoted strings that are interpreted the same way
6## by all echo commands. So, we don't want to run this on Windows.
7
8# REQUIRES: shell
9
Rui Ueyama025d59b2016-02-02 20:27:59 +000010# RUN: mkdir -p %t.dir
11
Rafael Espindola1c576052016-02-24 22:47:41 +000012## Note that we are using "cannot open no-such-file: " as a marker that the
13## linker keep going when it found an error. That specific error message is not
14## related to the linker script tests.
Rui Ueyama025d59b2016-02-02 20:27:59 +000015
16# RUN: echo foobar > %t1
Rafael Espindolad5b688c2016-02-23 20:36:20 +000017# RUN: not ld.lld %t1 no-such-file 2>&1 | FileCheck -check-prefix=ERR1 %s
Petr Hosek0df80be2016-08-18 04:34:27 +000018# ERR1: unexpected EOF
George Rimar57610422016-03-11 14:43:02 +000019# ERR1: cannot open no-such-file:
Rui Ueyama025d59b2016-02-02 20:27:59 +000020
21# RUN: echo "foo \"bar" > %t2
Rafael Espindolad5b688c2016-02-23 20:36:20 +000022# RUN: not ld.lld %t2 no-such-file 2>&1 | FileCheck -check-prefix=ERR2 %s
George Rimar57610422016-03-11 14:43:02 +000023# ERR2: unclosed quote
24# ERR2: cannot open no-such-file:
Rui Ueyama025d59b2016-02-02 20:27:59 +000025
26# RUN: echo "/*" > %t3
Rafael Espindolad5b688c2016-02-23 20:36:20 +000027# RUN: not ld.lld %t3 no-such-file 2>&1 | FileCheck -check-prefix=ERR3 %s
George Rimar57610422016-03-11 14:43:02 +000028# ERR3: unclosed comment
29# ERR3: cannot open no-such-file:
Rui Ueyama025d59b2016-02-02 20:27:59 +000030
31# RUN: echo "EXTERN (" > %t4
Rafael Espindolad5b688c2016-02-23 20:36:20 +000032# RUN: not ld.lld %t4 no-such-file 2>&1 | FileCheck -check-prefix=ERR4 %s
George Rimar57610422016-03-11 14:43:02 +000033# ERR4: unexpected EOF
34# ERR4: cannot open no-such-file:
Rui Ueyama025d59b2016-02-02 20:27:59 +000035
36# RUN: echo "EXTERN (" > %t5
Rafael Espindolad5b688c2016-02-23 20:36:20 +000037# RUN: not ld.lld %t5 no-such-file 2>&1 | FileCheck -check-prefix=ERR5 %s
George Rimar57610422016-03-11 14:43:02 +000038# ERR5: unexpected EOF
39# ERR5: cannot open no-such-file:
Rui Ueyama025d59b2016-02-02 20:27:59 +000040
41# RUN: echo "EXTERN xyz" > %t6
Rafael Espindolad5b688c2016-02-23 20:36:20 +000042# RUN: not ld.lld %t6 no-such-file 2>&1 | FileCheck -check-prefix=ERR6 %s
Rui Ueyama025d59b2016-02-02 20:27:59 +000043# ERR6: ( expected, but got xyz
George Rimar57610422016-03-11 14:43:02 +000044# ERR6: cannot open no-such-file:
Rui Ueyama025d59b2016-02-02 20:27:59 +000045
46# RUN: echo "INCLUDE /no/such/file" > %t7
Rafael Espindolad5b688c2016-02-23 20:36:20 +000047# RUN: not ld.lld %t7 no-such-file 2>&1 | FileCheck -check-prefix=ERR7 %s
George Rimar57610422016-03-11 14:43:02 +000048# ERR7: cannot open /no/such/file
49# ERR7: cannot open no-such-file:
Rui Ueyama025d59b2016-02-02 20:27:59 +000050
51# RUN: echo "OUTPUT_FORMAT(x y z)" > %t8
Rafael Espindolad5b688c2016-02-23 20:36:20 +000052# RUN: not ld.lld %t8 no-such-file 2>&1 | FileCheck -check-prefix=ERR8 %s
George Rimar57610422016-03-11 14:43:02 +000053# ERR8: unexpected token: y
54# ERR8: cannot open no-such-file: