62 lines · plain
1## Does not work on windows (yet?) PDB debug-info likely does something wrong2## with the header files.3# XFAIL: target-windows4 5## Test that `list header.h:<line>` works correctly when header is available.6##7# RUN: split-file %s %t8 9# RUN: %clangxx_host -g %t/main_with_inlined.cc %t/foo.cc -o %t/main_with_inlined.out10# RUN: %clangxx_host -g %t/main_no_inlined.cc %t/foo.cc -o %t/main_no_inlined.out11 12# RUN: %lldb %t/main_with_inlined.out -o "list foo.h:2" -o "exit" 2>&1 \13# RUN: | FileCheck %s --check-prefix=CHECK-INLINED14 15## Would be nice if this listed the header too - but probably not something16## we want to support right now.17# RUN: echo quit | %lldb %t/main_no_inlined.out -o "list foo.h:2" -o "exit" 2>&1 \18# RUN: | FileCheck %s --check-prefix=CHECK-NO-INLINED19 20# CHECK-INLINED: 2 extern int* ptr;21# CHECK-INLINED: 3 void f(int x);22# CHECK-INLINED: 423# CHECK-INLINED: 5 inline void g(int x) {24# CHECK-INLINED: 6 *ptr = x; // should crash here25# CHECK-INLINED: 7 }26 27# CHECK-NO-INLINED: error: Could not find source file "foo.h".28 29#--- foo.h30// foo.h31extern int* ptr;32void f(int x);33 34inline void g(int x) {35 *ptr = x; // should crash here36}37 38#--- foo.cc39#include "foo.h"40 41int* ptr;42 43void f(int x) {44 *ptr = x;45}46 47#--- main_with_inlined.cc48#include "foo.h"49 50int main() {51 g(123); // Call the inlined function52 return 0;53}54 55#--- main_no_inlined.cc56#include "foo.h"57 58int main() {59 f(234);60 return 0;61}62