150
|
1 // RUN: %clang_cc1 -E %s -I%S/Inputs | FileCheck -strict-whitespace %s
|
|
2 // RUN: %clang_cc1 -fms-compatibility -DMS -E %s -I%S/Inputs | FileCheck -check-prefix=CHECK-MS -strict-whitespace %s
|
|
3 // RUN: %clang_cc1 -E %s -I%S/Inputs -DBADINC -verify
|
|
4
|
|
5 #ifdef BADINC
|
|
6
|
|
7 // Paranoia.
|
|
8
|
|
9 __FILE_NAME__
|
|
10 #include <include-subdir/> // expected-error {{file not found}}
|
|
11 __FILE_NAME__
|
|
12
|
|
13 #else
|
|
14
|
|
15 // Reference.
|
|
16 1: "file_name_macro.c"
|
|
17
|
|
18 // Ensure it expands correctly for this file.
|
|
19 2: __FILE_NAME__
|
|
20
|
|
21 // CHECK: {{^}}1: "file_name_macro.c"
|
|
22 // CHECK: {{^}}2: "file_name_macro.c"
|
|
23
|
|
24 // Test if inclusion works right.
|
|
25 #ifdef MS
|
|
26 #include <include-subdir\file_name_macro_include.h>
|
|
27 // MS compatibility allows for mixed separators in paths.
|
|
28 #include <include-subdir/subdir1\hdr1.h>
|
|
29 #include <include-subdir\subdir1/hdr2.h>
|
|
30 #else
|
|
31 #include <include-subdir/file_name_macro_include.h>
|
|
32 #endif
|
|
33
|
|
34 #include <include-subdir/h>
|
|
35
|
|
36 // CHECK: {{^}}3: "file_name_macro_include.h"
|
|
37 // CHECK: {{^}}4: "file_name_macro_include.h"
|
|
38 // CHECK-NOT: {{^}}5: "file_name_macro_include.h"
|
|
39 // CHECK-MS: {{^}}5: "file_name_macro_include.h"
|
|
40 // CHECK: {{^}}6: "h"
|
|
41 // CHECK-MS: {{^}}7: "hdr1.h"
|
|
42 // CHECK-MS: {{^}}8: "hdr2.h"
|
|
43
|
|
44 #endif
|