# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-rm -f *.6
+. $GOROOT/src/Make.$GOARCH
+
+if [ -z "$O" ]; then
+ echo 'missing $O - maybe no Make.$GOARCH?' 1>&2
+ exit 1
+fi
+
+rm -f *.$O
for i in \
file.go \
; do
BASE=$(basename $i .go)
- 6g $i
+ $GC $i
done
function testit {
- 6l $1.6
- x=$(echo $(./6.out $2 2>&1)) # extra echo canonicalizes
+ $LD $1.$O
+ x=$(echo $(./$O.out $2 2>&1)) # extra echo canonicalizes
if [ "$x" != "$3" ]
then
echo $1 failed: '"'$x'"' is not '"'$3'"'
}
function testitpipe {
- 6l $1.6
- x=$(echo $(./6.out | $2 2>&1)) # extra echo canonicalizes
+ $LD $1.$O
+ x=$(echo $(./$O.out | $2 2>&1)) # extra echo canonicalizes
if [ "$x" != "$3" ]
then
echo $1 failed: '"'$x'"' is not '"'$3'"'
testitpipe sieve "sed 10q" "2 3 5 7 11 13 17 19 23 29"
# server hangs; don't run it, just compile it
-6g server.go
+$GC server.go
testit server1 "" ""
-rm -f 6.out *.6
+rm -f $O.out *.$O
return;
if((int)len != len) {
- fprint(2, "6l: too much pkg data in %s\n", filename);
+ fprint(2, "%s: too much pkg data in %s\n", argv0, filename);
return;
}
data = mal(len+1);
if(Bread(f, data, len) != len) {
- fprint(2, "6l: short pkg read %s\n", filename);
+ fprint(2, "%s: short pkg read %s\n", argv0, filename);
return;
}
data[len] = '\0';
// second marks end of exports / beginning of local data
p1 = strstr(p0, "\n$$");
if(p1 == nil) {
- fprint(2, "6l: cannot find end of exports in %s\n", filename);
+ fprint(2, "%s: cannot find end of exports in %s\n", argv0, filename);
return;
}
while(*p0 == ' ' || *p0 == '\t' || *p0 == '\n')
p0++;
if(strncmp(p0, "package ", 8) != 0) {
- fprint(2, "6l: bad package section in %s\n", filename);
+ fprint(2, "%s: bad package section in %s\n", argv0, filename);
return;
}
p0 += 8;
// local types end at next \n$$.
p1 = strstr(p0, "\n$$");
if(p1 == nil) {
- fprint(2, "6l: cannot find end of local types in %s\n", filename);
+ fprint(2, "%s: cannot find end of local types in %s\n", argv0, filename);
return;
}
x->export = export;
} else {
if(strcmp(x->prefix, prefix) != 0) {
- fprint(2, "6l: conflicting definitions for %s\n", name);
+ fprint(2, "%s: conflicting definitions for %s\n", argv0, name);
fprint(2, "%s:\t%s %s ...\n", x->file, x->prefix, name);
fprint(2, "%s:\t%s %s ...\n", file, prefix, name);
nerrors++;
}
else if(strcmp(x->def, def) != 0) {
- fprint(2, "6l: conflicting definitions for %s\n", name);
+ fprint(2, "%s: conflicting definitions for %s\n", argv0, name);
fprint(2, "%s:\t%s %s %s\n", x->file, x->prefix, name, x->def);
fprint(2, "%s:\t%s %s %s\n", file, prefix, name, def);
nerrors++;
else if(strncmp(p, "const ", 6) == 0)
p += 6;
else{
- fprint(2, "6l: confused in pkg data near <<%.20s>>\n", p);
+ fprint(2, "%s: confused in pkg data near <<%.20s>>\n", argv0, p);
nerrors++;
return -1;
}
// indented we could do something more complicated,
// but for now just diagnose the problem and assume
// 6g will keep indenting for us.
- fprint(2, "6l: %s: expected methods to be indented %p %p %.10s\n",
+ fprint(2, "%s: %s: expected methods to be indented %p %p %.10s\n", argv0,
file, edef, meth, meth);
nerrors++;
return -1;
while(p < ep && *p != '\n')
p++;
if(p >= ep) {
- fprint(2, "6l: lost end of line in method definition\n");
+ fprint(2, "%s: lost end of line in method definition\n", argv0);
*pp = ep;
return -1;
}