summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/unsorted/dump-noaddr.x
blob: a8174e05c06e6cb9820de88cdfd61a08150e1b04 (plain)
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
# This checks if -fdump-noaddr dumps are done consistently.
proc dump_compare { src options } {
    global srcdir subdir
    global tmpdir

    global torture_with_loops
    set option_list $torture_with_loops
    set dumpbase [file tail $src]

    # loop through all the options
    foreach option $option_list {
	file delete -force dump1
	file mkdir dump1
	c-torture-compile $src "$option $options -dumpbase dump1/$dumpbase -DMASK=1 -x c --param ggc-min-heapsize=1 -fdump-ipa-all -fdump-rtl-all -fdump-tree-all -fdump-noaddr"
	file delete -force dump2
	file mkdir dump2
	c-torture-compile $src "$option $options -dumpbase dump2/$dumpbase -DMASK=2 -x c -fdump-ipa-all -fdump-rtl-all -fdump-tree-all -fdump-noaddr"
	foreach dump1 [lsort [glob -nocomplain dump1/*]] {
	    regsub dump1/ $dump1 dump2/ dump2
	    set dumptail "gcc.c-torture/unsorted/[file tail $dump1]"
	    #puts "$option $dump1"
	    set tmp [ diff "$dump1" "$dump2" ]
	    if { $tmp == 0 } {
		untested "$dumptail, $option comparison"
	    } elseif { $tmp == 1 } {
		pass "$dumptail, $option comparison"
	    } else {
		fail "$dumptail, $option comparison"
	    }
	    #exec diff $dump1 $dump2
	}
    }
    file delete -force dump1
    file delete -force dump2
}

catch {dump_compare $src $options} result
puts $result
verbose result
return 1