File: file_test.c

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (50 lines) | stat: -rw-r--r-- 2,797 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// UNSUPPORTED: system-windows
// RUN: %clang -E -ffile-prefix-map=%p=/UNLIKELY_PATH/empty -c -o - %s | FileCheck %s
// RUN: %clang -E -fmacro-prefix-map=%p=/UNLIKELY_PATH/empty -c -o - %s | FileCheck %s
// RUN: %clang -E -fmacro-prefix-map=%p=/UNLIKELY_PATH=empty -c -o - %s | FileCheck %s -check-prefix CHECK-EVIL
// RUN: %clang -E -fmacro-prefix-map=%p/= -c -o - %s | FileCheck %s --check-prefix CHECK-REMOVE
// RUN: %clang -E -fno-file-reproducible -fmacro-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-REMOVE
// RUN: %clang -E -fno-file-reproducible -ffile-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-REMOVE
// RUN: %clang -E -fmacro-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS
// RUN: %clang -E -ffile-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS
// RUN: %clang -E -ffile-reproducible -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS-REPRODUCIBLE
// RUN: %clang -E -ffile-reproducible -target x86_64-pc-linux-gnu -c -o - %s | FileCheck %s --check-prefix CHECK-LINUX-REPRODUCIBLE

/// Clang-format wants to do something unreasonable to this file.
// clang-format off

filename: __FILE__

/// This line tests that the __FILE__ in included header is canonicalized
/// (has "./" removed).
#include "./Inputs/./include-file-test/file_test.h"

// CHECK: filename: "/UNLIKELY_PATH/empty/file_test.c"
// CHECK: filename: "/UNLIKELY_PATH/empty/Inputs/include-file-test/file_test.h"
// CHECK: basefile: "/UNLIKELY_PATH/empty/file_test.c"
// CHECK-NOT: filename:

// CHECK-EVIL: filename: "/UNLIKELY_PATH=empty/file_test.c"
// CHECK-EVIL: filename: "/UNLIKELY_PATH=empty/Inputs/include-file-test/file_test.h"
// CHECK-EVIL: basefile: "/UNLIKELY_PATH=empty/file_test.c"
// CHECK-EVIL-NOT: filename:

// CHECK-REMOVE: filename: "file_test.c"
// CHECK-REMOVE: filename: "{{.*}}Inputs/{{.*}}include-file-test/file_test.h"
// CHECK-REMOVE: basefile: "file_test.c"
// CHECK-REMOVE-NOT: filename:

// CHECK-WINDOWS: filename: "file_test.c"
// CHECK-WINDOWS: filename: "Inputs\\include-file-test\\file_test.h"
// CHECK-WINDOWS: basefile: "file_test.c"
// CHECK-WINDOWS-NOT: filename:

// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\file_test.c"
// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\Inputs\\include-file-test\\file_test.h"
// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{.*}}\\file_test.c"
// CHECK-WINDOWS-REPRODUCIBLE-NOT: filename:

// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/file_test.c"
// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/Inputs/include-file-test/file_test.h"
// CHECK-LINUX-REPRODUCIBLE: basefile: "{{.*}}/file_test.c"
// CHECK-LINUX-REPRODUCIBLE-NOT: filename: