Debian Codegraph @

testsuite/buildok/stat_insert.stp

raw
1 #! stap -p4
2
3 # test the translatability of the statistic insertion operator
4
5 global loggy
6 global logmap
7 global liney
8 global linemap
9
10 global numbers
11 global strings
12
13 global x, y
14
15 function wibble()
16 {
17 i = 0
18 logmap[i++, "stewed"] <<< 1
19 logmap[i++, "boiled"] <<< 1 + 2
20 logmap[i++, "baked"] <<< (x = 0)
21 logmap[i++, "fried"] <<< (x * (y=2)) + 3
22 }
23
24 function wobble()
25 {
26 foreach (i in numbers)
27 {
28 foreach (j in strings)
29 {
30 linemap[strings[j],2*numbers[i],numbers[2*i]] <<< x * (y + i)
31 }
32 }
33 }
34
35
36 probe end {
37
38 numbers[1] = 2
39 numbers[2] = 5
40 numbers[3] = 98279
41 numbers[4] = 8739287
42
43 strings[1] = "sun"
44 strings[2] = "moon"
45 strings[3] = "saturn"
46 strings[4] = "venus"
47
48 p = 4
49 q = 5
50
51 liney <<< 1
52 liney <<< 1 + 2
53 liney <<< p
54 liney <<< (p * q) + 3
55
56 loggy <<< 1
57 loggy <<< 1 + 2
58 loggy <<< p
59 loggy <<< (p * q) + 3
60
61 wibble()
62 wobble()
63
64 }