From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/go.test/test/bench/timing.sh | 196 +++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100755 gcc/testsuite/go.test/test/bench/timing.sh (limited to 'gcc/testsuite/go.test/test/bench/timing.sh') diff --git a/gcc/testsuite/go.test/test/bench/timing.sh b/gcc/testsuite/go.test/test/bench/timing.sh new file mode 100755 index 000000000..c52c0af94 --- /dev/null +++ b/gcc/testsuite/go.test/test/bench/timing.sh @@ -0,0 +1,196 @@ +#!/usr/bin/env bash +# Copyright 2009 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +set -e + +eval $(gomake --no-print-directory -f ../../src/Make.inc go-env) +PATH=.:$PATH + +mode=run +case X"$1" in +X-test) + mode=test + shift +esac + +gc() { + $GC $1.go; $LD $1.$O +} + +gc_B() { + $GC -B $1.go; $LD $1.$O +} + +runonly() { + if [ $mode = run ] + then + "$@" + fi +} + + + +run() { + if [ $mode = test ] + then + if echo $1 | grep -q '^gc ' + then + $1 # compile the program + program=$(echo $1 | sed 's/gc //') + shift + echo $program + $1 /tmp/$$ + case $program in + chameneosredux) + # exact numbers may vary but non-numbers should match + grep -v '[0-9]' /tmp/$$ > /tmp/$$x + grep -v '[0-9]' chameneosredux.txt > /tmp/$$y + cmp /tmp/$$x /tmp/$$y + rm -f /tmp/$$ /tmp/$$x /tmp/$$y + ;; + *) + cmp /tmp/$$ $program.txt + rm -f /tmp/$$ + esac + fi + return + fi + echo -n ' '$1' ' + $1 + shift + + echo $((time -p $* >/dev/null) 2>&1) | awk '{print $4 "u " $6 "s " $2 "r"}' +} + +fasta() { + runonly echo 'fasta -n 25000000' + run 'gcc -O2 fasta.c' a.out 25000000 + #run 'gccgo -O2 fasta.go' a.out -n 25000000 #commented out until WriteString is in bufio + run 'gc fasta' $O.out -n 25000000 + run 'gc_B fasta' $O.out -n 25000000 +} + +revcomp() { + runonly gcc -O2 fasta.c + runonly a.out 25000000 > x + runonly echo 'reverse-complement < output-of-fasta-25000000' + run 'gcc -O2 reverse-complement.c' a.out < x + run 'gccgo -O2 reverse-complement.go' a.out < x + run 'gc reverse-complement' $O.out < x + run 'gc_B reverse-complement' $O.out < x + rm x +} + +nbody() { + runonly echo 'nbody -n 50000000' + run 'gcc -O2 nbody.c' a.out 50000000 + run 'gccgo -O2 nbody.go' a.out -n 50000000 + run 'gc nbody' $O.out -n 50000000 + run 'gc_B nbody' $O.out -n 50000000 +} + +binarytree() { + runonly echo 'binary-tree 15 # too slow to use 20' + run 'gcc -O2 binary-tree.c -lm' a.out 15 + run 'gccgo -O2 binary-tree.go' a.out -n 15 + run 'gccgo -O2 binary-tree-freelist.go' $O.out -n 15 + run 'gc binary-tree' $O.out -n 15 + run 'gc binary-tree-freelist' $O.out -n 15 +} + +fannkuch() { + runonly echo 'fannkuch 12' + run 'gcc -O2 fannkuch.c' a.out 12 + run 'gccgo -O2 fannkuch.go' a.out -n 12 + run 'gccgo -O2 fannkuch-parallel.go' a.out -n 12 + run 'gc fannkuch' $O.out -n 12 + run 'gc fannkuch-parallel' $O.out -n 12 + run 'gc_B fannkuch' $O.out -n 12 +} + +regexdna() { + runonly gcc -O2 fasta.c + runonly a.out 100000 > x + runonly echo 'regex-dna 100000' + run 'gcc -O2 regex-dna.c -lpcre' a.out x # should be using 25000000 + runonly echo 'k-nucleotide 1000000' + run 'gcc -O2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include k-nucleotide.c -lglib-2.0' a.out