1 // RUN: rm -rf %t && mkdir %t && cp %s %t/main.cc && mkdir %t/a && mkdir %t/QtCore && mkdir %t/Headers %t/Some.framework %t/Some.framework/Headers
2 // RUN: touch %t/foo.h %t/foo.hxx %t/foo.cc %t/a/foosys %t/a/foosys.h %t/QtCore/foosys %t/QtCore/foo.h
3 // RUN: touch %t/Headers/foosys %t/Headers/foo.h %t/Some.framework/Headers/foosys %t/Some.framework/Headers/foo.h
5 // Quoted string shows header-ish files from CWD, and all from system.
7 // RUN: %clang -fsyntax-only -isystem %t/a -Xclang -code-completion-at=%t/main.cc:6:13 %t/main.cc | FileCheck -check-prefix=CHECK-1 %s
8 // CHECK-1-NOT: foo.cc"
13 // Quoted string with dir shows header-ish files in that subdir.
15 // RUN: %clang -fsyntax-only -isystem %t/a -Xclang -code-completion-at=%t/main.cc:14:13 %t/main.cc | FileCheck -check-prefix=CHECK-2 %s
16 // CHECK-2-NOT: foo.h"
18 // CHECK-2-NOT: foosys"
20 // Angled shows headers from system dirs.
22 // RUN: %clang -fsyntax-only -isystem %t/a -Xclang -code-completion-at=%t/main.cc:21:13 %t/main.cc | FileCheck -check-prefix=CHECK-3 %s
23 // CHECK-3-NOT: foo.cc>
24 // CHECK-3-NOT: foo.h>
27 // With -I rather than -isystem, the header extension is required.
29 // RUN: %clang -fsyntax-only -I %t/a -Xclang -code-completion-at=%t/main.cc:28:13 %t/main.cc | FileCheck -check-prefix=CHECK-4 %s
30 // CHECK-4-NOT: foo.cc>
31 // CHECK-4-NOT: foo.h>
32 // CHECK-4-NOT: foosys>
34 // Backslash handling.
36 // RUN: %clang -fsyntax-only -isystem %t/a -Xclang -code-completion-at=%t/main.cc:35:13 %t/main.cc -fms-compatibility | FileCheck -check-prefix=CHECK-5 %s
39 // Qt headers don't necessarily have extensions.
41 // RUN: %clang -fsyntax-only -I %t/QtCore -Xclang -code-completion-at=%t/main.cc:40:13 %t/main.cc -fms-compatibility | FileCheck -check-prefix=CHECK-6 %s
42 // CHECK-6-NOT: foo.cc>
46 // If the include path directly points into a framework's Headers/ directory, we allow extension-less headers.
48 // RUN: %clang -fsyntax-only -I %t/Some.framework/Headers -Xclang -code-completion-at=%t/main.cc:47:13 %t/main.cc -fms-compatibility | FileCheck -check-prefix=CHECK-7 %s
49 // CHECK-7-NOT: foo.cc>
53 // Simply naming a directory "Headers" is not enough to allow extension-less headers.
55 // RUN: %clang -fsyntax-only -I %t/Headers -Xclang -code-completion-at=%t/main.cc:54:13 %t/main.cc -fms-compatibility | FileCheck -check-prefix=CHECK-8 %s
56 // CHECK-8-NOT: foo.cc>
58 // CHECK-8-NOT: foosys>