Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/sdt_va_args.exp

raw
1 set test "sdt_va_args"
2 set ::result_string {_
3 1
4 1 2
5 1 2 3
6 1 2 3 4
7 1 2 3 4 5
8 1 2 3 4 5 6
9 1 2 3 4 5 6 7
10 1 2 3 4 5 6 7 8
11 1 2 3 4 5 6 7 8 9
12 1 2 3 4 5 6 7 8 9 10
13 1 2 3 4 5 6 7 8 9 10 11
14 1 2 3 4 5 6 7 8 9 10 11 12}
15
16 set extra_flags {
17 {}
18 {additional_flags=-std=c89}
19 {additional_flags=-std=c99}
20 {additional_flags=-std=gnu99}
21 {c++ additional_flags=-std=c++98 additional_flags=-x additional_flags=c++}
22 {c++ additional_flags=-std=gnu++98 additional_flags=-x additional_flags=c++}
23 {c++ additional_flags=-std=c++0x additional_flags=-x additional_flags=c++}
24 {c++ additional_flags=-std=gnu++0x additional_flags=-x additional_flags=c++}
25 }
26 set extra_mssgs {base c89 c99 gnu99 c++98 gnu++98 c++0x gnu++0x}
27
28 # Iterate extra_flags, trying each with C and C++
29 for {set i 0} {$i < [llength $extra_flags]} {incr i} {
30 set extra_flag [lindex $extra_flags $i]
31 set extra_mssg [lindex $extra_mssgs $i]
32 set testprog "$test.c.exe.$i"
33
34 set test_flags "additional_flags=-g"
35 set test_flags "$test_flags [sdt_includes]"
36 set test_flags "$test_flags additional_flags=-Wall"
37 set test_flags "$test_flags additional_flags=-Wextra"
38 set test_flags "$test_flags additional_flags=-Werror"
39
40 set saveidx 0
41
42 set res [target_compile $srcdir/$subdir/$test.c $testprog executable "$test_flags $extra_flag"]
43 if { $res != "" } {
44 verbose "target_compile failed: $res" 2
45 # -std=gnu++0x and -std=c++0x are not universally accepted
46 if {[string first "unrecognized command line option" $res] == -1} {
47 fail "compiling $test.c $extra_mssg"
48 } else {
49 untested "compiling $test.c $extra_mssg"
50 }
51 untested "$test $extra_mssg"
52 continue
53 } else {
54 pass "compiling $test.c $extra_mssg"
55 }
56
57 if {[installtest_p]} {
58 foreach runtime [get_runtime_list] {
59 if {$runtime != ""} {
60 stap_run3 "$test $extra_mssg ($runtime)" \
61 --runtime=$runtime -w $srcdir/$subdir/sdt.stp \
62 $testprog -c ./$testprog
63 } elseif {[uprobes_p]} {
64 stap_run3 "$test $extra_mssg" -w $srcdir/$subdir/sdt.stp \
65 $testprog -c ./$testprog
66 } else {
67 untested "$test $extra_mssg"
68 }
69 }
70 } else {
71 untested "$test $extra_mssg"
72 }
73 catch {exec rm -f $testprog}
74
75 } ; # for {set i 0} {$i < [llength $extra_flags]}
76