teak-llvm/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c
Ying Chen d7a2ecb681 Fix TestDebugBreak.py failure with gcc, for loop declarations are not allowed by default with gcc
- fix buildbot breakage after r257186
- move declaration outside of for loop

llvm-svn: 257228
2016-01-08 23:10:56 +00:00

30 lines
428 B
C

#ifdef _MSC_VER
#include <intrin.h>
#define BREAKPOINT_INTRINSIC() __debugbreak()
#else
#define BREAKPOINT_INTRINSIC() __asm__ __volatile__ ("int3")
#endif
int
bar(int const *foo)
{
int count = 0, i = 0;
for (; i < 10; ++i)
{
count += 1;
BREAKPOINT_INTRINSIC();
count += 1;
}
return *foo;
}
int
main(int argc, char **argv)
{
int foo = 42;
bar(&foo);
return 0;
}