-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yifan Zhu
committed
Aug 21, 2024
1 parent
fcd3544
commit 4b9fe13
Showing
4 changed files
with
64 additions
and
9 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
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
13 changes: 13 additions & 0 deletions
13
reuse-mlir/test/integration/basic/invalid_projection_index.mlir
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,13 @@ | ||
// RUN: %not %reuse-opt %s 2>&1 | %FileCheck %s | ||
!test = !reuse_ir.composite<!reuse_ir.composite<i32, i32, f128>, i32> | ||
module @test { | ||
func.func @projection(%0: !reuse_ir.rc<!test, nonatomic, nonfreezing>) { | ||
%1 = reuse_ir.borrow %0 : | ||
!reuse_ir.rc<!test, nonatomic, nonfreezing> | ||
-> !reuse_ir.ref<!test, nonfreezing> | ||
// CHECK: error: 'reuse_ir.proj' op cannot project with an out-of-bound index | ||
%2 = reuse_ir.proj %1[114514] : | ||
!reuse_ir.ref<!test, nonfreezing> -> !reuse_ir.ref<!reuse_ir.composite<i32, i32>, nonfreezing> | ||
return | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
reuse-mlir/test/integration/basic/invalid_projection_type.mlir
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,13 @@ | ||
// RUN: %not %reuse-opt %s 2>&1 | %FileCheck %s | ||
!test = !reuse_ir.composite<!reuse_ir.composite<i32, i32, f128>, i32> | ||
module @test { | ||
func.func @projection(%0: !reuse_ir.rc<!test, nonatomic, nonfreezing>) { | ||
%1 = reuse_ir.borrow %0 : | ||
!reuse_ir.rc<!test, nonatomic, nonfreezing> | ||
-> !reuse_ir.ref<!test, nonfreezing> | ||
// CHECK: error: 'reuse_ir.proj' op expected to return a reference to '!reuse_ir.composite<i32, i32, f128>', but found a reference to '!reuse_ir.composite<i32, i32>' | ||
%2 = reuse_ir.proj %1[0] : | ||
!reuse_ir.ref<!test, nonfreezing> -> !reuse_ir.ref<!reuse_ir.composite<i32, i32>, nonfreezing> | ||
return | ||
} | ||
} |