-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modifications from patch: 1. Since PR #737, it is no longer a flagged error to give the name of a local variable from stdlib to a global variable in user program. 2. Test tree flattened 3. Change calls to println into print Authored-by: Skye Aubrey <[email protected]> Co-authored-by: Martin Ogden <[email protected]> Committed-by: Luc Maranget <[email protected]> Committed-by: Hadrien Renaud <[email protected]> WIP [asl] Fix tests to remove println [asl] Fix tests to remove strange sed calls [asl] Fixup some tests
- Loading branch information
1 parent
4fbccd1
commit a51be7b
Showing
558 changed files
with
9,569 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
var _a: integer; | ||
|
||
getter a[index: integer] => integer | ||
begin | ||
return _a; | ||
end | ||
|
||
setter a[index: integer] = value: integer | ||
begin | ||
_a = value; | ||
return; | ||
end | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
func main() => integer | ||
begin | ||
var a: integer = 10; | ||
a = 4; | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
func main() => integer | ||
begin | ||
var a : integer = 100; | ||
var b : bits(1) = '0'; | ||
var c : integer{2, 16} = 16; | ||
var d : bits({2, 16}) = '00'; | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// RUN: not interp %s | FileCheck %s | ||
|
||
type a of integer; | ||
type b of a; | ||
|
||
func testa(aa: a) | ||
begin | ||
pass; | ||
end | ||
|
||
func testa(bb: b) | ||
begin | ||
pass; | ||
end | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
func underconstrained(N: integer{}) => bits(N) | ||
begin | ||
return Zeros(N); | ||
end | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
func fixedanddetermined() => bits(10) | ||
begin | ||
return Zeros(10); | ||
end | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
var counter: integer = 0; | ||
config width = 10; | ||
|
||
func nonexecution(a: integer) => integer | ||
begin | ||
return 10; | ||
end | ||
|
||
func execution(a: integer) => integer | ||
begin | ||
counter = counter + a; | ||
return counter; | ||
end | ||
|
||
func bitsfunc{N: integer}(a: bits(N)) => integer | ||
begin | ||
return 10; | ||
end | ||
|
||
func main() => integer | ||
begin | ||
let a = execution(10); | ||
var t = 10; | ||
let b = nonexecution(t); | ||
let c = nonexecution(execution(10)); | ||
var tt = Zeros(width); | ||
let d = bitsfunc(tt); | ||
|
||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
func test(a: integer) => integer | ||
begin | ||
return a; | ||
end | ||
|
||
func main() => integer | ||
begin | ||
var a = test(10); | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// RUN: interp %s | FileCheck %s | ||
// CHECK: 3.141590e+0 | ||
|
||
func main() => integer | ||
begin | ||
var a: real = 3.14159; | ||
print(a); | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
var counter: integer = 10; | ||
|
||
func storage() => integer | ||
begin | ||
return counter; | ||
end | ||
|
||
func expression_func() | ||
begin | ||
counter = counter + 1; | ||
end | ||
|
||
func function() => integer | ||
begin | ||
expression_func(); | ||
return storage(); | ||
end | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
constant x: integer = 10; | ||
constant y: integer = x; | ||
constant z: integer = x + y; | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
type a of array[10] of integer; | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
type T1 of integer; // the named type `T1` whose structure is integer | ||
type T2 of (integer, T1); // the named type `T2` whose structure is (integer, integer) | ||
// Note that (integer, T1) is non-primitive since it uses T1 | ||
var x: T1; | ||
// the type of x is the named (hence non-primitive) type `T1` | ||
// whose structure is `integer` | ||
var y: integer; | ||
// the type of y is the anonymous primitive type `integer` | ||
var z: (integer, T1); | ||
// the type of z is the anonymous non-primitive type `(integer, T1)` | ||
// whose structure is `(integer, integer)` | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
func main() => integer | ||
begin | ||
let a = 10; | ||
var b = 10; | ||
|
||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// RUN: interp %s | FileCheck %s | ||
// CHECK: 10 | ||
|
||
type a of exception{ | ||
aa: integer | ||
}; | ||
|
||
func main() => integer | ||
begin | ||
try | ||
throw a { | ||
aa=10 | ||
}; | ||
catch | ||
when aa : a => print(aa.aa); | ||
end | ||
|
||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
var a: integer = 10; | ||
|
||
func test() | ||
begin | ||
a = a + 10; | ||
end | ||
|
||
type ty_test of array[10] of integer; | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
func a() => integer | ||
begin | ||
return 10; | ||
end | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
type nonprimitive of integer; | ||
type nonprimitive_a subtypes nonprimitive; | ||
var primitive: integer; | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
// ! Nothing to test here | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
let x: integer = 10; | ||
let y: integer = 10; | ||
let z: integer = x + y + 10; | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
func a() | ||
begin | ||
return; | ||
end | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
func execType(wid: integer{}) | ||
begin | ||
// structure of R's type depends on execution time value `wid` | ||
var R: bits(wid); | ||
end | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
// ! Nothing to test here | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// RUN: interp %s | FileCheck %s | ||
// CHECK: 10 | ||
|
||
type a of exception{ | ||
aa: integer | ||
}; | ||
|
||
func main() => integer | ||
begin | ||
try | ||
throw a { | ||
aa=10 | ||
}; | ||
catch | ||
when aa : a => print(aa.aa); | ||
end | ||
|
||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
// ! Nothing to test here | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
// ! Nothing to test | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// RUN: interp %s | FileCheck %s | ||
|
||
func localassigns() | ||
begin | ||
var a = 0; | ||
var b = 0; | ||
end | ||
|
||
func compiletimeexpressions() | ||
begin | ||
var a = 0 + 0 + 0 + 0 + 0; | ||
end | ||
|
||
func compiletimecalls() | ||
begin | ||
localassigns(); | ||
end | ||
|
||
func main() => integer | ||
begin | ||
return 0; | ||
end |
Oops, something went wrong.