# Make sure however we entered a syscall, we know the calling module name.
# the task finder vma tracker should have recorded it.

set test "vma_vdso"

# Expect the following three syscalls
set ::result_string {clock_gettime
getuid
getuid}

for {set i 0} {$i < [arch_compile_flags]} {incr i} {
    set arch_flag [arch_compile_flag $i]
    set arch_name [arch_compile_flag_name $i]
    verbose "testing $test -${arch_name}"
    set test_arch "${test}-${arch_name}"

    set test_flags "additional_flags=-g"
    set test_flags "$test_flags additional_flags=-lrt"

    if {$arch_flag != ""} {
        set test_flags "$test_flags $arch_flag"
    }

    set res [target_compile $srcdir/$subdir/$test.c ${test_arch}.exe executable "$test_flags"]
    if { $res != "" } {
        verbose "target_compile ${test_arch} failed: $res" 2
        fail "${test}.c compile -${arch_name}"
        untested "${test_arch}"
        return
    } else {
        pass "${test}.c compile -${arch_name}"
    }

    # Test only when we are running an install test (can execute)
    if {[installtest_p]} {
        stap_run3 ${test_arch} $srcdir/$subdir/$test.stp -c ./${test_arch}.exe
    } else {
        untested "${test_arch}"
    }
}
