David Blaikie | cebc623 | 2013-03-13 18:46:28 +0000 | [diff] [blame] | 1 | // This test case checks debug info during register moves for an argument. |
Filipe Cabecinhas | 090a237 | 2014-10-18 23:47:59 +0000 | [diff] [blame] | 2 | // RUN: %clang %target_itanium_abi_host_triple -arch x86_64 -mllvm -fast-isel=false %s -c -o %t.o |
| 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 +0000 | [diff] [blame] | 4 | // RUN: %test_debuginfo %s %t.out |
| 5 | // |
| 6 | // Radar 8412415 |
| 7 | |
| 8 | struct _mtx |
| 9 | { |
| 10 | long unsigned int ptr; |
| 11 | int waiters; |
| 12 | struct { |
| 13 | int tag; |
| 14 | int pad; |
| 15 | } mtxi; |
| 16 | }; |
| 17 | |
| 18 | |
| 19 | int 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 | |
| 33 | int bar(int i, int j) { |
| 34 | return i + j; |
| 35 | } |
| 36 | |
| 37 | int main() { |
| 38 | struct _mtx m; |
| 39 | m.waiters = 0; |
| 40 | return foobar(&m); |
| 41 | } |