Commit dd449c24 authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Creating release_70 branch off revision 338536

llvm-svn: 338681
parents 63740db5 53617672
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
{
  "conduit_uri" : "https://reviews.llvm.org/"
}
+27 −0
Original line number Diff line number Diff line
# Debug Info tests.  These tests invoke clang to generate programs with
# various types of debug info, and then run those programs under a debugger
# such as GDB or LLDB to verify the results.

set(DEBUGINFO_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(DEBUGINFO_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

set(DEBUGINFO_TEST_DEPS
  clang
  FileCheck
  count
  llvm-objdump
  not
  )

configure_lit_site_cfg(
  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
  MAIN_CONFIG
  ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
  )

add_lit_testsuite(check-debuginfo "Running debug info integration tests"
  ${CMAKE_CURRENT_BINARY_DIR}
  DEPENDS ${DEBUGINFO_TEST_DEPS}
  )
set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests")
+19 −0
Original line number Diff line number Diff line
                                                                   -*- rst -*-
This is a collection of tests to check debugging information generated by 
compiler. This test suite can be checked out inside clang/test folder. This 
will enable 'make test' for clang to pick up these tests. Typically, test 
cases included here includes debugger commands and intended debugger output 
as comments in source file using DEBUGGER: and CHECK: as prefixes respectively.

For example::

  define i32 @f1(i32 %i) nounwind ssp {
  ; DEBUGGER: break f1
  ; DEBUGGER: r
  ; DEBUGGER: p i 
  ; CHECK: $1 = 42 
  entry:
  }

is a testcase where the debugger is asked to break at function 'f1' and 
print value of argument 'i'. The expected value of 'i' is 42 in this case.
+32 −0
Original line number Diff line number Diff line
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out
// RUN: %test_debuginfo %s %t.out 
// Radar 8945514
// DEBUGGER: break 22
// DEBUGGER: r
// DEBUGGER: p v
// CHECK: ${{[0-9]+}} =
// CHECK:  Data ={{.*}} 0x0{{(0*)}}
// CHECK:  Kind = 2142

class SVal {
public:
  ~SVal() {}
  const void* Data;
  unsigned Kind;
};

void bar(SVal &v) {}
class A {
public:
  void foo(SVal v) { bar(v); }
};

int main() {
  SVal v;
  v.Data = 0;
  v.Kind = 2142;
  A a;
  a.foo(v);
  return 0;
}
+24 −0
Original line number Diff line number Diff line
// REQUIRES: system-darwin
// Test that clang produces the __apple accelerator tables,
// e.g., __apple_types, correctly.
// These sections are going to be retired in DWARF 5, so we hardcode
// the DWARF version in the tests.
// RUN: %clang %s %target_itanium_abi_host_triple -gdwarf-2 -O0 -c -g -o %t-ex
// RUN: llvm-objdump -section-headers %t-ex | FileCheck %s
// RUN: %clang %s %target_itanium_abi_host_triple -gdwarf-4 -O0 -c -g -o %t-ex
// RUN: llvm-objdump -section-headers %t-ex | FileCheck %s

// A function in a different section forces the compiler to create the 
// __debug_ranges section.
__attribute__((section("1,__text_foo"))) void foo() {}
int main (int argc, char const *argv[]) { return argc; }

// CHECK: __debug_str
// CHECK-NEXT: __debug_abbrev
// CHECK-NEXT: __debug_info
// CHECK-NEXT: __debug_ranges
// CHECK-NEXT: __debug_macinfo
// CHECK-NEXT: __apple_names
// CHECK-NEXT: __apple_objc
// CHECK-NEXT: __apple_namespac
// CHECK-NEXT: __apple_types
Loading