global found1 = 0
global found2 = 0

probe begin {
  printf("BEGIN\n")
}

probe process("a.out").function("main").return {
  a = @var("a"); a0 = @entry(@var("a"))
  printf("main(): a, @entry(a) = %d, %d\n", a, a0)
  if (a == 5 && a0 == 3) found1 = 1
}

probe process("a.out").function("foo").return {
  a = @var("a"); a0 = @entry(@var("a"))
  printf("foo(): a, @entry(a) = %d, %d\n", a, a0)
  if (a == 5 && a0 == 4) found2 = 1
}

probe end {
  if (found1 && found2)
    printf("END PASS\n")
  else
    printf("END FAIL\n")
}
