Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ def CIR_AddressSpaceAttr : CIR_EnumAttr<CIR_AddressSpace, "address_space"> {
];

let assemblyFormat = [{
`` custom<AddressSpaceValue>($value)
`(` custom<AddressSpaceValue>($value) `)`
}];

let defaultValue = "cir::AddressSpace::Default";
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/CIR/Dialect/IR/CIROps.td
Original file line number Diff line number Diff line change
Expand Up @@ -2544,7 +2544,7 @@ def CIR_GlobalOp : CIR_Op<"global", [
(`comdat` $comdat^)?
($tls_model^)?
(`dso_local` $dso_local^)?
( `addrspace` `(` $addr_space^ `)` )?
(`addrspace` `` $addr_space^)?
$sym_name
custom<GlobalOpTypeAndInitialValue>($sym_type, $initial_value, $ctorRegion, $dtorRegion)
($annotations^)?
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/CIR/Dialect/IR/CIRTypes.td
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def CIR_PointerType : CIR_Type<"Pointer", "ptr", [
let assemblyFormat = [{
`<`
$pointee
( `,` `addrspace` `(` custom<AddressSpaceValue>($addrSpace)^ `)` )?
( `,` `addrspace` `(` `` custom<AddressSpaceValue>($addrSpace)^ `)` )?
`>`
}];

Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/address-space.cir
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/aliases.cir
Original file line number Diff line number Diff line change
@@ -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

module {
// CHECK: @testAnonRecordsAlias
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/alloca.cir
Original file line number Diff line number Diff line change
@@ -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
!s32i = !cir.int<s, 32>
!u64i = !cir.int<u, 64>

Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/annotations.cir
Original file line number Diff line number Diff line change
@@ -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>
module attributes {cir.global_annotations =
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/array.cir
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/attribute.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s -split-input-file -allow-unregistered-dialect -verify-diagnostics | FileCheck %s
// RUN: cir-opt %s -split-input-file -allow-unregistered-dialect -verify-diagnostics --verify-roundtrip | FileCheck %s

cir.func @float_attrs_pass() {
"test.float_attrs"() {
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/await.cir
Original file line number Diff line number Diff line change
@@ -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

cir.func coroutine @checkPrintParse(%arg0 : !cir.bool) {
cir.await(user, ready : {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/being_and_nothingness.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s | FileCheck %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
// Exercise different ways to encode a function returning void
// This test is less useful that it used to be, because a redundant `!cir.void`
// as a function return type is no longer supported.
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/bit.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s | cir-opt | FileCheck %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

!s8i = !cir.int<s, 8>
!s16i = !cir.int<s, 16>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/block-adress.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s | cir-opt | FileCheck %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

!void = !cir.void

Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/branch.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s | FileCheck %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

cir.func @test_branch_parsing(%arg0: !cir.bool) {
// CHECK: cir.br ^bb1
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/builtins.cir
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/call-op-call-conv.cir
Original file line number Diff line number Diff line change
@@ -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>
!fnptr = !cir.ptr<!cir.func<(!s32i) -> !s32i>>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/call.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s | FileCheck %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

!s32i = !cir.int<s, 32>
!fnptr = !cir.ptr<!cir.func<(!s32i) -> !s32i>>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/cast.cir
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/cir-ops.cir
Original file line number Diff line number Diff line change
@@ -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
!s32i = !cir.int<s, 32>
!s8i = !cir.int<s, 8>
!u64i = !cir.int<u, 64>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/constptrattr.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s | FileCheck %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

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

Expand Down
3 changes: 2 additions & 1 deletion clang/test/CIR/IR/copy.cir
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// RUN: cir-opt %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

!s32i = !cir.int<s, 32>
module {
cir.func @shouldParseCopyOp(%arg0 : !cir.ptr<!s32i>, %arg1 : !cir.ptr<!s32i>) {
// CHECK: cir.copy
cir.copy %arg0 to %arg1 : !cir.ptr<!s32i>
cir.return
}
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/cxx-special-member.cir
Original file line number Diff line number Diff line change
@@ -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>
!rec_S = !cir.record<struct "S" {!s32i}>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/data-member-ptr.cir
Original file line number Diff line number Diff line change
@@ -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>
!rec_Foo = !cir.record<struct "Foo" {!s32i}>
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/do-while.cir
Original file line number Diff line number Diff line change
@@ -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

cir.func @testPrintingAndParsing (%arg0 : !cir.bool) -> !cir.void {
cir.do {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/exceptions.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s | FileCheck %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
// XFAIL: *

!s32i = !cir.int<s, 32>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/float.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s | FileCheck %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

// Adapted from mlir/test/IR/parser.mlir

Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/for.cir
Original file line number Diff line number Diff line change
@@ -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

cir.func @testPrintingParsing(%arg0 : !cir.bool) {
cir.for : cond {
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/func-call-conv.cir
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/func-dsolocal-parser.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s | FileCheck %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

!s32i = !cir.int<s, 32>
#fn_attr = #cir<extra({inline = #cir.inline<no>, nothrow = #cir.nothrow, optnone = #cir.optnone})>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/func.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s | FileCheck %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

!s32i = !cir.int<s, 32>
!u8i = !cir.int<u, 8>
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/getmember.cir
Original file line number Diff line number Diff line change
@@ -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

!u16i = !cir.int<u, 16>
!u32i = !cir.int<u, 32>
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/global.cir
Original file line number Diff line number Diff line change
@@ -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
!s8i = !cir.int<s, 8>
!s32i = !cir.int<s, 32>
!s64i = !cir.int<s, 64>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/inlineAttr.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s | FileCheck %s -check-prefix=CIR
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s -check-prefix=CIR
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR

#fn_attr = #cir<extra({inline = #cir.inline<no>})>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/int.cir
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// cir.global external @a = #cir.int<255> : !cir.int<u, 8>
// }

// RUN: cir-opt %s | FileCheck %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
!s8i = !cir.int<s, 8>
!s16i = !cir.int<s, 16>
!s32i = !cir.int<s, 32>
Expand Down
3 changes: 2 additions & 1 deletion clang/test/CIR/IR/libc-fabs.cir
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// RUN: cir-opt %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

!u32i = !cir.int<u, 32>
module {
cir.func @foo(%arg0: !cir.double) -> !cir.double {
// CHECK: cir.fabs
%0 = cir.fabs %arg0 : !cir.double
cir.return %0 : !cir.double
}
Expand Down
3 changes: 2 additions & 1 deletion clang/test/CIR/IR/libc-memchr.cir
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// RUN: cir-opt %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

!voidptr = !cir.ptr<!cir.void>
!s32i = !cir.int<s, 32>
!u64i = !cir.int<u, 64>
module {
cir.func @f(%src : !voidptr, %pattern : !s32i, %len : !u64i) -> !voidptr {
// CHECK: cir.libc.memchr
%ptr = cir.libc.memchr(%src, %pattern, %len)
cir.return %ptr : !voidptr
}
Expand Down
3 changes: 2 additions & 1 deletion clang/test/CIR/IR/libc-memcpy.cir
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// RUN: cir-opt %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

!u32i = !cir.int<u, 32>
module {
cir.func @shouldParseLibcMemcpyOp(%arg0 : !cir.ptr<!cir.void>, %arg1 : !u32i) {
// CHECK: cir.libc.memcpy
cir.libc.memcpy %arg1 bytes from %arg0 to %arg0 : !u32i, !cir.ptr<!cir.void> -> !cir.ptr<!cir.void>
cir.return
}
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/llvm-intrinsic.cir
Original file line number Diff line number Diff line change
@@ -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>
!s64i = !cir.int<s, 64>
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/module.cir
Original file line number Diff line number Diff line change
@@ -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>} { }
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/ptr_stride.cir
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/resume-location-parsing.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s | FileCheck %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

// Test ClangIR exception handling parsing fix
// This demonstrates the syntax that was failing before the fix:
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/scope.cir
Original file line number Diff line number Diff line change
@@ -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
!u32i = !cir.int<u, 32>

module {
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/side-effect.cir
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: cir-opt %s -o %t.cir
// RUN: FileCheck %s --input-file=%t.cir
// RUN: cir-opt %s -split-input-file --verify-roundtrip | FileCheck %s

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

Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/stack-save-restore.cir
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/struct.cir
Original file line number Diff line number Diff line change
@@ -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

!u8i = !cir.int<u, 8>
!u16i = !cir.int<u, 16>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/switch.cir
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/tbaa-parse.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: cir-opt %s -o - | FileCheck %s
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s

!s16i = !cir.int<s, 16>
!s32i = !cir.int<s, 32>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/ternary.cir
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
26 changes: 13 additions & 13 deletions clang/test/CIR/IR/try.cir
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
// Test attempts to build bogus CIR
// RUN: cir-opt %s
// RUN: cir-opt %s -verify-roundtrip | FileCheck %s

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

module {
cir.func @div(%x : !s32i, %y : !s32i) -> !s32i {
%3 = cir.const #cir.int<0> : !s32i
cir.return %3 : !s32i
}
// CHECK: cir.func @div
cir.func @div(%x : !s32i, %y : !s32i) -> !s32i {
%3 = cir.const #cir.int<0> : !s32i
cir.return %3 : !s32i
}

cir.func @foo(%x : !s32i, %y : !s32i) -> () {
// CHECK: cir.func @foo
cir.func @foo(%x : !s32i, %y : !s32i) -> () {
cir.scope {
cir.scope {
cir.scope {
%d = cir.call exception @div(%x, %y) : (!s32i, !s32i) -> !s32i
cir.yield
}
// CHECK: cir.call exception
%d = cir.call exception @div(%x, %y) : (!s32i, !s32i) -> !s32i
cir.yield
}
cir.return
cir.yield
}
cir.return
}
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/types.cir
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
3 changes: 1 addition & 2 deletions clang/test/CIR/IR/unreachable.cir
Original file line number Diff line number Diff line change
@@ -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

cir.func @test() {
cir.unreachable
Expand Down
Loading
Loading