blob: 02fcbf34b1b85cf34e4195fc33a8d2a575eb03fd [file] [log] [blame]
David Blaikiecebc6232013-03-13 18:46:281// This test case checks debug info during register moves for an argument.
2// RUN: %clang -arch x86_64 -mllvm -fast-isel=false %s -c -o %t.o
3// RUN: %clang -arch x86_64 %t.o -o %t.out
4// RUN: %test_debuginfo %s %t.out
5//
6// Radar 8412415
7
8struct _mtx
9{
10 long unsigned int ptr;
11 int waiters;
12 struct {
13 int tag;
14 int pad;
15 } mtxi;
16};
17
18
19int foobar(struct _mtx *mutex) {
20 int r = 1;
21 int l = 0;
22 int j = 0;
23 do {
24 if (mutex->waiters) {
25 r = 2;
26 }
27 j = bar(r, l);
28 ++l;
29 } while (l < j);
30 return r + j;
31}
32
33int bar(int i, int j) {
34 return i + j;
35}
36
37int main() {
38 struct _mtx m;
39 m.waiters = 0;
40 return foobar(&m);
41}