Commit 9eebfe6c authored by Ken Thompson's avatar Ken Thompson

types

R=r
OCL=18034
CL=18034
parent 915e809f
......@@ -6,29 +6,29 @@
package main
var b[10] float;
var b[10] float32;
func
main()
{
var a[10] float;
var a[10] float32;
for i:=short(5); i<10; i=i+1 {
a[i] = float(i);
for i:=int16(5); i<10; i=i+1 {
a[i] = float32(i);
}
s1 := float(0);
s1 := float32(0);
for i:=5; i<10; i=i+1 {
s1 = s1 + a[i];
}
if s1 != 35 { panic(s1); }
for i:=short(5); i<10; i=i+1 {
b[i] = float(i);
for i:=int16(5); i<10; i=i+1 {
b[i] = float32(i);
}
s2 := float(0);
s2 := float32(0);
for i:=5; i<10; i=i+1 {
s2 = s2 + b[i];
}
......
......@@ -7,6 +7,7 @@
package main
type vlong int64;
type short int16;
func
main()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment