summaryrefslogtreecommitdiff
path: root/lib/msan/lit_tests/wrap_indirect_calls/wrapper.cc
blob: 8fcd0c635d964bc6b0b675a95e3f85a9ab261bcf (plain)
1
2
3
4
5
6
7
8
9
10
11
int f_replaced(int x, int y);
int f_replacement(int x, int y);

int cnt;

extern "C" void *wrapper(void *p) {
  ++cnt;
  if (p == (void *)f_replaced)
    return (void *)f_replacement;
  return p;
}