Skip to content

Commit bfd18b8

Browse files
committed
Add test for remappings where one is a prefix of another
1 parent 017551a commit bfd18b8

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

clang/test/Index/Store/print-unit-remapped.c

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
void foo(int i);
55

66
// RUN: rm -rf %t
7-
// RUN: %clang_cc1 -I %S/Inputs -isystem %S/Inputs/sys -fdebug-prefix-map=%S=SRC_ROOT -fdebug-prefix-map=$PWD=BUILD_ROOT -index-store-path %t/idx %s -triple x86_64-apple-macosx10.8
7+
// RUN: %clang_cc1 -I %S/Inputs -isystem %S/Inputs/sys -fdebug-prefix-map=%S/Inputs=INPUT_ROOT -fdebug-prefix-map=%S=SRC_ROOT -fdebug-prefix-map=$PWD=BUILD_ROOT -index-store-path %t/idx %s -triple x86_64-apple-macosx10.8
88
// RUN: c-index-test core -print-unit %t/idx | FileCheck --check-prefixes=ABSOLUTE,ALL %s
99

1010
// Relative paths should work as well - the unit name, main-path, and out-file should not change.
@@ -24,15 +24,24 @@ void foo(int i);
2424
// ALL: is-debug: 1
2525
// ALL: DEPEND START
2626
// ALL: Record | user | SRC_ROOT{{/|\\}}print-unit-remapped.c | print-unit-remapped.c-
27-
// ALL: Record | user | SRC_ROOT{{/|\\}}Inputs{{/|\\}}head.h | head.h-
28-
// ALL: Record | user | SRC_ROOT{{/|\\}}Inputs{{/|\\}}using-overlay.h | using-overlay.h-
29-
// ALL: Record | system | SRC_ROOT{{/|\\}}Inputs{{/|\\}}sys{{/|\\}}syshead.h | syshead.h-
30-
// ALL: Record | system | SRC_ROOT{{/|\\}}Inputs{{/|\\}}sys{{/|\\}}another.h | another.h-
31-
// ALL: File | user | SRC_ROOT{{/|\\}}Inputs{{/|\\}}print-unit.h{{$}}
27+
// ABSOLUTE: Record | user | INPUT_ROOT{{/|\\}}head.h | head.h-
28+
// ABSOLUTE: Record | user | INPUT_ROOT{{/|\\}}using-overlay.h | using-overlay.h-
29+
// ABSOLUTE: Record | system | INPUT_ROOT{{/|\\}}sys{{/|\\}}syshead.h | syshead.h-
30+
// ABSOLUTE: Record | system | INPUT_ROOT{{/|\\}}sys{{/|\\}}another.h | another.h-
31+
// ABSOLUTE: File | user | INPUT_ROOT{{/|\\}}print-unit.h{{$}}
32+
// RELATIVE: Record | user | SRC_ROOT{{/|\\}}Inputs{{/|\\}}head.h | head.h-
33+
// RELATIVE: Record | user | SRC_ROOT{{/|\\}}Inputs{{/|\\}}using-overlay.h | using-overlay.h-
34+
// RELATIVE: Record | system | SRC_ROOT{{/|\\}}Inputs{{/|\\}}sys{{/|\\}}syshead.h | syshead.h-
35+
// RELATIVE: Record | system | SRC_ROOT{{/|\\}}Inputs{{/|\\}}sys{{/|\\}}another.h | another.h-
36+
// RELATIVE: File | user | SRC_ROOT{{/|\\}}Inputs{{/|\\}}print-unit.h{{$}}
3237
// ALL: DEPEND END (6)
3338
// ALL: INCLUDE START
34-
// ALL: SRC_ROOT{{/|\\}}print-unit-remapped.c:1 | SRC_ROOT{{/|\\}}Inputs{{/|\\}}print-unit.h
35-
// ALL: SRC_ROOT{{/|\\}}print-unit-remapped.c:2 | SRC_ROOT{{/|\\}}Inputs{{/|\\}}sys{{/|\\}}syshead.h
36-
// ALL: SRC_ROOT{{/|\\}}Inputs{{/|\\}}print-unit.h:1 | SRC_ROOT{{/|\\}}Inputs{{/|\\}}head.h
37-
// ALL: SRC_ROOT{{/|\\}}Inputs{{/|\\}}print-unit.h:2 | SRC_ROOT{{/|\\}}Inputs{{/|\\}}using-overlay.h
39+
// ABSOLUTE: SRC_ROOT{{/|\\}}print-unit-remapped.c:1 | INPUT_ROOT{{/|\\}}print-unit.h
40+
// ABSOLUTE: SRC_ROOT{{/|\\}}print-unit-remapped.c:2 | INPUT_ROOT{{/|\\}}sys{{/|\\}}syshead.h
41+
// ABSOLUTE: INPUT_ROOT{{/|\\}}print-unit.h:1 | INPUT_ROOT{{/|\\}}head.h
42+
// ABSOLUTE: INPUT_ROOT{{/|\\}}print-unit.h:2 | INPUT_ROOT{{/|\\}}using-overlay.h
43+
// RELATIVE: SRC_ROOT{{/|\\}}print-unit-remapped.c:1 | SRC_ROOT{{/|\\}}Inputs{{/|\\}}print-unit.h
44+
// RELATIVE: SRC_ROOT{{/|\\}}print-unit-remapped.c:2 | SRC_ROOT{{/|\\}}Inputs{{/|\\}}sys{{/|\\}}syshead.h
45+
// RELATIVE: SRC_ROOT{{/|\\}}Inputs{{/|\\}}print-unit.h:1 | SRC_ROOT{{/|\\}}Inputs{{/|\\}}head.h
46+
// RELATIVE: SRC_ROOT{{/|\\}}Inputs{{/|\\}}print-unit.h:2 | SRC_ROOT{{/|\\}}Inputs{{/|\\}}using-overlay.h
3847
// ALL: INCLUDE END (4)

0 commit comments

Comments
 (0)