annotate clang/test/Preprocessor/file_name_macro.c @ 236:c4bab56944e8 llvm-original

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