Add test case for comparisons on defined types
This commit is contained in:
parent
f595a2e742
commit
7e4abb7bba
|
@ -72,7 +72,8 @@ testString (test,
|
|||
func TestCompare (test *testing.T) {
|
||||
testString (test,
|
||||
`%Bool = type i8
|
||||
define %Bool @main() {
|
||||
%A = type i64
|
||||
define void @main() {
|
||||
0:
|
||||
%1 = alloca i64
|
||||
store i64 32, ptr %1
|
||||
|
@ -86,15 +87,20 @@ define %Bool @main() {
|
|||
store i1 %7, ptr %2
|
||||
%8 = load i64, ptr %1
|
||||
%9 = icmp eq i64 32, %8
|
||||
ret i1 %9
|
||||
store i1 %9, ptr %2
|
||||
%10 = icmp sgt i64 5, 3
|
||||
store i1 %10, ptr %2
|
||||
ret void
|
||||
}
|
||||
`,
|
||||
`
|
||||
[main]:Bool = {
|
||||
A: Int
|
||||
[main] = {
|
||||
x:Int = 32
|
||||
b:Bool = [> x 1]
|
||||
b = [< 0 x 50]
|
||||
[= 32 x]
|
||||
b = [= 32 x]
|
||||
b = [> [~A 5] [~A 3]]
|
||||
}
|
||||
`)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue