File: externs.exp

package info (click to toggle)
ghdl 0.26%2Bsvn98%2Bgcc4.1.2~dfsg-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 93,808 kB
  • ctags: 63,866
  • sloc: ansic: 645,601; ada: 91,832; makefile: 36,755; asm: 23,240; sh: 16,722; cpp: 3,121; perl: 685; yacc: 593; lex: 589; awk: 586; exp: 526; pascal: 86; lisp: 59
file content (40 lines) | stat: -rw-r--r-- 1,601 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
libmudflap-init c
dg-init

global srcdir subdir

foreach flags [list {} {-static} {-O2} {-O3}] {
    set l1 [libmudflap_target_compile "$srcdir/$subdir/externs-1.c" "externs-1.o" object {additional_flags=-fmudflap}]
    set test "externs-1 compilation ${flags}"
    if [string match "*mudflap cannot track unknown size extern *d*" $l1] { pass $test } { fail $test }

    set l2 [libmudflap_target_compile "$srcdir/$subdir/externs-2.c" "externs-2.o" object {additional_flags=-fmudflap}]
    set test "externs-2 compilation ${flags}"
    if [string match "" $l2]  { pass $test } { fail $test }

    set l3 [libmudflap_target_compile "externs-1.o externs-2.o" "externs-12.exe" executable {additional_flags=-fmudflap additional_flags=-lmudflap}]
    set test "externs-12 linkage ${flags}"
    if [string match "" $l3]  { pass $test } { fail $test }

    set l4 [libmudflap_target_compile "externs-2.o externs-1.o" "externs-21.exe" executable {additional_flags=-fmudflap additional_flags=-lmudflap}]
    set test "externs-21 linkage ${flags}"
    if [string match "" $l3]  { pass $test } { fail $test }

    setenv MUDFLAP_OPTIONS "-viol-segv"

    remote_spawn host "./externs-12.exe"
    set l5 [remote_wait host 10]
    set test "externs-12 execution ${flags}"
    if {[lindex $l5 0] == 0}  { pass $test } { fail $test }

    remote_spawn host "./externs-21.exe"
    set l6 [remote_wait host 10]
    set test "externs-21 execution ${flags}"
    if {[lindex $l6 0] == 0}  { pass $test } { fail $test }

    foreach f [glob -nocomplain "externs-*"] {
       remote_file build delete $f
    }
}

dg-finish