summaryrefslogtreecommitdiffstats
path: root/debuginfo-tests/dexter-tests/dbg-arg.c
blob: 7d0ef7b6b70b354662e6fe0ad20c15930a225149 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// REQUIRES: system-linux, lldb
//
// This test case checks debug info during register moves for an argument.
// RUN: %dexter --fail-lt 1.0 -w \
// RUN:     --builder clang-c --debugger 'lldb' \
// RUN:     --cflags "-m64 -mllvm -fast-isel=false -g" -- %s
//
// 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; // DexLabel('l_assign')
  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);
}


/*
DexExpectProgramState({
  'frames': [
    {
      'location': { 'lineno': 'l_assign' },
      'watches': {
        '*mutex': { 'is_irretrievable': False }
      }
    }
  ]
})
*/

OpenPOWER on IntegriCloud