blob: c44bfd488037a59be36c0b1c840b0d66e63a4bcb [file] [log] [blame]
David Blaikiecebc6232013-03-13 18:46:281// This test case checks debug info during register moves for an argument.
Adrian Prantl469e1192017-04-06 17:59:502// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 -mllvm -fast-isel=false %s -c -o %t.o -g
Filipe Cabecinhas090a2372014-10-18 23:47:593// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 %t.o -o %t.out
David Blaikiecebc6232013-03-13 18:46:284// RUN: %test_debuginfo %s %t.out
5//
Adrian Prantl469e1192017-04-06 17:59:506// DEBUGGER: break 26
7// DEBUGGER: r
8// DEBUGGER: print mutex
9// CHECK: ={{.*}} 0x0
10//
David Blaikiecebc6232013-03-13 18:46:2811// Radar 8412415
12
13struct _mtx
14{
15 long unsigned int ptr;
16 int waiters;
17 struct {
18 int tag;
19 int pad;
20 } mtxi;
21};
22
23
24int foobar(struct _mtx *mutex) {
25 int r = 1;
26 int l = 0;
27 int j = 0;
28 do {
29 if (mutex->waiters) {
30 r = 2;
31 }
32 j = bar(r, l);
33 ++l;
34 } while (l < j);
35 return r + j;
36}
37
38int bar(int i, int j) {
39 return i + j;
40}
41
42int main() {
43 struct _mtx m;
44 m.waiters = 0;
45 return foobar(&m);
46}