Skip to content

Commit 4e4fb8d

Browse files
authored
[CIR] Make all opt tests verify roundtrip (#1923)
This also fixes GlobalOp roundtrip.
1 parent 3345b32 commit 4e4fb8d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+73
-88
lines changed

clang/include/clang/CIR/Dialect/IR/CIRAttrs.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ def CIR_AddressSpaceAttr : CIR_EnumAttr<CIR_AddressSpace, "address_space"> {
974974
];
975975

976976
let assemblyFormat = [{
977-
`` custom<AddressSpaceValue>($value)
977+
`(` custom<AddressSpaceValue>($value) `)`
978978
}];
979979

980980
let defaultValue = "cir::AddressSpace::Default";

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2544,7 +2544,7 @@ def CIR_GlobalOp : CIR_Op<"global", [
25442544
(`comdat` $comdat^)?
25452545
($tls_model^)?
25462546
(`dso_local` $dso_local^)?
2547-
( `addrspace` `(` $addr_space^ `)` )?
2547+
(`addrspace` `` $addr_space^)?
25482548
$sym_name
25492549
custom<GlobalOpTypeAndInitialValue>($sym_type, $initial_value, $ctorRegion, $dtorRegion)
25502550
($annotations^)?

clang/include/clang/CIR/Dialect/IR/CIRTypes.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def CIR_PointerType : CIR_Type<"Pointer", "ptr", [
256256
let assemblyFormat = [{
257257
`<`
258258
$pointee
259-
( `,` `addrspace` `(` custom<AddressSpaceValue>($addrSpace)^ `)` )?
259+
( `,` `addrspace` `(` `` custom<AddressSpaceValue>($addrSpace)^ `)` )?
260260
`>`
261261
}];
262262

clang/test/CIR/IR/address-space.cir

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// RUN: cir-opt %s -o %t.cir
2-
// RUN: FileCheck --input-file=%t.cir %s
1+
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
32

43
!s32i = !cir.int<s, 32>
54

clang/test/CIR/IR/aliases.cir

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// RUN: cir-opt %s -o %t.cir
2-
// RUN: FileCheck --input-file=%t.cir %s
1+
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
32

43
module {
54
// CHECK: @testAnonRecordsAlias

clang/test/CIR/IR/alloca.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Test the CIR operations can parse and print correctly (roundtrip)
22

3-
// RUN: cir-opt %s | cir-opt | FileCheck %s
3+
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
44
!s32i = !cir.int<s, 32>
55
!u64i = !cir.int<u, 64>
66

clang/test/CIR/IR/annotations.cir

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// RUN: cir-opt %s -o %t.cir
2-
// RUN: FileCheck --input-file=%t.cir %s
1+
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
32

43
!s32i = !cir.int<s, 32>
54
module attributes {cir.global_annotations =

clang/test/CIR/IR/array.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-opt %s | cir-opt | FileCheck %s
1+
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
22

33
!u32i = !cir.int<u, 32>
44

clang/test/CIR/IR/attribute.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-opt %s -split-input-file -allow-unregistered-dialect -verify-diagnostics | FileCheck %s
1+
// RUN: cir-opt %s -split-input-file -allow-unregistered-dialect -verify-diagnostics --verify-roundtrip | FileCheck %s
22

33
cir.func @float_attrs_pass() {
44
"test.float_attrs"() {

clang/test/CIR/IR/await.cir

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// RUN: cir-opt %s -o %t.cir
2-
// RUN: FileCheck --input-file=%t.cir %s
1+
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
32

43
cir.func coroutine @checkPrintParse(%arg0 : !cir.bool) {
54
cir.await(user, ready : {

0 commit comments

Comments
 (0)