-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UpdateTestChecks] Add EraVM support in update_llc_test_checks.py
Signed-off-by: Vladimir Radosavljevic <[email protected]>
- Loading branch information
1 parent
085a67c
commit 38bb8fb
Showing
4 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/eravm-basic.ll
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,20 @@ | ||
; RUN: llc < %s -mtriple=eravm-unknown-unknown | FileCheck %s | ||
|
||
@val = addrspace(4) global i256 42 | ||
|
||
define void @test1(i256 %rs1) { | ||
%valptr = alloca i256 | ||
%val = load i256, i256 addrspace(4)* @val | ||
%res = add i256 %rs1, %val | ||
store i256 %res, i256* %valptr | ||
ret void | ||
} | ||
|
||
define void @test2(i256 %rs1) { | ||
%valptr = alloca i256 | ||
%destptr = alloca i256 | ||
%val = load i256, i256* %valptr | ||
%res = add i256 %val, %rs1 | ||
store i256 %res, i256* %destptr | ||
ret void | ||
} |
31 changes: 31 additions & 0 deletions
31
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/eravm-basic.ll.expected
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,31 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc < %s -mtriple=eravm-unknown-unknown | FileCheck %s | ||
|
||
@val = addrspace(4) global i256 42 | ||
|
||
define void @test1(i256 %rs1) { | ||
; CHECK-LABEL: test1: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: nop stack+=[1] | ||
; CHECK-NEXT: add @val[0], r1, stack-[1] | ||
; CHECK-NEXT: ret | ||
%valptr = alloca i256 | ||
%val = load i256, i256 addrspace(4)* @val | ||
%res = add i256 %rs1, %val | ||
store i256 %res, i256* %valptr | ||
ret void | ||
} | ||
|
||
define void @test2(i256 %rs1) { | ||
; CHECK-LABEL: test2: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: nop stack+=[2] | ||
; CHECK-NEXT: add stack-[2], r1, stack-[1] | ||
; CHECK-NEXT: ret | ||
%valptr = alloca i256 | ||
%destptr = alloca i256 | ||
%val = load i256, i256* %valptr | ||
%res = add i256 %val, %rs1 | ||
store i256 %res, i256* %destptr | ||
ret void | ||
} |
4 changes: 4 additions & 0 deletions
4
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/eravm-basic.test
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,4 @@ | ||
# REQUIRES: eravm-registered-target | ||
|
||
# RUN: cp -f %S/Inputs/eravm-basic.ll %t.ll && %update_llc_test_checks %t.ll | ||
# RUN: diff -u %S/Inputs/eravm-basic.ll.expected %t.ll |
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