David Blaikie | cebc623 | 2013-03-13 18:46:28 | [diff] [blame] | 1 | // This test case checks debug info during register moves for an argument. |
Adrian Prantl | 469e119 | 2017-04-06 17:59:50 | [diff] [blame] | 2 | // RUN: %clang %target_itanium_abi_host_triple -arch x86_64 -mllvm -fast-isel=false %s -c -o %t.o -g |
Filipe Cabecinhas | 090a237 | 2014-10-18 23:47:59 | [diff] [blame] | 3 | // RUN: %clang %target_itanium_abi_host_triple -arch x86_64 %t.o -o %t.out |
David Blaikie | cebc623 | 2013-03-13 18:46:28 | [diff] [blame] | 4 | // RUN: %test_debuginfo %s %t.out |
5 | // | ||||
Adrian Prantl | 469e119 | 2017-04-06 17:59:50 | [diff] [blame] | 6 | // DEBUGGER: break 26 |
7 | // DEBUGGER: r | ||||
8 | // DEBUGGER: print mutex | ||||
9 | // CHECK: ={{.*}} 0x0 | ||||
10 | // | ||||
David Blaikie | cebc623 | 2013-03-13 18:46:28 | [diff] [blame] | 11 | // Radar 8412415 |
12 | |||||
13 | struct _mtx | ||||
14 | { | ||||
15 | long unsigned int ptr; | ||||
16 | int waiters; | ||||
17 | struct { | ||||
18 | int tag; | ||||
19 | int pad; | ||||
20 | } mtxi; | ||||
21 | }; | ||||
22 | |||||
23 | |||||
24 | int 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 | |||||
38 | int bar(int i, int j) { | ||||
39 | return i + j; | ||||
40 | } | ||||
41 | |||||
42 | int main() { | ||||
43 | struct _mtx m; | ||||
44 | m.waiters = 0; | ||||
45 | return foobar(&m); | ||||
46 | } |