blob: e4b0feea16a967d325a0d8755851fa6fce4973d7 [file] [log] [blame]
Eli Friedmanf7ca26a2011-07-08 20:17:28 +00001// Basic test
Chandler Carruth220617c2011-02-23 23:52:14 +00002// RUN: rm -rf %t.dir
Chandler Carruthf8da8c72011-02-24 02:39:40 +00003// RUN: mkdir -p %t.dir/a/b
4// RUN: echo > %t.dir/a/b/x.h
5// RUN: cd %t.dir
Eli Friedmanf7ca26a2011-07-08 20:17:28 +00006// RUN: %clang -MD -MF - %s -fsyntax-only -I a/b | FileCheck -check-prefix=CHECK-ONE %s
NAKAMURA Takumi5dd37772011-11-17 07:21:33 +00007// CHECK-ONE: {{ }}a/b{{[/\\]}}x.h
Nick Lewycky36079892011-02-23 21:16:44 +00008
Eli Friedmanf7ca26a2011-07-08 20:17:28 +00009// PR8974 (-include flag)
10// RUN: %clang -MD -MF - %s -fsyntax-only -include a/b/x.h -DINCLUDE_FLAG_TEST | FileCheck -check-prefix=CHECK-TWO %s
11// CHECK-TWO: {{ }}a/b/x.h
12
13// rdar://problem/9734352 (paths involving ".")
14// RUN: %clang -MD -MF - %s -fsyntax-only -I ./a/b | FileCheck -check-prefix=CHECK-THREE %s
NAKAMURA Takumi5dd37772011-11-17 07:21:33 +000015// CHECK-THREE: {{ }}a/b{{[/\\]}}x.h
Eli Friedmanf7ca26a2011-07-08 20:17:28 +000016// RUN: %clang -MD -MF - %s -fsyntax-only -I .//./a/b/ | FileCheck -check-prefix=CHECK-FOUR %s
NAKAMURA Takumi5dd37772011-11-17 07:21:33 +000017// CHECK-FOUR: {{ }}a/b{{[/\\]}}x.h
Eli Friedmanf7ca26a2011-07-08 20:17:28 +000018// RUN: %clang -MD -MF - %s -fsyntax-only -I a/b/. | FileCheck -check-prefix=CHECK-FIVE %s
NAKAMURA Takumi5dd37772011-11-17 07:21:33 +000019// CHECK-FIVE: {{ }}a/b/.{{[/\\]}}x.h
Eli Friedmanf7ca26a2011-07-08 20:17:28 +000020// RUN: cd a/b
21// RUN: %clang -MD -MF - %s -fsyntax-only -I ./ | FileCheck -check-prefix=CHECK-SIX %s
22// CHECK-SIX: {{ }}x.h
Ivan Krasin1193f2c2015-08-13 04:04:37 +000023// RUN: echo "fun:foo" > %t.blacklist
Peter Collingbourne3afb2662016-04-28 17:09:37 +000024// RUN: %clang -MD -MF - %s -fsyntax-only -fsanitize=cfi-vcall -flto -fvisibility=hidden -fsanitize-blacklist=%t.blacklist -I ./ | FileCheck -check-prefix=CHECK-SEVEN %s
Ivan Krasin1193f2c2015-08-13 04:04:37 +000025// CHECK-SEVEN: .blacklist
26// CHECK-SEVEN: {{ }}x.h
Eli Friedmanf7ca26a2011-07-08 20:17:28 +000027#ifndef INCLUDE_FLAG_TEST
28#include <x.h>
29#endif