blob: 7877df3f786e6b19d02f9371c8f2091acc9016f1 [file] [log] [blame]
Chris Lattner3edbeb72010-03-29 17:55:58 +00001// Test -MT and -E flags, PR4063
2
Daniel Dunbar80737ad2009-12-15 22:01:24 +00003// RUN: %clang -E -o %t.1 %s
4// RUN: %clang -E -MD -MF %t.d -MT foo -o %t.2 %s
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00005// RUN: diff %t.1 %t.2
6// RUN: grep "foo:" %t.d
Daniel Dunbare5393fb2009-05-03 10:04:17 +00007// RUN: grep "dependencies-and-pp.c" %t.d
Chris Lattner3edbeb72010-03-29 17:55:58 +00008
9// Test -MQ flag without quoting
10
11// RUN: %clang -E -MD -MF %t.d -MQ foo -o %t %s
12// RUN: grep "foo:" %t.d
13
14// Test -MQ flag with quoting
15
16// RUN: %clang -E -MD -MF %t.d -MQ '$fo\ooo ooo\ ooo\\ ooo#oo' -o %t %s
17// RUN: fgrep '$$fo\ooo\ ooo\\\ ooo\\\\\ ooo\#oo:' %t.d
18
19// Test consecutive -MT flags
20
21// RUN: %clang -E -MD -MF %t.d -MT foo -MT bar -MT baz -o %t %s
22// RUN: diff %t.1 %t
23// RUN: fgrep "foo bar baz:" %t.d
24
25// Test consecutive -MT and -MQ flags
26
27// RUN: %clang -E -MD -MF %t.d -MT foo -MQ '$(bar)' -MT 'b az' -MQ 'qu ux' -MQ ' space' -o %t %s
28// RUN: fgrep 'foo $$(bar) b az qu\ ux \ space:' %t.d
29
30// TODO: Test default target without quoting
31// TODO: Test default target with quoting