Skip to content

Commit

Permalink
[CIR][NFC] remove redundant test in CIR/IR/data-member-ptr.cir (llvm#582
Browse files Browse the repository at this point in the history
)

As suggested in llvm#401, this PR removes the `get_global_member` test in
`CIR/IR/data-member-ptr.cir` as it is redundant.

The original comment:
llvm/clangir#401 (comment)
  • Loading branch information
Lancern authored and lanza committed Jun 20, 2024
1 parent 9d546ee commit 95de0e3
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions clang/test/CIR/IR/data-member-ptr.cir
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
!s32i = !cir.int<s, 32>
!ty_22Foo22 = !cir.struct<struct "Foo" {!s32i}>

#global_ptr = #cir.data_member<0> : !cir.data_member<!s32i in !ty_22Foo22>

module {
cir.func @null_member() {
%0 = cir.const #cir.data_member<null> : !cir.data_member<!s32i in !ty_22Foo22>
Expand All @@ -16,12 +14,6 @@ module {
%1 = cir.get_runtime_member %arg0[%0 : !cir.data_member<!s32i in !ty_22Foo22>] : !cir.ptr<!ty_22Foo22> -> !cir.ptr<!s32i>
cir.return
}

cir.func @get_global_member(%arg0: !cir.ptr<!ty_22Foo22>) {
%0 = cir.const #global_ptr
%1 = cir.get_runtime_member %arg0[%0 : !cir.data_member<!s32i in !ty_22Foo22>] : !cir.ptr<!ty_22Foo22> -> !cir.ptr<!s32i>
cir.return
}
}

// CHECK: module {
Expand All @@ -37,10 +29,4 @@ module {
// CHECK-NEXT: cir.return
// CHECK-NEXT: }

// CHECK-NEXT: cir.func @get_global_member(%arg0: !cir.ptr<!ty_22Foo22>) {
// CHECK-NEXT: %0 = cir.const #cir.data_member<0> : !cir.data_member<!s32i in !ty_22Foo22>
// CHECK-NEXT: %1 = cir.get_runtime_member %arg0[%0 : !cir.data_member<!s32i in !ty_22Foo22>] : !cir.ptr<!ty_22Foo22> -> !cir.ptr<!s32i>
// CHECK-NEXT: cir.return
// CHECK-NEXT: }

// CHECK: }

0 comments on commit 95de0e3

Please sign in to comment.