1 // UNSUPPORTED: system-windows
2 // RUN: %clang -E -ffile-prefix-map=%p=/UNLIKELY_PATH/empty -c -o - %s | FileCheck %s
3 // RUN: %clang -E -fmacro-prefix-map=%p=/UNLIKELY_PATH/empty -c -o - %s | FileCheck %s
4 // RUN: %clang -E -fmacro-prefix-map=%p=/UNLIKELY_PATH=empty -c -o - %s | FileCheck %s -check-prefix CHECK-EVIL
5 // RUN: %clang -E -fmacro-prefix-map=%p/= -c -o - %s | FileCheck %s --check-prefix CHECK-REMOVE
6 // RUN: %clang -E -fno-file-reproducible -fmacro-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-REMOVE
7 // RUN: %clang -E -fno-file-reproducible -ffile-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-REMOVE
8 // RUN: %clang -E -fmacro-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS
9 // RUN: %clang -E -ffile-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS
10 // RUN: %clang -E -ffile-reproducible -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS-REPRODUCIBLE
11 // RUN: %clang -E -ffile-reproducible -target x86_64-pc-linux-gnu -c -o - %s | FileCheck %s --check-prefix CHECK-LINUX-REPRODUCIBLE
13 /// Clang-format wants to do something unreasonable to this file.
18 /// This line tests that the __FILE__ in included header is canonicalized
19 /// (has "./" removed).
20 #include "./Inputs/./include-file-test/file_test.h"
22 // CHECK: filename: "/UNLIKELY_PATH/empty/file_test.c"
23 // CHECK: filename: "/UNLIKELY_PATH/empty/Inputs/include-file-test/file_test.h"
24 // CHECK: basefile: "/UNLIKELY_PATH/empty/file_test.c"
25 // CHECK-NOT: filename:
27 // CHECK-EVIL: filename: "/UNLIKELY_PATH=empty/file_test.c"
28 // CHECK-EVIL: filename: "/UNLIKELY_PATH=empty/Inputs/include-file-test/file_test.h"
29 // CHECK-EVIL: basefile: "/UNLIKELY_PATH=empty/file_test.c"
30 // CHECK-EVIL-NOT: filename:
32 // CHECK-REMOVE: filename: "file_test.c"
33 // CHECK-REMOVE: filename: "{{.*}}Inputs/{{.*}}include-file-test/file_test.h"
34 // CHECK-REMOVE: basefile: "file_test.c"
35 // CHECK-REMOVE-NOT: filename:
37 // CHECK-WINDOWS: filename: "file_test.c"
38 // CHECK-WINDOWS: filename: "Inputs\\include-file-test\\file_test.h"
39 // CHECK-WINDOWS: basefile: "file_test.c"
40 // CHECK-WINDOWS-NOT: filename:
42 // CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\file_test.c"
43 // CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\Inputs\\include-file-test\\file_test.h"
44 // CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{.*}}\\file_test.c"
45 // CHECK-WINDOWS-REPRODUCIBLE-NOT: filename:
47 // CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/file_test.c"
48 // CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/Inputs/include-file-test/file_test.h"
49 // CHECK-LINUX-REPRODUCIBLE: basefile: "{{.*}}/file_test.c"
50 // CHECK-LINUX-REPRODUCIBLE-NOT: filename: