• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=/var/empty %s -emit-llvm -o - | FileCheck %s -check-prefix CHECK-NO-MAIN-FILE-NAME
2 // RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=/var=empty %s -emit-llvm -o - | FileCheck %s -check-prefix CHECK-EVIL
3 // RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=/var/empty %s -emit-llvm -o - -main-file-name debug-prefix-map.c | FileCheck %s
4 // RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=/var/empty %s -emit-llvm -o - -fdebug-compilation-dir %p | FileCheck %s -check-prefix CHECK-COMPILATION-DIR
5 
6 #include "Inputs/stdio.h"
7 
main(int argc,char ** argv)8 int main(int argc, char **argv) {
9   (void)argc;
10   (void)argv;
11   return 0;
12 }
13 
test_rewrite_includes()14 void test_rewrite_includes() {
15   __builtin_va_list argp;
16   vprintf("string", argp);
17 }
18 
19 // CHECK-NO-MAIN-FILE-NAME: !DIFile(filename: "/var/empty{{/|\\5C}}<stdin>"
20 // CHECK-NO-MAIN-FILE-NAME: !DIFile(filename: "/var/empty{{[/\\]}}{{.*}}"
21 // CHECK-NO-MAIN-FILE-NAME: !DIFile(filename: "/var/empty{{[/\\]}}Inputs/stdio.h"
22 // CHECK-NO-MAIN-FILE-NAME-NOT: !DIFile(filename:
23 
24 // CHECK-EVIL: !DIFile(filename: "/var=empty{{[/\\]}}{{.*}}"
25 // CHECK-EVIL: !DIFile(filename: "/var=empty{{[/\\]}}Inputs/stdio.h"
26 // CHECK-EVIL-NOT: !DIFile(filename:
27 
28 // CHECK: !DIFile(filename: "/var/empty{{[/\\]}}{{.*}}"
29 // CHECK: !DIFile(filename: "/var/empty{{[/\\]}}Inputs/stdio.h"
30 // CHECK-NOT: !DIFile(filename:
31 
32 // CHECK-COMPILATION-DIR: !DIFile(filename: "/var/empty{{[/\\]}}{{.*}}", directory: "/var/empty")
33 // CHECK-COMPILATION-DIR: !DIFile(filename: "/var/empty{{[/\\]}}Inputs/stdio.h", directory: "/var/empty")
34 // CHECK-COMPILATION-DIR-NOT: !DIFile(filename:
35