Home | History | Annotate | Download | only in PCH
      1 // REQUIRES: shell
      2 //
      3 // RUN: rm -rf %t
      4 // RUN: mkdir %t
      5 // RUN: cd %t
      6 //
      7 // ---------------------------------------------------------------------
      8 // Relative PCH, same directory.
      9 // ---------------------------------------------------------------------
     10 //
     11 // RUN: %clang_cc1 -fmodule-format=obj -emit-pch                \
     12 // RUN:     -triple %itanium_abi_triple                         \
     13 // RUN:     -o prefix.pch %S/debug-info-limited-struct.h
     14 //
     15 // RUN: %clang_cc1 -debug-info-kind=standalone                  \
     16 // RUN:     -dwarf-ext-refs -fmodule-format=obj                 \
     17 // RUN:     -triple %itanium_abi_triple                         \
     18 // RUN:     -include-pch prefix.pch %s -emit-llvm -o %t.nodir.ll %s
     19 // RUN: cat %t.nodir.ll | FileCheck %s --check-prefix=CHECK-REL-NODIR
     20 //
     21 //
     22 // CHECK-REL-NODIR: !DICompileUnit
     23 // CHECK-REL-NODIR-SAME:           file: ![[C:[0-9]+]]
     24 // CHECK-REL-NODIR-NOT: dwoId
     25 // CHECK-REL-NODIR: ![[C]] = !DIFile({{.*}}directory: "[[DIR:.*]]"
     26 // CHECK-REL-NODIR: !DICompileUnit(
     27 // CHECK-REL-NODIR-SAME:           file: ![[PCH:[0-9]+]]
     28 // CHECK-REL-NODIR-SAME:           splitDebugFilename: "prefix.pch"
     29 // CHECK-REL-NODIR: ![[PCH]] = !DIFile({{.*}}directory: "[[DIR]]"
     30 
     31 // ---------------------------------------------------------------------
     32 // Relative PCH in a subdirectory.
     33 // ---------------------------------------------------------------------
     34 //
     35 // RUN: mkdir pchdir
     36 // RUN: %clang_cc1 -fmodule-format=obj -emit-pch                \
     37 // RUN:     -triple %itanium_abi_triple                         \
     38 // RUN:     -o pchdir/prefix.pch %S/debug-info-limited-struct.h
     39 //
     40 // RUN: %clang_cc1 -debug-info-kind=standalone                  \
     41 // RUN:     -dwarf-ext-refs -fmodule-format=obj                 \
     42 // RUN:     -triple %itanium_abi_triple                         \
     43 // RUN:     -include-pch pchdir/prefix.pch %s -emit-llvm -o %t.rel.ll %s
     44 // RUN: cat %t.rel.ll | FileCheck %s --check-prefix=CHECK-REL
     45 
     46 // CHECK-REL: !DICompileUnit
     47 // CHECK-REL-SAME:           file: ![[C:[0-9]+]]
     48 // CHECK-REL-NOT: dwoId
     49 // CHECK-REL: ![[C]] = !DIFile({{.*}}directory: "[[DIR:.*]]"
     50 // CHECK-REL: !DICompileUnit(
     51 // CHECK-REL-SAME:           file: ![[PCH:[0-9]+]]
     52 // CHECK-REL-SAME:           splitDebugFilename: "prefix.pch"
     53 // CHECK-REL: ![[PCH]] = !DIFile({{.*}}directory: "[[DIR]]{{.*}}pchdir"
     54 
     55 // ---------------------------------------------------------------------
     56 // Absolute PCH.
     57 // ---------------------------------------------------------------------
     58 //
     59 // RUN: %clang_cc1 -fmodule-format=obj -emit-pch                \
     60 // RUN:     -triple %itanium_abi_triple                         \
     61 // RUN:     -o %t/prefix.pch %S/debug-info-limited-struct.h
     62 //
     63 // RUN: %clang_cc1 -debug-info-kind=standalone                  \
     64 // RUN:     -dwarf-ext-refs -fmodule-format=obj                 \
     65 // RUN:     -triple %itanium_abi_triple                         \
     66 // RUN:     -include-pch %t/prefix.pch %s -emit-llvm -o %t.abs.ll %s
     67 // RUN: cat %t.abs.ll | FileCheck %s --check-prefix=CHECK-ABS
     68 
     69 // CHECK-ABS: !DICompileUnit
     70 // CHECK-ABS-SAME:           file: ![[C:[0-9]+]]
     71 // CHECK-ABS-NOT: dwoId
     72 // CHECK-ABS: ![[C]] = !DIFile({{.*}}directory: "[[DIR:.*]]"
     73 // CHECK-ABS: !DICompileUnit(
     74 // CHECK-ABS-SAME:           file: ![[PCH:[0-9]+]]
     75 // CHECK-ABS-SAME:           splitDebugFilename: "prefix.pch"
     76 // CHECK-ABS: ![[PCH]] = !DIFile({{.*}}directory: "[[DIR]]"
     77