Skip to content

Conversation

xlauko
Copy link
Contributor

@xlauko xlauko commented Sep 30, 2025

This mirrors incubator changes from llvm/clangir#1923

@xlauko
Copy link
Contributor Author

xlauko commented Sep 30, 2025

@xlauko xlauko marked this pull request as ready for review September 30, 2025 20:40
@llvmbot llvmbot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels Sep 30, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 30, 2025

@llvm/pr-subscribers-clangir

Author: Henrich Lauko (xlauko)

Changes

This mirrors incubator changes from llvm/clangir#1923


Full diff: https://github.com/llvm/llvm-project/pull/161439.diff

29 Files Affected:

  • (modified) clang/test/CIR/IR/alloca.cir (+1-1)
  • (modified) clang/test/CIR/IR/array-ctor.cir (+1-1)
  • (modified) clang/test/CIR/IR/array-dtor.cir (+1-1)
  • (modified) clang/test/CIR/IR/array.cir (+1-1)
  • (modified) clang/test/CIR/IR/atomic.cir (+1-1)
  • (modified) clang/test/CIR/IR/binassign.cir (+1-1)
  • (modified) clang/test/CIR/IR/bitfield_info.cir (+1-1)
  • (modified) clang/test/CIR/IR/call.cir (+1-1)
  • (modified) clang/test/CIR/IR/cast.cir (+1-1)
  • (modified) clang/test/CIR/IR/cmp.cir (+1-1)
  • (modified) clang/test/CIR/IR/complex.cir (+1-1)
  • (modified) clang/test/CIR/IR/copy.cir (+1-1)
  • (modified) clang/test/CIR/IR/func.cir (+1-1)
  • (modified) clang/test/CIR/IR/global-init.cir (+1-1)
  • (modified) clang/test/CIR/IR/global-var-linkage.cir (+1-2)
  • (modified) clang/test/CIR/IR/global.cir (+1-1)
  • (modified) clang/test/CIR/IR/label.cir (+1-1)
  • (modified) clang/test/CIR/IR/module.cir (+1-2)
  • (modified) clang/test/CIR/IR/stack-save-restore.cir (+1-1)
  • (modified) clang/test/CIR/IR/struct.cir (+1-1)
  • (modified) clang/test/CIR/IR/switch-flat.cir (+1-1)
  • (modified) clang/test/CIR/IR/switch.cir (+1-1)
  • (modified) clang/test/CIR/IR/ternary.cir (+1-1)
  • (modified) clang/test/CIR/IR/throw.cir (+1-1)
  • (modified) clang/test/CIR/IR/unary.cir (+1-1)
  • (modified) clang/test/CIR/IR/vector.cir (+1-1)
  • (modified) clang/test/CIR/IR/vtable-addrpt.cir (+1-1)
  • (modified) clang/test/CIR/IR/vtable-attr.cir (+1-1)
  • (modified) clang/test/CIR/IR/vtt-addrpoint.cir (+1-1)
diff --git a/clang/test/CIR/IR/alloca.cir b/clang/test/CIR/IR/alloca.cir
index 4a13c44292b35..d94da815f37a7 100644
--- a/clang/test/CIR/IR/alloca.cir
+++ b/clang/test/CIR/IR/alloca.cir
@@ -1,5 +1,5 @@
 
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !u64i = !cir.int<u, 64>
 !u8i = !cir.int<u, 8>
diff --git a/clang/test/CIR/IR/array-ctor.cir b/clang/test/CIR/IR/array-ctor.cir
index 2378992bbd9fc..fd2ec7eb93c23 100644
--- a/clang/test/CIR/IR/array-ctor.cir
+++ b/clang/test/CIR/IR/array-ctor.cir
@@ -1,5 +1,5 @@
 
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !u8i = !cir.int<u, 8>
 !rec_S = !cir.record<struct "S" padded {!u8i}>
diff --git a/clang/test/CIR/IR/array-dtor.cir b/clang/test/CIR/IR/array-dtor.cir
index 6d08d1639f0db..1bb9ff9169a9d 100644
--- a/clang/test/CIR/IR/array-dtor.cir
+++ b/clang/test/CIR/IR/array-dtor.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !u8i = !cir.int<u, 8>
 !rec_S = !cir.record<struct "S" padded {!u8i}>
diff --git a/clang/test/CIR/IR/array.cir b/clang/test/CIR/IR/array.cir
index bba536062d740..ddc6b92b11ee9 100644
--- a/clang/test/CIR/IR/array.cir
+++ b/clang/test/CIR/IR/array.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/atomic.cir b/clang/test/CIR/IR/atomic.cir
index 6ca5af2aac175..85207633a5294 100644
--- a/clang/test/CIR/IR/atomic.cir
+++ b/clang/test/CIR/IR/atomic.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 !u32i = !cir.int<u, 32>
diff --git a/clang/test/CIR/IR/binassign.cir b/clang/test/CIR/IR/binassign.cir
index 6d2c5c8ab6962..02471264d779e 100644
--- a/clang/test/CIR/IR/binassign.cir
+++ b/clang/test/CIR/IR/binassign.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | cir-opt | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 !s8i = !cir.int<s, 8>
diff --git a/clang/test/CIR/IR/bitfield_info.cir b/clang/test/CIR/IR/bitfield_info.cir
index 682e0903fd552..2d743fbfbf595 100644
--- a/clang/test/CIR/IR/bitfield_info.cir
+++ b/clang/test/CIR/IR/bitfield_info.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 !u32i = !cir.int<u, 32>
diff --git a/clang/test/CIR/IR/call.cir b/clang/test/CIR/IR/call.cir
index 9607df7202e0f..59f28be36846f 100644
--- a/clang/test/CIR/IR/call.cir
+++ b/clang/test/CIR/IR/call.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/cast.cir b/clang/test/CIR/IR/cast.cir
index 11b1664871ef7..3f2fca9fc307b 100644
--- a/clang/test/CIR/IR/cast.cir
+++ b/clang/test/CIR/IR/cast.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | cir-opt | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 !s32i = !cir.int<s, 32>
 
 module  {
diff --git a/clang/test/CIR/IR/cmp.cir b/clang/test/CIR/IR/cmp.cir
index fdf538d7eef92..0d473986df1c2 100644
--- a/clang/test/CIR/IR/cmp.cir
+++ b/clang/test/CIR/IR/cmp.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | cir-opt | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 !s32i = !cir.int<s, 32>
 !u32i = !cir.int<u, 32>
 
diff --git a/clang/test/CIR/IR/complex.cir b/clang/test/CIR/IR/complex.cir
index a73a8654ca274..a7e0c77696d66 100644
--- a/clang/test/CIR/IR/complex.cir
+++ b/clang/test/CIR/IR/complex.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/copy.cir b/clang/test/CIR/IR/copy.cir
index 2cfb25d82b278..f9db29aa0e01f 100644
--- a/clang/test/CIR/IR/copy.cir
+++ b/clang/test/CIR/IR/copy.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 module {
diff --git a/clang/test/CIR/IR/func.cir b/clang/test/CIR/IR/func.cir
index 0e9a92fcf8201..9532859587629 100644
--- a/clang/test/CIR/IR/func.cir
+++ b/clang/test/CIR/IR/func.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 !s64i = !cir.int<s, 64>
diff --git a/clang/test/CIR/IR/global-init.cir b/clang/test/CIR/IR/global-init.cir
index 727c067e25472..2fd25df4e050b 100644
--- a/clang/test/CIR/IR/global-init.cir
+++ b/clang/test/CIR/IR/global-init.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt --verify-roundtrip %s -o - | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !u8i = !cir.int<u, 8>
 
diff --git a/clang/test/CIR/IR/global-var-linkage.cir b/clang/test/CIR/IR/global-var-linkage.cir
index e1b7de4bb2156..df74e3825e967 100644
--- a/clang/test/CIR/IR/global-var-linkage.cir
+++ b/clang/test/CIR/IR/global-var-linkage.cir
@@ -1,5 +1,4 @@
-// RUN: cir-opt %s -o %t.cir
-// RUN: FileCheck --input-file=%t.cir %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/global.cir b/clang/test/CIR/IR/global.cir
index 28fad6bbf4471..0464db822448e 100644
--- a/clang/test/CIR/IR/global.cir
+++ b/clang/test/CIR/IR/global.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s -o - | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s8i = !cir.int<s, 8>
 !s16i = !cir.int<s, 16>
diff --git a/clang/test/CIR/IR/label.cir b/clang/test/CIR/IR/label.cir
index 2211a4e8da331..1049766e7ce69 100644
--- a/clang/test/CIR/IR/label.cir
+++ b/clang/test/CIR/IR/label.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/module.cir b/clang/test/CIR/IR/module.cir
index 7ce2c0ba21cb0..8c782fdb2dbc6 100644
--- a/clang/test/CIR/IR/module.cir
+++ b/clang/test/CIR/IR/module.cir
@@ -1,5 +1,4 @@
-// RUN: cir-opt %s -split-input-file -o %t.cir
-// RUN: FileCheck --input-file=%t.cir %s
+// RUN: cir-opt %s -split-input-file --verify-roundtrip | FileCheck %s
 
 // Should parse and print C source language attribute.
 module attributes {cir.lang = #cir.lang<c>} { }
diff --git a/clang/test/CIR/IR/stack-save-restore.cir b/clang/test/CIR/IR/stack-save-restore.cir
index f98889ac1083a..476f2120a079d 100644
--- a/clang/test/CIR/IR/stack-save-restore.cir
+++ b/clang/test/CIR/IR/stack-save-restore.cir
@@ -1,6 +1,6 @@
 // Test the CIR operations can parse and print correctly (roundtrip)
 
-// RUN: cir-opt %s | cir-opt | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !u8i = !cir.int<u, 8>
 
diff --git a/clang/test/CIR/IR/struct.cir b/clang/test/CIR/IR/struct.cir
index 33f2e9860c5cb..2e011fba36b26 100644
--- a/clang/test/CIR/IR/struct.cir
+++ b/clang/test/CIR/IR/struct.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !u8i = !cir.int<u, 8>
 !u16i = !cir.int<u, 16>
diff --git a/clang/test/CIR/IR/switch-flat.cir b/clang/test/CIR/IR/switch-flat.cir
index 8c11a74484d39..d39c3e7e81215 100644
--- a/clang/test/CIR/IR/switch-flat.cir
+++ b/clang/test/CIR/IR/switch-flat.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 !s32i = !cir.int<s, 32>
 
 cir.func @FlatSwitchWithoutDefault(%arg0: !s32i) {
diff --git a/clang/test/CIR/IR/switch.cir b/clang/test/CIR/IR/switch.cir
index 0bdc9c1e7e896..87d45bf1f5219 100644
--- a/clang/test/CIR/IR/switch.cir
+++ b/clang/test/CIR/IR/switch.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 !s32i = !cir.int<s, 32>
 
 cir.func @s0() {
diff --git a/clang/test/CIR/IR/ternary.cir b/clang/test/CIR/IR/ternary.cir
index e419c7f5af40c..78e1de4eea8f1 100644
--- a/clang/test/CIR/IR/ternary.cir
+++ b/clang/test/CIR/IR/ternary.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | cir-opt | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 !u32i = !cir.int<u, 32>
 
 module  {
diff --git a/clang/test/CIR/IR/throw.cir b/clang/test/CIR/IR/throw.cir
index 8b24b481057b1..e7a1bf4f2f283 100644
--- a/clang/test/CIR/IR/throw.cir
+++ b/clang/test/CIR/IR/throw.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/unary.cir b/clang/test/CIR/IR/unary.cir
index ba3bc20d574f5..d01d4eb3c920a 100644
--- a/clang/test/CIR/IR/unary.cir
+++ b/clang/test/CIR/IR/unary.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 !s64i = !cir.int<s, 64>
diff --git a/clang/test/CIR/IR/vector.cir b/clang/test/CIR/IR/vector.cir
index 6d8e5beffd63f..d274c35099ee5 100644
--- a/clang/test/CIR/IR/vector.cir
+++ b/clang/test/CIR/IR/vector.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/vtable-addrpt.cir b/clang/test/CIR/IR/vtable-addrpt.cir
index 106e7485fbbcf..7c8fa8d5ebe18 100644
--- a/clang/test/CIR/IR/vtable-addrpt.cir
+++ b/clang/test/CIR/IR/vtable-addrpt.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 // Test the parsing and printing of a constructor that uses a vtable addess_point op.
 
diff --git a/clang/test/CIR/IR/vtable-attr.cir b/clang/test/CIR/IR/vtable-attr.cir
index 3854208ff78cc..70e32969c1985 100644
--- a/clang/test/CIR/IR/vtable-attr.cir
+++ b/clang/test/CIR/IR/vtable-attr.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !rec_Q = !cir.record<struct "Q" {!cir.vptr}>
 !rec_S = !cir.record<struct "S" {!cir.vptr}>
diff --git a/clang/test/CIR/IR/vtt-addrpoint.cir b/clang/test/CIR/IR/vtt-addrpoint.cir
index 11e5f4da83b50..823ddd2e7dc1d 100644
--- a/clang/test/CIR/IR/vtt-addrpoint.cir
+++ b/clang/test/CIR/IR/vtt-addrpoint.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 // Test the parsing and printing of the two forms of vtt.address_point op, as
 // they will appear in constructors.

@llvmbot
Copy link
Member

llvmbot commented Sep 30, 2025

@llvm/pr-subscribers-clang

Author: Henrich Lauko (xlauko)

Changes

This mirrors incubator changes from llvm/clangir#1923


Full diff: https://github.com/llvm/llvm-project/pull/161439.diff

29 Files Affected:

  • (modified) clang/test/CIR/IR/alloca.cir (+1-1)
  • (modified) clang/test/CIR/IR/array-ctor.cir (+1-1)
  • (modified) clang/test/CIR/IR/array-dtor.cir (+1-1)
  • (modified) clang/test/CIR/IR/array.cir (+1-1)
  • (modified) clang/test/CIR/IR/atomic.cir (+1-1)
  • (modified) clang/test/CIR/IR/binassign.cir (+1-1)
  • (modified) clang/test/CIR/IR/bitfield_info.cir (+1-1)
  • (modified) clang/test/CIR/IR/call.cir (+1-1)
  • (modified) clang/test/CIR/IR/cast.cir (+1-1)
  • (modified) clang/test/CIR/IR/cmp.cir (+1-1)
  • (modified) clang/test/CIR/IR/complex.cir (+1-1)
  • (modified) clang/test/CIR/IR/copy.cir (+1-1)
  • (modified) clang/test/CIR/IR/func.cir (+1-1)
  • (modified) clang/test/CIR/IR/global-init.cir (+1-1)
  • (modified) clang/test/CIR/IR/global-var-linkage.cir (+1-2)
  • (modified) clang/test/CIR/IR/global.cir (+1-1)
  • (modified) clang/test/CIR/IR/label.cir (+1-1)
  • (modified) clang/test/CIR/IR/module.cir (+1-2)
  • (modified) clang/test/CIR/IR/stack-save-restore.cir (+1-1)
  • (modified) clang/test/CIR/IR/struct.cir (+1-1)
  • (modified) clang/test/CIR/IR/switch-flat.cir (+1-1)
  • (modified) clang/test/CIR/IR/switch.cir (+1-1)
  • (modified) clang/test/CIR/IR/ternary.cir (+1-1)
  • (modified) clang/test/CIR/IR/throw.cir (+1-1)
  • (modified) clang/test/CIR/IR/unary.cir (+1-1)
  • (modified) clang/test/CIR/IR/vector.cir (+1-1)
  • (modified) clang/test/CIR/IR/vtable-addrpt.cir (+1-1)
  • (modified) clang/test/CIR/IR/vtable-attr.cir (+1-1)
  • (modified) clang/test/CIR/IR/vtt-addrpoint.cir (+1-1)
diff --git a/clang/test/CIR/IR/alloca.cir b/clang/test/CIR/IR/alloca.cir
index 4a13c44292b35..d94da815f37a7 100644
--- a/clang/test/CIR/IR/alloca.cir
+++ b/clang/test/CIR/IR/alloca.cir
@@ -1,5 +1,5 @@
 
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !u64i = !cir.int<u, 64>
 !u8i = !cir.int<u, 8>
diff --git a/clang/test/CIR/IR/array-ctor.cir b/clang/test/CIR/IR/array-ctor.cir
index 2378992bbd9fc..fd2ec7eb93c23 100644
--- a/clang/test/CIR/IR/array-ctor.cir
+++ b/clang/test/CIR/IR/array-ctor.cir
@@ -1,5 +1,5 @@
 
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !u8i = !cir.int<u, 8>
 !rec_S = !cir.record<struct "S" padded {!u8i}>
diff --git a/clang/test/CIR/IR/array-dtor.cir b/clang/test/CIR/IR/array-dtor.cir
index 6d08d1639f0db..1bb9ff9169a9d 100644
--- a/clang/test/CIR/IR/array-dtor.cir
+++ b/clang/test/CIR/IR/array-dtor.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !u8i = !cir.int<u, 8>
 !rec_S = !cir.record<struct "S" padded {!u8i}>
diff --git a/clang/test/CIR/IR/array.cir b/clang/test/CIR/IR/array.cir
index bba536062d740..ddc6b92b11ee9 100644
--- a/clang/test/CIR/IR/array.cir
+++ b/clang/test/CIR/IR/array.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/atomic.cir b/clang/test/CIR/IR/atomic.cir
index 6ca5af2aac175..85207633a5294 100644
--- a/clang/test/CIR/IR/atomic.cir
+++ b/clang/test/CIR/IR/atomic.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 !u32i = !cir.int<u, 32>
diff --git a/clang/test/CIR/IR/binassign.cir b/clang/test/CIR/IR/binassign.cir
index 6d2c5c8ab6962..02471264d779e 100644
--- a/clang/test/CIR/IR/binassign.cir
+++ b/clang/test/CIR/IR/binassign.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | cir-opt | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 !s8i = !cir.int<s, 8>
diff --git a/clang/test/CIR/IR/bitfield_info.cir b/clang/test/CIR/IR/bitfield_info.cir
index 682e0903fd552..2d743fbfbf595 100644
--- a/clang/test/CIR/IR/bitfield_info.cir
+++ b/clang/test/CIR/IR/bitfield_info.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 !u32i = !cir.int<u, 32>
diff --git a/clang/test/CIR/IR/call.cir b/clang/test/CIR/IR/call.cir
index 9607df7202e0f..59f28be36846f 100644
--- a/clang/test/CIR/IR/call.cir
+++ b/clang/test/CIR/IR/call.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/cast.cir b/clang/test/CIR/IR/cast.cir
index 11b1664871ef7..3f2fca9fc307b 100644
--- a/clang/test/CIR/IR/cast.cir
+++ b/clang/test/CIR/IR/cast.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | cir-opt | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 !s32i = !cir.int<s, 32>
 
 module  {
diff --git a/clang/test/CIR/IR/cmp.cir b/clang/test/CIR/IR/cmp.cir
index fdf538d7eef92..0d473986df1c2 100644
--- a/clang/test/CIR/IR/cmp.cir
+++ b/clang/test/CIR/IR/cmp.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | cir-opt | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 !s32i = !cir.int<s, 32>
 !u32i = !cir.int<u, 32>
 
diff --git a/clang/test/CIR/IR/complex.cir b/clang/test/CIR/IR/complex.cir
index a73a8654ca274..a7e0c77696d66 100644
--- a/clang/test/CIR/IR/complex.cir
+++ b/clang/test/CIR/IR/complex.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/copy.cir b/clang/test/CIR/IR/copy.cir
index 2cfb25d82b278..f9db29aa0e01f 100644
--- a/clang/test/CIR/IR/copy.cir
+++ b/clang/test/CIR/IR/copy.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 module {
diff --git a/clang/test/CIR/IR/func.cir b/clang/test/CIR/IR/func.cir
index 0e9a92fcf8201..9532859587629 100644
--- a/clang/test/CIR/IR/func.cir
+++ b/clang/test/CIR/IR/func.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 !s64i = !cir.int<s, 64>
diff --git a/clang/test/CIR/IR/global-init.cir b/clang/test/CIR/IR/global-init.cir
index 727c067e25472..2fd25df4e050b 100644
--- a/clang/test/CIR/IR/global-init.cir
+++ b/clang/test/CIR/IR/global-init.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt --verify-roundtrip %s -o - | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !u8i = !cir.int<u, 8>
 
diff --git a/clang/test/CIR/IR/global-var-linkage.cir b/clang/test/CIR/IR/global-var-linkage.cir
index e1b7de4bb2156..df74e3825e967 100644
--- a/clang/test/CIR/IR/global-var-linkage.cir
+++ b/clang/test/CIR/IR/global-var-linkage.cir
@@ -1,5 +1,4 @@
-// RUN: cir-opt %s -o %t.cir
-// RUN: FileCheck --input-file=%t.cir %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/global.cir b/clang/test/CIR/IR/global.cir
index 28fad6bbf4471..0464db822448e 100644
--- a/clang/test/CIR/IR/global.cir
+++ b/clang/test/CIR/IR/global.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s -o - | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s8i = !cir.int<s, 8>
 !s16i = !cir.int<s, 16>
diff --git a/clang/test/CIR/IR/label.cir b/clang/test/CIR/IR/label.cir
index 2211a4e8da331..1049766e7ce69 100644
--- a/clang/test/CIR/IR/label.cir
+++ b/clang/test/CIR/IR/label.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/module.cir b/clang/test/CIR/IR/module.cir
index 7ce2c0ba21cb0..8c782fdb2dbc6 100644
--- a/clang/test/CIR/IR/module.cir
+++ b/clang/test/CIR/IR/module.cir
@@ -1,5 +1,4 @@
-// RUN: cir-opt %s -split-input-file -o %t.cir
-// RUN: FileCheck --input-file=%t.cir %s
+// RUN: cir-opt %s -split-input-file --verify-roundtrip | FileCheck %s
 
 // Should parse and print C source language attribute.
 module attributes {cir.lang = #cir.lang<c>} { }
diff --git a/clang/test/CIR/IR/stack-save-restore.cir b/clang/test/CIR/IR/stack-save-restore.cir
index f98889ac1083a..476f2120a079d 100644
--- a/clang/test/CIR/IR/stack-save-restore.cir
+++ b/clang/test/CIR/IR/stack-save-restore.cir
@@ -1,6 +1,6 @@
 // Test the CIR operations can parse and print correctly (roundtrip)
 
-// RUN: cir-opt %s | cir-opt | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !u8i = !cir.int<u, 8>
 
diff --git a/clang/test/CIR/IR/struct.cir b/clang/test/CIR/IR/struct.cir
index 33f2e9860c5cb..2e011fba36b26 100644
--- a/clang/test/CIR/IR/struct.cir
+++ b/clang/test/CIR/IR/struct.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !u8i = !cir.int<u, 8>
 !u16i = !cir.int<u, 16>
diff --git a/clang/test/CIR/IR/switch-flat.cir b/clang/test/CIR/IR/switch-flat.cir
index 8c11a74484d39..d39c3e7e81215 100644
--- a/clang/test/CIR/IR/switch-flat.cir
+++ b/clang/test/CIR/IR/switch-flat.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 !s32i = !cir.int<s, 32>
 
 cir.func @FlatSwitchWithoutDefault(%arg0: !s32i) {
diff --git a/clang/test/CIR/IR/switch.cir b/clang/test/CIR/IR/switch.cir
index 0bdc9c1e7e896..87d45bf1f5219 100644
--- a/clang/test/CIR/IR/switch.cir
+++ b/clang/test/CIR/IR/switch.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 !s32i = !cir.int<s, 32>
 
 cir.func @s0() {
diff --git a/clang/test/CIR/IR/ternary.cir b/clang/test/CIR/IR/ternary.cir
index e419c7f5af40c..78e1de4eea8f1 100644
--- a/clang/test/CIR/IR/ternary.cir
+++ b/clang/test/CIR/IR/ternary.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | cir-opt | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 !u32i = !cir.int<u, 32>
 
 module  {
diff --git a/clang/test/CIR/IR/throw.cir b/clang/test/CIR/IR/throw.cir
index 8b24b481057b1..e7a1bf4f2f283 100644
--- a/clang/test/CIR/IR/throw.cir
+++ b/clang/test/CIR/IR/throw.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/unary.cir b/clang/test/CIR/IR/unary.cir
index ba3bc20d574f5..d01d4eb3c920a 100644
--- a/clang/test/CIR/IR/unary.cir
+++ b/clang/test/CIR/IR/unary.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 !s64i = !cir.int<s, 64>
diff --git a/clang/test/CIR/IR/vector.cir b/clang/test/CIR/IR/vector.cir
index 6d8e5beffd63f..d274c35099ee5 100644
--- a/clang/test/CIR/IR/vector.cir
+++ b/clang/test/CIR/IR/vector.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !s32i = !cir.int<s, 32>
 
diff --git a/clang/test/CIR/IR/vtable-addrpt.cir b/clang/test/CIR/IR/vtable-addrpt.cir
index 106e7485fbbcf..7c8fa8d5ebe18 100644
--- a/clang/test/CIR/IR/vtable-addrpt.cir
+++ b/clang/test/CIR/IR/vtable-addrpt.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 // Test the parsing and printing of a constructor that uses a vtable addess_point op.
 
diff --git a/clang/test/CIR/IR/vtable-attr.cir b/clang/test/CIR/IR/vtable-attr.cir
index 3854208ff78cc..70e32969c1985 100644
--- a/clang/test/CIR/IR/vtable-attr.cir
+++ b/clang/test/CIR/IR/vtable-attr.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 !rec_Q = !cir.record<struct "Q" {!cir.vptr}>
 !rec_S = !cir.record<struct "S" {!cir.vptr}>
diff --git a/clang/test/CIR/IR/vtt-addrpoint.cir b/clang/test/CIR/IR/vtt-addrpoint.cir
index 11e5f4da83b50..823ddd2e7dc1d 100644
--- a/clang/test/CIR/IR/vtt-addrpoint.cir
+++ b/clang/test/CIR/IR/vtt-addrpoint.cir
@@ -1,4 +1,4 @@
-// RUN: cir-opt %s | FileCheck %s
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
 
 // Test the parsing and printing of the two forms of vtt.address_point op, as
 // they will appear in constructors.

Copy link
Contributor

@andykaylor andykaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, but I noticed that mlir-opt has a build option that causes it to implicitly add this argument in LIT tests. Should we do that?

@xlauko
Copy link
Contributor Author

xlauko commented Sep 30, 2025

This looks fine, but I noticed that mlir-opt has a build option that causes it to implicitly add this argument in LIT tests. Should we do that?

TIL, that would be the best. Though there is one test failing on the roundtrip at the moment: #161441

@xlauko xlauko force-pushed the users/xlauko/cir-opt-test-verify-roundtrip branch from 3758102 to 60e5450 Compare September 30, 2025 21:08
@xlauko xlauko force-pushed the users/xlauko/cir-cast-op-format branch from 9871716 to 2c17b86 Compare September 30, 2025 21:08
@xlauko
Copy link
Contributor Author

xlauko commented Oct 1, 2025

Merge activity

  • Oct 1, 7:13 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 1, 8:44 AM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 1, 8:49 AM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 1, 8:53 AM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 1, 8:56 AM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 1, 9:02 AM UTC: Graphite couldn't merge this PR because it was not satisfying all requirements (Failed CI: 'Build and Test Linux').

@xlauko xlauko force-pushed the users/xlauko/cir-cast-op-format branch from 39ddfd8 to 3337fb0 Compare October 1, 2025 07:14
@xlauko xlauko force-pushed the users/xlauko/cir-cast-op-format branch 8 times, most recently from f9cf874 to 6c0343a Compare October 1, 2025 08:23
Base automatically changed from users/xlauko/cir-cast-op-format to main October 1, 2025 08:44
@xlauko xlauko force-pushed the users/xlauko/cir-opt-test-verify-roundtrip branch from 3da39b3 to 7dfb9be Compare October 1, 2025 08:44
@xlauko xlauko force-pushed the users/xlauko/cir-opt-test-verify-roundtrip branch 2 times, most recently from 51f1db1 to 73ac059 Compare October 1, 2025 08:52
@xlauko xlauko force-pushed the users/xlauko/cir-opt-test-verify-roundtrip branch from 73ac059 to 241432c Compare October 1, 2025 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants