summaryrefslogtreecommitdiffstats
path: root/testsuite/semko/foreachstmt02.stp
blob: 49eea342da0477e3f7906e10a16c39ec14d0e580 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! stap -p2

# limit keyword with function returning a string expression

global array

function str_ret_type()
{
    return "hi"
}

probe begin
{
    array[0] = 1    
    foreach (key in array limit str_ret_type())
        printf("key %d, value %d\n", key, array[key])
}