This allows the PC to be directly changed to a different line. It's similar to the example python script in examples/python/jump.py, except implemented as a builtin. Also this version will track the current function correctly even if the target line resolves to multiple addresses. (e.g. debugging a templated function) llvm-svn: 190572
35 lines
701 B
C++
35 lines
701 B
C++
//===-- main.cpp ------------------------------------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// This test verifies the correct handling of program counter jumps.
|
|
|
|
int otherfn();
|
|
|
|
template<typename T>
|
|
T min(T a, T b)
|
|
{
|
|
if (a < b)
|
|
{
|
|
return a; // 1st marker
|
|
} else {
|
|
return b; // 2nd marker
|
|
}
|
|
}
|
|
|
|
int main ()
|
|
{
|
|
int i;
|
|
double j;
|
|
|
|
i = min(4, 5); // 3rd marker
|
|
j = min(7.0, 8.0); // 4th marker
|
|
|
|
return 0;
|
|
}
|