#!/usr/bin/env bash

. ../common.sh

init "parsing debug RTL dump from gcc -db for callgraph"

rm -f foo.c.*.bp
compile_c -db foo.c
nn=$(ls foo.c.*.bp 2>/dev/null | wc -l)
if [ $nn != 1 ] ; then
    fail "gcc -db not supported by this version of gcc"
    exit 1
fi

link foo foo.o

run foo 1
run foo 2
run foo 23 423

subtest 1
run_gcov foo.c
run_tggcov foo.c
compare_lines foo.c

subtest 2
run_tggcov -P foo.c
compare_callgraph
