2013-03-14 02:46:28 +08:00
|
|
|
// This test case checks debug info during register moves for an argument.
|
2017-04-07 01:59:50 +08:00
|
|
|
// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 -mllvm -fast-isel=false %s -c -o %t.o -g
|
2014-10-19 07:47:59 +08:00
|
|
|
// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 %t.o -o %t.out
|
2013-03-14 02:46:28 +08:00
|
|
|
// RUN: %test_debuginfo %s %t.out
|
|
|
|
//
|
2017-04-07 01:59:50 +08:00
|
|
|
// DEBUGGER: break 26
|
|
|
|
// DEBUGGER: r
|
|
|
|
// DEBUGGER: print mutex
|
|
|
|
// CHECK: ={{.*}} 0x0
|
|
|
|
//
|
2013-03-14 02:46:28 +08:00
|
|
|
// Radar 8412415
|
|
|
|
|
|
|
|
struct _mtx
|
|
|
|
{
|
|
|
|
long unsigned int ptr;
|
|
|
|
int waiters;
|
|
|
|
struct {
|
|
|
|
int tag;
|
|
|
|
int pad;
|
|
|
|
} mtxi;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int foobar(struct _mtx *mutex) {
|
|
|
|
int r = 1;
|
|
|
|
int l = 0;
|
|
|
|
int j = 0;
|
|
|
|
do {
|
|
|
|
if (mutex->waiters) {
|
|
|
|
r = 2;
|
|
|
|
}
|
|
|
|
j = bar(r, l);
|
|
|
|
++l;
|
|
|
|
} while (l < j);
|
|
|
|
return r + j;
|
|
|
|
}
|
|
|
|
|
|
|
|
int bar(int i, int j) {
|
|
|
|
return i + j;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
struct _mtx m;
|
|
|
|
m.waiters = 0;
|
|
|
|
return foobar(&m);
|
|
|
|
}
|