1 | // Test -MT and -E flags, PR4063 |
2 | |
3 | // RUN: %clang -E -o %t.1 %s |
4 | // RUN: %clang -E -MD -MF %t.d -MT foo -o %t.2 %s |
5 | // RUN: diff %t.1 %t.2 |
6 | // RUN: FileCheck -check-prefix=TEST1 %s < %t.d |
7 | // TEST1: foo: |
8 | // TEST1: dependencies-and-pp.c |
9 | |
10 | // Test -MQ flag without quoting |
11 | |
12 | // RUN: %clang -E -MD -MF %t.d -MQ foo -o %t %s |
13 | // RUN: FileCheck -check-prefix=TEST2 %s < %t.d |
14 | // TEST2: foo: |
15 | |
16 | // Test -MQ flag with quoting |
17 | |
18 | // RUN: %clang -E -MD -MF %t.d -MQ '$fo\ooo ooo\ ooo\\ ooo#oo' -o %t %s |
19 | // RUN: FileCheck -check-prefix=TEST3 %s < %t.d |
20 | // TEST3: $$fo\ooo\ ooo\\\ ooo\\\\\ ooo\#oo: |
21 | |
22 | // Test consecutive -MT flags |
23 | |
24 | // RUN: %clang -E -MD -MF %t.d -MT foo -MT bar -MT baz -o %t %s |
25 | // RUN: diff %t.1 %t |
26 | // RUN: FileCheck -check-prefix=TEST4 %s < %t.d |
27 | // TEST4: foo bar baz: |
28 | |
29 | // Test consecutive -MT and -MQ flags |
30 | |
31 | // RUN: %clang -E -MD -MF %t.d -MT foo -MQ '$(bar)' -MT 'b az' -MQ 'qu ux' -MQ ' space' -o %t %s |
32 | // RUN: FileCheck -check-prefix=TEST5 %s < %t.d |
33 | // TEST5: foo $$(bar) b az qu\ ux \ space: |
34 | |
35 | // Test self dependency, PR31644 |
36 | |
37 | // RUN: %clang -E -MD -MP -MF %t.d %s |
38 | // RUN: FileCheck -check-prefix=TEST6 %s < %t.d |
39 | // TEST6: dependencies-and-pp.c |
40 | // TEST6-NOT: dependencies-and-pp.c: |
41 | |
42 | // TODO: Test default target without quoting |
43 | // TODO: Test default target with quoting |
44 | |