Skip to content

Commit 26c4b1e

Browse files
committed
[CIR] Update and UnXFAIL clang/test/CIR/CodeGen/compound-literal.c
1 parent 5c17a90 commit 26c4b1e

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

clang/test/CIR/CodeGen/compound-literal.c

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
// XFAIL: *
21
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -Wno-unused-value -emit-cir %s -o %t.cir
32
// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
43
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -fno-clangir-call-conv-lowering -Wno-unused-value -emit-llvm %s -o %t.ll
54
// RUN: FileCheck --input-file=%t.ll %s -check-prefix=LLVM
65

7-
86
typedef struct {
97
int *arr;
108
} S;
@@ -76,21 +74,22 @@ void split_large_page(unsigned long addr, pgprot_t prot)
7674
// CIR-LABEL: @split_large_page
7775
// CIR: %[[VAL_2:.*]] = cir.alloca !u64i, !cir.ptr<!u64i>, ["addr", init] {alignment = 8 : i64}
7876
// CIR: %[[VAL_3:.*]] = cir.alloca !rec_pgprot_t, !cir.ptr<!rec_pgprot_t>, ["prot", init] {alignment = 8 : i64}
79-
// CIR: %[[VAL_4:.*]] = cir.alloca !rec_pgprot_t, !cir.ptr<!rec_pgprot_t>, ["tmp"] {alignment = 8 : i64}
8077
// CIR: cir.store{{.*}} {{.*}}, %[[VAL_2]] : !u64i, !cir.ptr<!u64i>
8178
// CIR: cir.store{{.*}} {{.*}}, %[[VAL_3]] : !rec_pgprot_t, !cir.ptr<!rec_pgprot_t>
82-
// CIR: %[[VAL_5:.*]] = cir.load{{.*}} %[[VAL_2]] : !cir.ptr<!u64i>, !u64i
83-
// CIR: %[[VAL_6:.*]] = cir.cast(int_to_bool, %[[VAL_5]] : !u64i), !cir.bool
84-
// CIR: cir.if %[[VAL_6]] {
85-
// CIR: cir.copy %[[VAL_3]] to %[[VAL_4]] : !cir.ptr<!rec_pgprot_t>
86-
// CIR: } else {
87-
// CIR: %[[VAL_7:.*]] = cir.get_member %[[VAL_4]][0] {name = "pgprot"} : !cir.ptr<!rec_pgprot_t> -> !cir.ptr<!u64i>
88-
// CIR: %[[VAL_8:.*]] = cir.const #cir.int<1> : !s32i
89-
// CIR: %[[VAL_9:.*]] = cir.cast(integral, %[[VAL_8]] : !s32i), !u64i
90-
// CIR: cir.store{{.*}} %[[VAL_9]], %[[VAL_7]] : !u64i, !cir.ptr<!u64i>
91-
// CIR: }
92-
// CIR: %[[VAL_10:.*]] = cir.get_member %[[VAL_4]][0] {name = "pgprot"} : !cir.ptr<!rec_pgprot_t> -> !cir.ptr<!u64i>
93-
// CIR: %[[VAL_11:.*]] = cir.load{{.*}} %[[VAL_10]] : !cir.ptr<!u64i>, !u64i
79+
// CIR: {{.*}} = cir.scope {
80+
// CIR: %[[VAL_4:.*]] = cir.alloca !rec_pgprot_t, !cir.ptr<!rec_pgprot_t>, ["ref.tmp0"] {alignment = 8 : i64} loc(#loc64)
81+
// CIR: %[[VAL_5:.*]] = cir.load{{.*}} %[[VAL_2]] : !cir.ptr<!u64i>, !u64i
82+
// CIR: %[[VAL_6:.*]] = cir.cast(int_to_bool, %[[VAL_5]] : !u64i), !cir.bool
83+
// CIR: cir.if %[[VAL_6]] {
84+
// CIR: cir.copy %[[VAL_3]] to %[[VAL_4]] : !cir.ptr<!rec_pgprot_t>
85+
// CIR: } else {
86+
// CIR: %[[VAL_7:.*]] = cir.get_member %[[VAL_4]][0] {name = "pgprot"} : !cir.ptr<!rec_pgprot_t> -> !cir.ptr<!u64i>
87+
// CIR: %[[VAL_8:.*]] = cir.const #cir.int<1> : !s32i
88+
// CIR: %[[VAL_9:.*]] = cir.cast(integral, %[[VAL_8]] : !s32i), !u64i
89+
// CIR: cir.store{{.*}} %[[VAL_9]], %[[VAL_7]] : !u64i, !cir.ptr<!u64i>
90+
// CIR: }
91+
// CIR: %[[VAL_10:.*]] = cir.get_member %[[VAL_4]][0] {name = "pgprot"} : !cir.ptr<!rec_pgprot_t> -> !cir.ptr<!u64i>
92+
// CIR: %[[VAL_11:.*]] = cir.load{{.*}} %[[VAL_10]] : !cir.ptr<!u64i>, !u64i
9493
// CIR: cir.return
9594
// CIR: }
9695

0 commit comments

Comments
 (0)