output-file-cleanup.c revision 9d718635fa805674aaba5d938f3dc6b35b8632ba
1// RUN: touch %t.o
2// RUN: not %clang -c -DCRASH -o %t.o -MMD -MF %t.d %s
3// RUN: test ! -f %t.o
4// RUN: test ! -f %t.d
5
6// RUN: touch %t.o
7// RUN: not %clang -c -DMISSING -o %t.o -MMD -MF %t.d %s
8// RUN: test ! -f %t.o
9// RUN: test ! -f %t.d
10
11// RUN: touch %t.o
12// RUN: not %clang -c -o %t.o -MMD -MF %t.d %s
13// RUN: test ! -f %t.o
14// RUN: test -f %t.d
15
16// REQUIRES: shell
17// REQUIRES: crash-recovery
18
19#ifdef CRASH
20#pragma clang __debug crash
21#elif defined(MISSING)
22#include "nonexistent.h"
23#else
24invalid C code
25#endif
26
27// RUN: touch %t1.c
28// RUN: echo "invalid C code" > %t2.c
29// RUN: cd %T && not %clang -c %t1.c %t2.c
30// RUN: test -f %t1.o
31// RUN: test ! -f %t2.o
32
33// RUN: touch %t1.c
34// RUN: touch %t2.c
35// RUN: chmod -r %t2.c
36// RUN: cd %T && not %clang -c %t1.c %t2.c
37// RUN: test -f %t1.o
38// RUN: test ! -f %t2.o
39