-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CIR][IR] Bypass get_member verifier for incomplete types
Temporary workaround until we patch the codegen for record types.
- Loading branch information
1 parent
5364b31
commit 86d68fd
Showing
3 changed files
with
65 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// RUN: cir-opt %s -o %t.cir | ||
// RUN: FileCheck --input-file=%t.cir %s | ||
|
||
!u16i = !cir.int<u, 16> | ||
!u32i = !cir.int<u, 32> | ||
|
||
!ty_22Class22 = !cir.struct<class "Class" {!u16i, !u32i}> | ||
!ty_22Incomplete22 = !cir.struct<struct "Incomplete" incomplete> | ||
!ty_22Struct22 = !cir.struct<struct "Struct" {!u16i, !u32i}> | ||
|
||
module { | ||
cir.func @shouldGetStructMember(%arg0 : !cir.ptr<!ty_22Struct22>) { | ||
// CHECK: cir.get_member %arg0[1] {name = "test"} : !cir.ptr<!ty_22Struct22> -> !cir.ptr<!u32i> | ||
%0 = cir.get_member %arg0[1] {name = "test"} : !cir.ptr<!ty_22Struct22> -> !cir.ptr<!u32i> | ||
cir.return | ||
} | ||
|
||
// FIXME: remove bypass once codegen for CIR records is patched. | ||
cir.func @shouldBypassMemberIndexCheckForIncompleteRecords(%arg0 : !cir.ptr<!ty_22Incomplete22>) { | ||
// CHECK: cir.get_member %arg0[1] {name = "test"} : !cir.ptr<!ty_22Incomplete22> -> !cir.ptr<!u32i> | ||
%0 = cir.get_member %arg0[1] {name = "test"} : !cir.ptr<!ty_22Incomplete22> -> !cir.ptr<!u32i> | ||
cir.return | ||
} | ||
|
||
// FIXME: remove bypass once codegen for CIR class records is patched. | ||
cir.func @shouldBypassMemberTypeCheckForClassRecords(%arg0 : !cir.ptr<!ty_22Class22>) { | ||
// CHECK: cir.get_member %arg0[1] {name = "test"} : !cir.ptr<!ty_22Class22> -> !cir.ptr<!cir.ptr<!u32i>> | ||
%0 = cir.get_member %arg0[1] {name = "test"} : !cir.ptr<!ty_22Class22> -> !cir.ptr<!cir.ptr<!u32i>> | ||
cir.return | ||
} | ||
} |
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