| 1 |
// REQUIRES: case-insensitive-filesystem |
| 2 |
|
| 3 |
// RUN: mkdir -p %t/Output/apath |
| 4 |
// RUN: mkdir -p %t/Output/asystempath |
| 5 |
// RUN: cp %S/Inputs/case-insensitive-include.h %t/Output |
| 6 |
// RUN: cp %S/Inputs/case-insensitive-include.h %t/Output/asystempath/case-insensitive-include2.h |
| 7 |
// RUN: cd %t/Output |
| 8 |
// RUN: %clang_cc1 -fsyntax-only %s -include %s -I %t/Output -isystem %t/Output/asystempath -verify |
| 9 |
// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s -include %s -I %t/Output -isystem %t/Output/asystempath 2>&1 | FileCheck %s |
| 10 |
|
| 11 |
// Known standard header, so warn: |
| 12 |
#include <StdDef.h> // expected-warning {{non-portable path}} |
| 13 |
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:10-[[@LINE-1]]:20}:"<stddef.h>" |
| 14 |
|
| 15 |
#include "case-insensitive-include.h" |
| 16 |
#include "Case-Insensitive-Include.h" // expected-warning {{non-portable path}} |
| 17 |
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:10-[[@LINE-1]]:38}:"\"case-insensitive-include.h\"" |
| 18 |
|
| 19 |
#include "../Output/.//case-insensitive-include.h" |
| 20 |
#include "../Output/.//Case-Insensitive-Include.h" // expected-warning {{non-portable path}} |
| 21 |
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:10-[[@LINE-1]]:51}:"\"../Output/.//case-insensitive-include.h\"" |
| 22 |
#include "../output/.//case-insensitive-include.h" // expected-warning {{non-portable path}} |
| 23 |
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:10-[[@LINE-1]]:51}:"\"../Output/.//case-insensitive-include.h\"" |
| 24 |
|
| 25 |
#include "apath/.././case-insensitive-include.h" |
| 26 |
#include "apath/.././Case-Insensitive-Include.h" // expected-warning {{non-portable path}} |
| 27 |
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:10-[[@LINE-1]]:49}:"\"apath/.././case-insensitive-include.h\"" |
| 28 |
#include "APath/.././case-insensitive-include.h" // For the sake of efficiency, this case is not diagnosed. :-( |
| 29 |
|
| 30 |
#include "../Output/./apath/.././case-insensitive-include.h" |
| 31 |
#include "../Output/./APath/.././case-insensitive-include.h" // For the sake of efficiency, this case is not diagnosed. :-( |
| 32 |
#include "../output/./apath/.././case-insensitive-include.h" // expected-warning {{non-portable path}} |
| 33 |
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:10-[[@LINE-1]]:61}:"\"../Output/./apath/.././case-insensitive-include.h\"" |
| 34 |
|
| 35 |
#include "CASE-INSENSITIVE-INCLUDE2.H" // Found in an -isystem directory. No warning. |