Rui Ueyama | 327081e | 2016-02-02 21:58:39 +0000 | [diff] [blame] | 1 | ## 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 Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 10 | # RUN: mkdir -p %t.dir |
| 11 | |
Rafael Espindola | 1c57605 | 2016-02-24 22:47:41 +0000 | [diff] [blame^] | 12 | ## 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 Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 15 | |
| 16 | # RUN: echo foobar > %t1 |
Rafael Espindola | d5b688c | 2016-02-23 20:36:20 +0000 | [diff] [blame] | 17 | # RUN: not ld.lld %t1 no-such-file 2>&1 | FileCheck -check-prefix=ERR1 %s |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 18 | # ERR1: unknown directive: foobar |
Rafael Espindola | 1c57605 | 2016-02-24 22:47:41 +0000 | [diff] [blame^] | 19 | # ERR1: cannot open no-such-file: |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 20 | |
| 21 | # RUN: echo "foo \"bar" > %t2 |
Rafael Espindola | d5b688c | 2016-02-23 20:36:20 +0000 | [diff] [blame] | 22 | # RUN: not ld.lld %t2 no-such-file 2>&1 | FileCheck -check-prefix=ERR2 %s |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 23 | # ERR2: unclosed quote |
Rafael Espindola | 1c57605 | 2016-02-24 22:47:41 +0000 | [diff] [blame^] | 24 | # ERR2: cannot open no-such-file: |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 25 | |
| 26 | # RUN: echo "/*" > %t3 |
Rafael Espindola | d5b688c | 2016-02-23 20:36:20 +0000 | [diff] [blame] | 27 | # RUN: not ld.lld %t3 no-such-file 2>&1 | FileCheck -check-prefix=ERR3 %s |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 28 | # ERR3: unclosed comment |
Rafael Espindola | 1c57605 | 2016-02-24 22:47:41 +0000 | [diff] [blame^] | 29 | # ERR3: cannot open no-such-file: |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 30 | |
| 31 | # RUN: echo "EXTERN (" > %t4 |
Rafael Espindola | d5b688c | 2016-02-23 20:36:20 +0000 | [diff] [blame] | 32 | # RUN: not ld.lld %t4 no-such-file 2>&1 | FileCheck -check-prefix=ERR4 %s |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 33 | # ERR4: unexpected EOF |
Rafael Espindola | 1c57605 | 2016-02-24 22:47:41 +0000 | [diff] [blame^] | 34 | # ERR4: cannot open no-such-file: |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 35 | |
| 36 | # RUN: echo "EXTERN (" > %t5 |
Rafael Espindola | d5b688c | 2016-02-23 20:36:20 +0000 | [diff] [blame] | 37 | # RUN: not ld.lld %t5 no-such-file 2>&1 | FileCheck -check-prefix=ERR5 %s |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 38 | # ERR5: unexpected EOF |
Rafael Espindola | 1c57605 | 2016-02-24 22:47:41 +0000 | [diff] [blame^] | 39 | # ERR5: cannot open no-such-file: |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 40 | |
| 41 | # RUN: echo "EXTERN xyz" > %t6 |
Rafael Espindola | d5b688c | 2016-02-23 20:36:20 +0000 | [diff] [blame] | 42 | # RUN: not ld.lld %t6 no-such-file 2>&1 | FileCheck -check-prefix=ERR6 %s |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 43 | # ERR6: ( expected, but got xyz |
Rafael Espindola | 1c57605 | 2016-02-24 22:47:41 +0000 | [diff] [blame^] | 44 | # ERR6: cannot open no-such-file: |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 45 | |
| 46 | # RUN: echo "INCLUDE /no/such/file" > %t7 |
Rafael Espindola | d5b688c | 2016-02-23 20:36:20 +0000 | [diff] [blame] | 47 | # RUN: not ld.lld %t7 no-such-file 2>&1 | FileCheck -check-prefix=ERR7 %s |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 48 | # ERR7: cannot open /no/such/file |
Rafael Espindola | 1c57605 | 2016-02-24 22:47:41 +0000 | [diff] [blame^] | 49 | # ERR7: cannot open no-such-file: |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 50 | |
| 51 | # RUN: echo "OUTPUT_FORMAT(x y z)" > %t8 |
Rafael Espindola | d5b688c | 2016-02-23 20:36:20 +0000 | [diff] [blame] | 52 | # RUN: not ld.lld %t8 no-such-file 2>&1 | FileCheck -check-prefix=ERR8 %s |
Rui Ueyama | 025d59b | 2016-02-02 20:27:59 +0000 | [diff] [blame] | 53 | # ERR8: unexpected token: y |
Rafael Espindola | 1c57605 | 2016-02-24 22:47:41 +0000 | [diff] [blame^] | 54 | # ERR8: cannot open no-such-file: |