diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td index 977dba6425b8..90ccf2cd8408 100644 --- a/clang/include/clang/CIR/Dialect/IR/CIROps.td +++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td @@ -2467,7 +2467,7 @@ def GlobalOp : CIR_Op<"global", OptionalAttr:$initial_value, UnitAttr:$comdat, UnitAttr:$constant, - UnitAttr:$dsolocal, + UnitAttr:$dso_local, OptionalAttr:$alignment, OptionalAttr:$ast, OptionalAttr:$section, @@ -2480,7 +2480,7 @@ def GlobalOp : CIR_Op<"global", $linkage (`comdat` $comdat^)? ($tls_model^)? - (`dsolocal` $dsolocal^)? + (`dso_local` $dso_local^)? (`addrspace` `(` custom($addr_space)^ `)`)? $sym_name custom($sym_type, $initial_value, $ctorRegion, $dtorRegion) @@ -3660,7 +3660,7 @@ def FuncOp : CIR_Op<"func", [ UnitAttr:$coroutine, UnitAttr:$lambda, UnitAttr:$no_proto, - UnitAttr:$dsolocal, + UnitAttr:$dso_local, DefaultValuedAttr:$linkage, DefaultValuedAttr, InterfaceMethod<"", "bool", "isDSOLocal", (ins), [{}], /*defaultImplementation=*/[{ - return $_op.getDsolocal(); + return $_op.getDsoLocal(); }] >, InterfaceMethod<"", diff --git a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp index 2e16c75927cb..ba9787a19d19 100644 --- a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp +++ b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp @@ -2321,7 +2321,7 @@ ParseResult cir::FuncOp::parse(OpAsmParser &parser, OperationState &state) { auto visNameAttr = getSymVisibilityAttrName(state.name); auto noProtoNameAttr = getNoProtoAttrName(state.name); auto visibilityNameAttr = getGlobalVisibilityAttrName(state.name); - auto dsolocalNameAttr = getDsolocalAttrName(state.name); + auto dsoLocalNameAttr = getDsoLocalAttrName(state.name); auto annotationsNameAttr = getAnnotationsAttrName(state.name); if (::mlir::succeeded(parser.parseOptionalKeyword(builtinNameAttr.strref()))) state.addAttribute(builtinNameAttr, parser.getBuilder().getUnitAttr()); @@ -2354,9 +2354,8 @@ ParseResult cir::FuncOp::parse(OpAsmParser &parser, OperationState &state) { parseVisibilityAttr(parser, cirVisibilityAttr); state.addAttribute(visibilityNameAttr, cirVisibilityAttr); - // TODO: It is unclear whether this is printed in the pretty-printer - if (parser.parseOptionalKeyword(dsolocalNameAttr).succeeded()) - state.addAttribute(dsolocalNameAttr, parser.getBuilder().getUnitAttr()); + if (parser.parseOptionalKeyword(dsoLocalNameAttr).succeeded()) + state.addAttribute(dsoLocalNameAttr, parser.getBuilder().getUnitAttr()); StringAttr nameAttr; llvm::SmallVector arguments; @@ -2568,6 +2567,9 @@ void cir::FuncOp::print(OpAsmPrinter &p) { printVisibilityAttr(p, cirVisibilityAttr); } + if (getDsoLocal()) + p << " dso_local"; + // Print function name, signature, and control. p << ' '; p.printSymbolName(getSymName()); @@ -2585,7 +2587,7 @@ void cir::FuncOp::print(OpAsmPrinter &p) { p, *this, // These are all omitted since they are custom printed already. {getAliaseeAttrName(), getBuiltinAttrName(), getCoroutineAttrName(), - getDsolocalAttrName(), getExtraAttrsAttrName(), + getDsoLocalAttrName(), getExtraAttrsAttrName(), getFunctionTypeAttrName(), getGlobalCtorAttrName(), getGlobalDtorAttrName(), getLambdaAttrName(), getLinkageAttrName(), getCallingConvAttrName(), getNoProtoAttrName(), diff --git a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp index 2192bcca1a3e..b9c7b618aea6 100644 --- a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp +++ b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp @@ -2133,18 +2133,19 @@ void CIRToLLVMFuncOpLowering::lowerFuncAttributes( cir::FuncOp func, bool filterArgAndResAttrs, SmallVectorImpl &result) const { for (auto attr : func->getAttrs()) { - if (attr.getName() == mlir::SymbolTable::getSymbolAttrName() || - attr.getName() == func.getFunctionTypeAttrName() || - attr.getName() == getLinkageAttrNameString() || - attr.getName() == func.getCallingConvAttrName() || - (filterArgAndResAttrs && - (attr.getName() == func.getArgAttrsAttrName() || - attr.getName() == func.getResAttrsAttrName()))) + StringRef name = attr.getName(); + if (name == mlir::SymbolTable::getSymbolAttrName() || + name == func.getFunctionTypeAttrName() || + name == getLinkageAttrNameString() || + name == func.getCallingConvAttrName() || + name == func.getDsoLocalAttrName() || + (filterArgAndResAttrs && (name == func.getArgAttrsAttrName() || + name == func.getResAttrsAttrName()))) continue; // `CIRDialectLLVMIRTranslationInterface` requires "cir." prefix for // dialect specific attributes, rename them. - if (attr.getName() == func.getExtraAttrsAttrName()) { + if (name == func.getExtraAttrsAttrName()) { std::string cirName = "cir." + func.getExtraAttrsAttrName().str(); attr.setName(mlir::StringAttr::get(getContext(), cirName)); @@ -2191,7 +2192,7 @@ mlir::LogicalResult CIRToLLVMFuncOpLowering::matchAndRewrite( mlir::ConversionPatternRewriter &rewriter) const { auto fnType = op.getFunctionType(); - auto isDsoLocal = op.getDsolocal(); + auto isDsoLocal = op.getDsoLocal(); mlir::TypeConverter::SignatureConversion signatureConversion( fnType.getNumInputs()); @@ -2562,7 +2563,7 @@ mlir::LogicalResult CIRToLLVMGlobalOpLowering::matchAndRewrite( const auto llvmType = convertTypeForMemory(*getTypeConverter(), dataLayout, cirSymType); const auto isConst = op.getConstant(); - const auto isDsoLocal = op.getDsolocal(); + const auto isDsoLocal = op.getDsoLocal(); const auto linkage = convertLinkage(op.getLinkage()); const auto symbol = op.getSymName(); mlir::Attribute init = op.getInitialValueAttr(); diff --git a/clang/test/CIR/CallConvLowering/AArch64/aarch64-cc-structs.c b/clang/test/CIR/CallConvLowering/AArch64/aarch64-cc-structs.c index 6153912a42b7..0fc82e8ef65c 100644 --- a/clang/test/CIR/CallConvLowering/AArch64/aarch64-cc-structs.c +++ b/clang/test/CIR/CallConvLowering/AArch64/aarch64-cc-structs.c @@ -4,7 +4,7 @@ #include typedef struct { - short a; + short a; } LT_64; typedef struct { @@ -67,7 +67,7 @@ EQ_128 ret_eq_128() { return x; } -// CHECK: cir.func {{.*@ret_gt_128}}(%arg0: !cir.ptr +// CHECK: cir.func {{.*@ret_gt_128}}(%arg0: !cir.ptr // CHECK-NOT: cir.return {{%.*}} GT_128 ret_gt_128() { GT_128 x; @@ -77,7 +77,7 @@ GT_128 ret_gt_128() { typedef struct { int a; int b; - int c; + int c; } S; // CHECK: cir.func {{.*@retS}}() -> !cir.array @@ -90,7 +90,7 @@ typedef struct { // CHECK: %[[#V5:]] = cir.load{{.*}} %[[#V1]] : !cir.ptr>, !cir.array // CHECK: cir.return %[[#V5]] : !cir.array -// LLVM: [2 x i64] @retS() +// LLVM: [2 x i64] @retS() // LLVM: %[[#V1:]] = alloca %struct.S, i64 1, align 4 // LLVM: %[[#V2:]] = alloca [2 x i64], i64 1, align 8 // LLVM: call void @llvm.memcpy.p0.p0.i64(ptr %[[#V2]], ptr %[[#V1]], i64 12, i1 false) @@ -142,7 +142,7 @@ void pass_lt_128(LT_128 s) {} // LLVM: store [2 x i64] %0, ptr %[[#V1]], align 8 void pass_eq_128(EQ_128 s) {} -// CHECK: cir.func @pass_gt_128(%arg0: !cir.ptr +// CHECK: cir.func dso_local @pass_gt_128(%arg0: !cir.ptr // CHECK: %[[#V0:]] = cir.alloca !cir.ptr, !cir.ptr>, [""] {alignment = 8 : i64} // CHECK: cir.store{{.*}} %arg0, %[[#V0]] : !cir.ptr, !cir.ptr> // CHECK: %[[#V1:]] = cir.load{{.*}} %[[#V0]] : !cir.ptr>, !cir.ptr @@ -153,7 +153,7 @@ void pass_eq_128(EQ_128 s) {} // LLVM: %[[#V2:]] = load ptr, ptr %[[#V1]], align 8 void pass_gt_128(GT_128 s) {} -// CHECK: cir.func @get_gt_128(%arg0: !cir.ptr {{.*}}, %arg1: !cir.ptr +// CHECK: cir.func dso_local @get_gt_128(%arg0: !cir.ptr {{.*}}, %arg1: !cir.ptr // CHECK: %[[#V0:]] = cir.alloca !cir.ptr, !cir.ptr>, [""] {alignment = 8 : i64} // CHECK: cir.store{{.*}} %arg1, %[[#V0]] : !cir.ptr, !cir.ptr> // CHECK: %[[#V1:]] = cir.load{{.*}} %[[#V0]] : !cir.ptr>, !cir.ptr @@ -170,7 +170,7 @@ GT_128 get_gt_128(GT_128 s) { return s; } -// CHECK: cir.func no_proto @call_and_get_gt_128(%arg0: !cir.ptr +// CHECK: cir.func no_proto dso_local @call_and_get_gt_128(%arg0: !cir.ptr // CHECK: %[[#V0:]] = cir.alloca !rec_GT_128, !cir.ptr, ["tmp"] {alignment = 8 : i64} // CHECK: %[[#V1:]] = cir.load{{.*}} %arg0 : !cir.ptr, !rec_GT_128 // CHECK: %[[#V2:]] = cir.alloca !rec_GT_128, !cir.ptr, [""] {alignment = 8 : i64} @@ -194,7 +194,7 @@ GT_128 call_and_get_gt_128() { s = get_gt_128(s); return s; } -// CHECK: cir.func @passS(%arg0: !cir.array +// CHECK: cir.func dso_local @passS(%arg0: !cir.array // CHECK: %[[#V0:]] = cir.alloca !rec_S, !cir.ptr, [""] {alignment = 4 : i64} // CHECK: %[[#V1:]] = cir.alloca !cir.array, !cir.ptr>, ["tmp"] {alignment = 8 : i64} // CHECK: cir.store{{.*}} %arg0, %[[#V1]] : !cir.array, !cir.ptr> @@ -268,7 +268,7 @@ typedef struct { int a[42]; } CAT; -// CHECK: cir.func @pass_cat(%arg0: !cir.ptr +// CHECK: cir.func dso_local @pass_cat(%arg0: !cir.ptr // CHECK: %[[#V0:]] = cir.alloca !cir.ptr, !cir.ptr>, [""] {alignment = 8 : i64} // CHECK: cir.store{{.*}} %arg0, %[[#V0]] : !cir.ptr, !cir.ptr> // CHECK: %[[#V1:]] = cir.load{{.*}} %[[#V0]] : !cir.ptr>, !cir.ptr @@ -290,7 +290,7 @@ typedef struct { }; } NESTED_U; -// CHECK: cir.func @pass_nested_u(%arg0: !u64i +// CHECK: cir.func dso_local @pass_nested_u(%arg0: !u64i // CHECK: %[[#V0:]] = cir.alloca !rec_NESTED_U, !cir.ptr, [""] {alignment = 4 : i64} // CHECK: %[[#V1:]] = cir.cast(integral, %arg0 : !u64i), !u16i // CHECK: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr @@ -304,7 +304,7 @@ typedef struct { // LLVM: ret void void pass_nested_u(NESTED_U a) {} -// CHECK: cir.func no_proto @call_nested_u() +// CHECK: cir.func no_proto dso_local @call_nested_u() // CHECK: %[[#V0:]] = cir.alloca !rec_NESTED_U, !cir.ptr // CHECK: %[[#V1:]] = cir.alloca !u64i, !cir.ptr, ["tmp"] // CHECK: %[[#V2:]] = cir.load{{.*}} %[[#V0]] : !cir.ptr, !rec_NESTED_U @@ -355,7 +355,7 @@ void bar(void) { PackedS1 y = foo(); } -// CHECK: cir.func @bar +// CHECK: cir.func dso_local @bar // CHECK: %[[#V0:]] = cir.alloca !rec_PackedS1, !cir.ptr, ["y", init] // CHECK: %[[#V1:]] = cir.alloca !cir.array, !cir.ptr>, ["tmp"] // CHECK: %[[#V2:]] = cir.call @foo() : () -> !cir.array @@ -394,7 +394,7 @@ void qux(void) { } // check source of memcpy -// CHECK: cir.func @qux +// CHECK: cir.func dso_local @qux // CHECK: %[[#V0:]] = cir.alloca !cir.ptr, !cir.ptr>, ["s1", init] // CHECK: %[[#V1:]] = cir.alloca !u64i, !cir.ptr, ["tmp"] // CHECK: %[[#V2:]] = cir.get_global @g : !cir.ptr> @@ -403,9 +403,9 @@ void qux(void) { // CHECK: %[[#V5:]] = cir.ptr_stride(%[[#V4]] : !cir.ptr, %[[#V3]] : !s32i), !cir.ptr // CHECK: cir.store{{.*}} %[[#V5]], %[[#V0]] : !cir.ptr, !cir.ptr> // CHECK: %[[#V6:]] = cir.load deref{{.*}} %[[#V0]] : !cir.ptr>, !cir.ptr -// CHECK: %[[#V7:]] = cir.cast(bitcast, %[[#V6]] : !cir.ptr), !cir.ptr +// CHECK: %[[#V7:]] = cir.cast(bitcast, %[[#V6]] : !cir.ptr), !cir.ptr // CHECK: %[[#V8:]] = cir.const #cir.int<6> : !u64i -// CHECK: cir.libc.memcpy %[[#V8]] bytes from %[[#V7]] +// CHECK: cir.libc.memcpy %[[#V8]] bytes from %[[#V7]] // Note: GEP emitted by cir might not be the same as LLVM, due to constant folding. // LLVM: void @qux diff --git a/clang/test/CIR/CallConvLowering/AArch64/basic.cpp b/clang/test/CIR/CallConvLowering/AArch64/basic.cpp index f3a926aa93a6..a9af1a5d4ba2 100644 --- a/clang/test/CIR/CallConvLowering/AArch64/basic.cpp +++ b/clang/test/CIR/CallConvLowering/AArch64/basic.cpp @@ -15,27 +15,27 @@ bool Bool(bool a) { return Bool(a); } -// CHECK: cir.func @_Z5UCharh(%arg0: !u8i loc({{.+}})) -> !u8i +// CHECK: cir.func dso_local @_Z5UCharh(%arg0: !u8i loc({{.+}})) -> !u8i unsigned char UChar(unsigned char c) { // CHECK: cir.call @_Z5UCharh(%2) : (!u8i) -> !u8i return UChar(c); } -// CHECK: cir.func @_Z6UShortt(%arg0: !u16i loc({{.+}})) -> !u16i +// CHECK: cir.func dso_local @_Z6UShortt(%arg0: !u16i loc({{.+}})) -> !u16i unsigned short UShort(unsigned short s) { // CHECK: cir.call @_Z6UShortt(%2) : (!u16i) -> !u16i return UShort(s); } -// CHECK: cir.func @_Z4UIntj(%arg0: !u32i loc({{.+}})) -> !u32i +// CHECK: cir.func dso_local @_Z4UIntj(%arg0: !u32i loc({{.+}})) -> !u32i unsigned int UInt(unsigned int i) { // CHECK: cir.call @_Z4UIntj(%2) : (!u32i) -> !u32i return UInt(i); } -// CHECK: cir.func @_Z5ULongm(%arg0: !u64i loc({{.+}})) -> !u64i +// CHECK: cir.func dso_local @_Z5ULongm(%arg0: !u64i loc({{.+}})) -> !u64i unsigned long ULong(unsigned long l) { // CHECK: cir.call @_Z5ULongm(%2) : (!u64i) -> !u64i return ULong(l); } -// CHECK: cir.func @_Z9ULongLongy(%arg0: !u64i loc({{.+}})) -> !u64i +// CHECK: cir.func dso_local @_Z9ULongLongy(%arg0: !u64i loc({{.+}})) -> !u64i unsigned long long ULongLong(unsigned long long l) { // CHECK: cir.call @_Z9ULongLongy(%2) : (!u64i) -> !u64i return ULongLong(l); @@ -44,27 +44,27 @@ unsigned long long ULongLong(unsigned long long l) { /// Test call conv lowering for trivial signed cases. /// -// CHECK: cir.func @_Z4Chara(%arg0: !s8i loc({{.+}})) -> !s8i +// CHECK: cir.func dso_local @_Z4Chara(%arg0: !s8i loc({{.+}})) -> !s8i char Char(signed char c) { // CHECK: cir.call @_Z4Chara(%{{.+}}) : (!s8i) -> !s8i return Char(c); } -// CHECK: cir.func @_Z5Shorts(%arg0: !s16i loc({{.+}})) -> !s16i +// CHECK: cir.func dso_local @_Z5Shorts(%arg0: !s16i loc({{.+}})) -> !s16i short Short(short s) { // CHECK: cir.call @_Z5Shorts(%{{.+}}) : (!s16i) -> !s16i return Short(s); } -// CHECK: cir.func @_Z3Inti(%arg0: !s32i loc({{.+}})) -> !s32i +// CHECK: cir.func dso_local @_Z3Inti(%arg0: !s32i loc({{.+}})) -> !s32i int Int(int i) { // CHECK: cir.call @_Z3Inti(%{{.+}}) : (!s32i) -> !s32i return Int(i); } -// CHECK: cir.func @_Z4Longl(%arg0: !s64i loc({{.+}})) -> !s64i +// CHECK: cir.func dso_local @_Z4Longl(%arg0: !s64i loc({{.+}})) -> !s64i long Long(long l) { // CHECK: cir.call @_Z4Longl(%{{.+}}) : (!s64i) -> !s64i return Long(l); } -// CHECK: cir.func @_Z8LongLongx(%arg0: !s64i loc({{.+}})) -> !s64i +// CHECK: cir.func dso_local @_Z8LongLongx(%arg0: !s64i loc({{.+}})) -> !s64i long long LongLong(long long l) { // CHECK: cir.call @_Z8LongLongx(%{{.+}}) : (!s64i) -> !s64i return LongLong(l); @@ -73,12 +73,12 @@ long long LongLong(long long l) { /// Test call conv lowering for floating point. /// -// CHECK: cir.func @_Z5Floatf(%arg0: !cir.float loc({{.+}})) -> !cir.float +// CHECK: cir.func dso_local @_Z5Floatf(%arg0: !cir.float loc({{.+}})) -> !cir.float float Float(float f) { // cir.call @_Z5Floatf(%{{.+}}) : (!cir.float) -> !cir.float return Float(f); } -// CHECK: cir.func @_Z6Doubled(%arg0: !cir.double loc({{.+}})) -> !cir.double +// CHECK: cir.func dso_local @_Z6Doubled(%arg0: !cir.double loc({{.+}})) -> !cir.double double Double(double d) { // cir.call @_Z6Doubled(%{{.+}}) : (!cir.double) -> !cir.double return Double(d); diff --git a/clang/test/CIR/CallConvLowering/AArch64/ptr-fields.c b/clang/test/CIR/CallConvLowering/AArch64/ptr-fields.c index d7d9e0126384..e225daa8f8cd 100644 --- a/clang/test/CIR/CallConvLowering/AArch64/ptr-fields.c +++ b/clang/test/CIR/CallConvLowering/AArch64/ptr-fields.c @@ -11,7 +11,7 @@ typedef struct { int foo(int x) { return x; } -// CIR: cir.func @passA(%arg0: !u64i +// CIR: cir.func dso_local @passA(%arg0: !u64i // CIR: %[[#V0:]] = cir.alloca !rec_A, !cir.ptr, [""] {alignment = 4 : i64} // CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: cir.store{{.*}} %arg0, %[[#V1]] : !u64i, !cir.ptr @@ -36,7 +36,7 @@ typedef struct { S_1* s; } S_2; -// CIR: cir.func @passB(%arg0: !u64i +// CIR: cir.func dso_local @passB(%arg0: !u64i // CIR: %[[#V0:]] = cir.alloca !rec_S_2, !cir.ptr, [""] {alignment = 4 : i64} // CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: cir.store{{.*}} %arg0, %[[#V1]] : !u64i, !cir.ptr diff --git a/clang/test/CIR/CallConvLowering/AArch64/struct.c b/clang/test/CIR/CallConvLowering/AArch64/struct.c index f7995777b80a..f73fbbcc4aa7 100644 --- a/clang/test/CIR/CallConvLowering/AArch64/struct.c +++ b/clang/test/CIR/CallConvLowering/AArch64/struct.c @@ -7,7 +7,7 @@ typedef struct { int a, b; } S; -// CIR: cir.func @init(%arg0: !u64i +// CIR: cir.func dso_local @init(%arg0: !u64i // CIR: %[[#V0:]] = cir.alloca !rec_S, !cir.ptr, [""] {alignment = 4 : i64} // CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: cir.store{{.*}} %arg0, %[[#V1]] : !u64i, !cir.ptr @@ -40,7 +40,7 @@ S init(S s) { return s; } -// CIR: cir.func no_proto @foo1 +// CIR: cir.func no_proto dso_local @foo1 // CIR: %[[#V0:]] = cir.alloca !rec_S, !cir.ptr, ["s"] // CIR: %[[#V1:]] = cir.alloca !rec_S, !cir.ptr, ["tmp"] {alignment = 4 : i64} // CIR: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr @@ -63,7 +63,7 @@ void foo1() { s = init(s); } -// CIR: cir.func @foo2(%arg0: !u64i +// CIR: cir.func dso_local @foo2(%arg0: !u64i // CIR: %[[#V0:]] = cir.alloca !rec_S, !cir.ptr, [""] {alignment = 4 : i64} // CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: cir.store{{.*}} %arg0, %[[#V1]] : !u64i, !cir.ptr @@ -108,7 +108,7 @@ typedef struct { char b; } S2; -// CIR: cir.func @init2(%arg0: !u16i +// CIR: cir.func dso_local @init2(%arg0: !u16i // CIR: %[[#V0:]] = cir.alloca !rec_S2, !cir.ptr, [""] {alignment = 4 : i64} // CIR: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr // CIR: cir.store{{.*}} %arg0, %[[#V1]] : !u16i, !cir.ptr @@ -143,7 +143,7 @@ S2 init2(S2 s) { return s; } -// CIR: cir.func no_proto @foo3() +// CIR: cir.func no_proto dso_local @foo3() // CIR: %[[#V0:]] = cir.alloca !rec_S2, !cir.ptr, ["s"] // CIR: %[[#V1:]] = cir.alloca !rec_S2, !cir.ptr, ["tmp"] {alignment = 1 : i64} // CIR: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr diff --git a/clang/test/CIR/CallConvLowering/AArch64/union.c b/clang/test/CIR/CallConvLowering/AArch64/union.c index 2dc27a2a9333..040e7de31f09 100644 --- a/clang/test/CIR/CallConvLowering/AArch64/union.c +++ b/clang/test/CIR/CallConvLowering/AArch64/union.c @@ -9,7 +9,7 @@ typedef union { int a, b, c; } U; -// CIR: cir.func @foo(%arg0: !u64i +// CIR: cir.func dso_local @foo(%arg0: !u64i // CIR: %[[#V0:]] = cir.alloca !rec_U, !cir.ptr, [""] {alignment = 4 : i64} // CIR: %[[#V1:]] = cir.cast(integral, %arg0 : !u64i), !u32i // CIR: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr @@ -23,7 +23,7 @@ typedef union { // LLVM: ret void void foo(U u) {} -// CIR: cir.func no_proto @init() -> !u32i +// CIR: cir.func no_proto dso_local @init() -> !u32i // CIR: %[[#V0:]] = cir.alloca !rec_U, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CIR: %[[#V1:]] = cir.load %[[#V0]] : !cir.ptr, !rec_U // CIR: %[[#V2:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr diff --git a/clang/test/CIR/CallConvLowering/NVPTX/basic.cpp b/clang/test/CIR/CallConvLowering/NVPTX/basic.cpp index 1e7576c1a15b..b03f2f3e9626 100644 --- a/clang/test/CIR/CallConvLowering/NVPTX/basic.cpp +++ b/clang/test/CIR/CallConvLowering/NVPTX/basic.cpp @@ -17,61 +17,61 @@ bool Bool(bool a) { return Bool(a); } -// CHECK: cir.func @_Z5UCharh(%arg0: !u8i {cir.zeroext} loc({{.+}})) -> (!u8i {cir.zeroext}) +// CHECK: cir.func dso_local @_Z5UCharh(%arg0: !u8i {cir.zeroext} loc({{.+}})) -> (!u8i {cir.zeroext}) unsigned char UChar(unsigned char c) { // CHECK: cir.call @_Z5UCharh(%{{.+}}) : (!u8i) -> !u8i return UChar(c); } -// CHECK: cir.func @_Z6UShortt(%arg0: !u16i {cir.zeroext} loc({{.+}})) -> (!u16i {cir.zeroext}) +// CHECK: cir.func dso_local @_Z6UShortt(%arg0: !u16i {cir.zeroext} loc({{.+}})) -> (!u16i {cir.zeroext}) unsigned short UShort(unsigned short s) { // CHECK: cir.call @_Z6UShortt(%{{.+}}) : (!u16i) -> !u16i return UShort(s); } -// CHECK: cir.func @_Z4UIntj(%arg0: !u32i loc({{.+}})) -> !u32i +// CHECK: cir.func dso_local @_Z4UIntj(%arg0: !u32i loc({{.+}})) -> !u32i unsigned int UInt(unsigned int i) { // CHECK: cir.call @_Z4UIntj(%{{.+}}) : (!u32i) -> !u32i return UInt(i); } -// CHECK: cir.func @_Z5ULongm(%arg0: !u32i loc({{.+}})) -> !u32i +// CHECK: cir.func dso_local @_Z5ULongm(%arg0: !u32i loc({{.+}})) -> !u32i unsigned long ULong(unsigned long l) { // CHECK: cir.call @_Z5ULongm(%{{.+}}) : (!u32i) -> !u32i return ULong(l); } -// CHECK: cir.func @_Z9ULongLongy(%arg0: !u64i loc({{.+}})) -> !u64i +// CHECK: cir.func dso_local @_Z9ULongLongy(%arg0: !u64i loc({{.+}})) -> !u64i unsigned long long ULongLong(unsigned long long l) { // CHECK: cir.call @_Z9ULongLongy(%{{.+}}) : (!u64i) -> !u64i return ULongLong(l); } -// CHECK: cir.func @_Z4Chara(%arg0: !s8i {cir.signext} loc({{.+}})) -> (!s8i {cir.signext}) +// CHECK: cir.func dso_local @_Z4Chara(%arg0: !s8i {cir.signext} loc({{.+}})) -> (!s8i {cir.signext}) char Char(signed char c) { // CHECK: cir.call @_Z4Chara(%{{.+}}) : (!s8i) -> !s8i return Char(c); } -// CHECK: cir.func @_Z5Shorts(%arg0: !s16i {cir.signext} loc({{.+}})) -> (!s16i {cir.signext}) +// CHECK: cir.func dso_local @_Z5Shorts(%arg0: !s16i {cir.signext} loc({{.+}})) -> (!s16i {cir.signext}) short Short(short s) { // CHECK: cir.call @_Z5Shorts(%{{.+}}) : (!s16i) -> !s16i return Short(s); } -// CHECK: cir.func @_Z3Inti(%arg0: !s32i loc({{.+}})) -> !s32i +// CHECK: cir.func dso_local @_Z3Inti(%arg0: !s32i loc({{.+}})) -> !s32i int Int(int i) { // CHECK: cir.call @_Z3Inti(%{{.+}}) : (!s32i) -> !s32i return Int(i); } -// CHECK: cir.func @_Z4Longl(%arg0: !s32i loc({{.+}})) -> !s32i +// CHECK: cir.func dso_local @_Z4Longl(%arg0: !s32i loc({{.+}})) -> !s32i long Long(long l) { // CHECK: cir.call @_Z4Longl(%{{.+}}) : (!s32i) -> !s32i return Long(l); } -// CHECK: cir.func @_Z8LongLongx(%arg0: !s64i loc({{.+}})) -> !s64i +// CHECK: cir.func dso_local @_Z8LongLongx(%arg0: !s64i loc({{.+}})) -> !s64i long long LongLong(long long l) { // CHECK: cir.call @_Z8LongLongx(%{{.+}}) : (!s64i) -> !s64i return LongLong(l); @@ -84,7 +84,7 @@ struct Struct { int a, b, c, d, e; }; -// CHECK: cir.func @_Z10StructFuncv() -> !rec_Struct +// CHECK: cir.func dso_local @_Z10StructFuncv() -> !rec_Struct Struct StructFunc() { return { 0, 1, 2, 3, 4 }; } diff --git a/clang/test/CIR/CallConvLowering/x86_64/basic.cpp b/clang/test/CIR/CallConvLowering/x86_64/basic.cpp index fc38ef659a6e..b7a25fd57de0 100644 --- a/clang/test/CIR/CallConvLowering/x86_64/basic.cpp +++ b/clang/test/CIR/CallConvLowering/x86_64/basic.cpp @@ -21,27 +21,27 @@ bool Bool(bool a) { return Bool(a); } -// CHECK: cir.func @_Z5UCharh(%arg0: !u8i {cir.zeroext} loc({{.+}})) -> (!u8i {cir.zeroext}) +// CHECK: cir.func dso_local @_Z5UCharh(%arg0: !u8i {cir.zeroext} loc({{.+}})) -> (!u8i {cir.zeroext}) unsigned char UChar(unsigned char c) { // CHECK: cir.call @_Z5UCharh(%2) : (!u8i) -> !u8i return UChar(c); } -// CHECK: cir.func @_Z6UShortt(%arg0: !u16i {cir.zeroext} loc({{.+}})) -> (!u16i {cir.zeroext}) +// CHECK: cir.func dso_local @_Z6UShortt(%arg0: !u16i {cir.zeroext} loc({{.+}})) -> (!u16i {cir.zeroext}) unsigned short UShort(unsigned short s) { // CHECK: cir.call @_Z6UShortt(%2) : (!u16i) -> !u16i return UShort(s); } -// CHECK: cir.func @_Z4UIntj(%arg0: !u32i loc({{.+}})) -> !u32i +// CHECK: cir.func dso_local @_Z4UIntj(%arg0: !u32i loc({{.+}})) -> !u32i unsigned int UInt(unsigned int i) { // CHECK: cir.call @_Z4UIntj(%2) : (!u32i) -> !u32i return UInt(i); } -// CHECK: cir.func @_Z5ULongm(%arg0: !u64i loc({{.+}})) -> !u64i +// CHECK: cir.func dso_local @_Z5ULongm(%arg0: !u64i loc({{.+}})) -> !u64i unsigned long ULong(unsigned long l) { // CHECK: cir.call @_Z5ULongm(%2) : (!u64i) -> !u64i return ULong(l); } -// CHECK: cir.func @_Z9ULongLongy(%arg0: !u64i loc({{.+}})) -> !u64i +// CHECK: cir.func dso_local @_Z9ULongLongy(%arg0: !u64i loc({{.+}})) -> !u64i unsigned long long ULongLong(unsigned long long l) { // CHECK: cir.call @_Z9ULongLongy(%2) : (!u64i) -> !u64i return ULongLong(l); @@ -49,27 +49,27 @@ unsigned long long ULongLong(unsigned long long l) { /// Test call conv lowering for trivial signext cases. /// -// CHECK: cir.func @_Z4Chara(%arg0: !s8i {cir.signext} loc({{.+}})) -> (!s8i {cir.signext}) +// CHECK: cir.func dso_local @_Z4Chara(%arg0: !s8i {cir.signext} loc({{.+}})) -> (!s8i {cir.signext}) char Char(signed char c) { // CHECK: cir.call @_Z4Chara(%{{.+}}) : (!s8i) -> !s8i return Char(c); } -// CHECK: cir.func @_Z5Shorts(%arg0: !s16i {cir.signext} loc({{.+}})) -> (!s16i {cir.signext}) +// CHECK: cir.func dso_local @_Z5Shorts(%arg0: !s16i {cir.signext} loc({{.+}})) -> (!s16i {cir.signext}) short Short(short s) { // CHECK: cir.call @_Z5Shorts(%{{.+}}) : (!s16i) -> !s16i return Short(s); } -// CHECK: cir.func @_Z3Inti(%arg0: !s32i loc({{.+}})) -> !s32i +// CHECK: cir.func dso_local @_Z3Inti(%arg0: !s32i loc({{.+}})) -> !s32i int Int(int i) { // CHECK: cir.call @_Z3Inti(%{{.+}}) : (!s32i) -> !s32i return Int(i); } -// CHECK: cir.func @_Z4Longl(%arg0: !s64i loc({{.+}})) -> !s64i +// CHECK: cir.func dso_local @_Z4Longl(%arg0: !s64i loc({{.+}})) -> !s64i long Long(long l) { // CHECK: cir.call @_Z4Longl(%{{.+}}) : (!s64i) -> !s64i return Long(l); } -// CHECK: cir.func @_Z8LongLongx(%arg0: !s64i loc({{.+}})) -> !s64i +// CHECK: cir.func dso_local @_Z8LongLongx(%arg0: !s64i loc({{.+}})) -> !s64i long long LongLong(long long l) { // CHECK: cir.call @_Z8LongLongx(%{{.+}}) : (!s64i) -> !s64i return LongLong(l); @@ -77,12 +77,12 @@ long long LongLong(long long l) { /// Test call conv lowering for floating point. /// -// CHECK: cir.func @_Z5Floatf(%arg0: !cir.float loc({{.+}})) -> !cir.float +// CHECK: cir.func dso_local @_Z5Floatf(%arg0: !cir.float loc({{.+}})) -> !cir.float float Float(float f) { // cir.call @_Z5Floatf(%{{.+}}) : (!cir.float) -> !cir.float return Float(f); } -// CHECK: cir.func @_Z6Doubled(%arg0: !cir.double loc({{.+}})) -> !cir.double +// CHECK: cir.func dso_local @_Z6Doubled(%arg0: !cir.double loc({{.+}})) -> !cir.double double Double(double d) { // cir.call @_Z6Doubled(%{{.+}}) : (!cir.double) -> !cir.double return Double(d); @@ -135,7 +135,7 @@ struct S2 { // COM: Function prologue -// CHECK: cir.func @_Z2s22S2(%[[ARG0:[a-z0-9]+]]: !u64i {{.*}}, %[[ARG1:[a-z0-9]+]]: !s32i {{.*}}) -> !rec_anon_struct +// CHECK: cir.func dso_local @_Z2s22S2(%[[ARG0:[a-z0-9]+]]: !u64i {{.*}}, %[[ARG1:[a-z0-9]+]]: !s32i {{.*}}) -> !rec_anon_struct // CHECK: %[[#F0:]] = cir.alloca !rec_S2, !cir.ptr // CHECK: %[[#F1:]] = cir.alloca !rec_anon_struct, !cir.ptr // CHECK: %[[#F2:]] = cir.get_member %[[#F1]][0]{{.*}} : !cir.ptr -> !cir.ptr @@ -154,7 +154,7 @@ S2 s2(S2 arg) { // CHECK: %[[#F11:]] = cir.alloca !rec_S2, !cir.ptr, ["tmp"] {alignment = 4 : i64} // CHECK: %[[#F12:]] = cir.alloca !rec_anon_struct, !cir.ptr, ["tmp"] {alignment = 8 : i64} // CHECK: %[[#F13:]] = cir.alloca !rec_anon_struct, !cir.ptr, ["tmp"] {alignment = 8 : i64} - + // COM: Construction of S2 { 1, 2, 3 }. // CHECK: %[[#F14:]] = cir.get_member %[[#F8]][0] {{.*}} : !cir.ptr -> !cir.ptr diff --git a/clang/test/CIR/CodeGen/AArch64/neon-arith.c b/clang/test/CIR/CodeGen/AArch64/neon-arith.c index ebcca6b1b2a5..ba2f2cb6958d 100644 --- a/clang/test/CIR/CodeGen/AArch64/neon-arith.c +++ b/clang/test/CIR/CodeGen/AArch64/neon-arith.c @@ -14,21 +14,21 @@ // REQUIRES: aarch64-registered-target || arm-registered-target #include -// This test file contains tests for aarch64 NEON arithmetic intrinsics +// This test file contains tests for aarch64 NEON arithmetic intrinsics // that are not vector type related. float32_t test_vrndns_f32(float32_t a) { return vrndns_f32(a); } -// CIR: cir.func internal private @vrndns_f32(%arg0: !cir.float {{.*}}) -> !cir.float -// CIR: cir.store %arg0, [[ARG_SAVE:%.*]] : !cir.float, !cir.ptr -// CIR: [[INTRIN_ARG:%.*]] = cir.load{{.*}} [[ARG_SAVE]] : !cir.ptr, !cir.float +// CIR: cir.func internal private dso_local @vrndns_f32(%arg0: !cir.float {{.*}}) -> !cir.float +// CIR: cir.store %arg0, [[ARG_SAVE:%.*]] : !cir.float, !cir.ptr +// CIR: [[INTRIN_ARG:%.*]] = cir.load{{.*}} [[ARG_SAVE]] : !cir.ptr, !cir.float // CIR: {{%.*}} = cir.roundeven [[INTRIN_ARG]] : !cir.float // CIR: cir.return {{%.*}} : !cir.float // CIR-LABEL: test_vrndns_f32 -// CIR: cir.store %arg0, [[ARG_SAVE0:%.*]] : !cir.float, !cir.ptr -// CIR: [[FUNC_ARG:%.*]] = cir.load{{.*}} [[ARG_SAVE]] : !cir.ptr, !cir.float +// CIR: cir.store %arg0, [[ARG_SAVE0:%.*]] : !cir.float, !cir.ptr +// CIR: [[FUNC_ARG:%.*]] = cir.load{{.*}} [[ARG_SAVE]] : !cir.ptr, !cir.float // CIR: [[FUNC_RES:%.*]] = cir.call @vrndns_f32([[FUNC_ARG]]) : (!cir.float) -> !cir.float // CIR: cir.store [[FUNC_RES]], [[RET_P:%.*]] : !cir.float, !cir.ptr // CIR: [[RET_VAL:%.*]] = cir.load{{.*}} [[RET_P]] : !cir.ptr, !cir.float @@ -42,7 +42,7 @@ float32x2_t test_vrnda_f32(float32x2_t a) { return vrnda_f32(a); } -// CIR: cir.func internal private @vrnda_f32(%arg0: !cir.vector +// CIR: cir.func internal private dso_local @vrnda_f32(%arg0: !cir.vector // CIR: cir.store %arg0, [[ARG_SAVE:%.*]] : !cir.vector, !cir.ptr> // CIR: [[INTRIN_ARG:%.*]] = cir.load{{.*}} [[ARG_SAVE]] : !cir.ptr>, !cir.vector // CIR: [[INTRIN_ARG_CAST:%.*]] = cir.cast(bitcast, [[INTRIN_ARG]] : !cir.vector), !cir.vector @@ -51,8 +51,8 @@ float32x2_t test_vrnda_f32(float32x2_t a) { // CIR: cir.return {{%.*}} : !cir.vector // CIR-LABEL: test_vrnda_f32 -// CIR: cir.store %arg0, [[ARG_SAVE0:%.*]] : !cir.vector, !cir.ptr> -// CIR: [[FUNC_ARG:%.*]] = cir.load{{.*}} [[ARG_SAVE]] : !cir.ptr>, !cir.vector +// CIR: cir.store %arg0, [[ARG_SAVE0:%.*]] : !cir.vector, !cir.ptr> +// CIR: [[FUNC_ARG:%.*]] = cir.load{{.*}} [[ARG_SAVE]] : !cir.ptr>, !cir.vector // CIR: [[FUNC_RES:%.*]] = cir.call @vrnda_f32([[FUNC_ARG]]) : (!cir.vector) -> !cir.vector // CIR: cir.store [[FUNC_RES]], [[RET_P:%.*]] : !cir.vector, !cir.ptr> // CIR: [[RET_VAL:%.*]] = cir.load{{.*}} [[RET_P]] : !cir.ptr>, !cir.vector @@ -66,7 +66,7 @@ float32x4_t test_vrndaq_f32(float32x4_t a) { return vrndaq_f32(a); } -// CIR: cir.func internal private @vrndaq_f32(%arg0: !cir.vector +// CIR: cir.func internal private dso_local @vrndaq_f32(%arg0: !cir.vector // CIR: cir.store %arg0, [[ARG_SAVE:%.*]] : !cir.vector, !cir.ptr> // CIR: [[INTRIN_ARG:%.*]] = cir.load{{.*}} [[ARG_SAVE]] : !cir.ptr>, !cir.vector // CIR: [[INTRIN_ARG_CAST:%.*]] = cir.cast(bitcast, [[INTRIN_ARG]] : !cir.vector), !cir.vector @@ -83,7 +83,7 @@ int8x8_t test_vpadd_s8(int8x8_t a, int8x8_t b) { } // CIR-LABEL: vpadd_s8 -// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : +// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vpadd_s8(<8 x i8>{{.*}}[[A:%.*]], <8 x i8>{{.*}}[[B:%.*]]) @@ -96,7 +96,7 @@ int8x16_t test_vpaddq_s8(int8x16_t a, int8x16_t b) { } // CIR-LABEL: vpaddq_s8 -// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : +// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vpaddq_s8(<16 x i8>{{.*}}[[A:%.*]], <16 x i8>{{.*}}[[B:%.*]]) @@ -108,7 +108,7 @@ uint8x8_t test_vpadd_u8(uint8x8_t a, uint8x8_t b) { } // CIR-LABEL: vpadd_u8 -// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : +// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vpadd_u8(<8 x i8>{{.*}}[[A:%.*]], <8 x i8>{{.*}}[[B:%.*]]) @@ -120,7 +120,7 @@ int16x4_t test_vpadd_s16(int16x4_t a, int16x4_t b) { } // CIR-LABEL: vpadd_s16 -// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : +// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // CIR: {{%.*}} = cir.cast(bitcast, [[RES]] : !cir.vector), !cir.vector @@ -133,7 +133,7 @@ int16x8_t test_vpaddq_s16(int16x8_t a, int16x8_t b) { } // CIR-LABEL: vpaddq_s16 -// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : +// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // CIR: {{%.*}} = cir.cast(bitcast, [[RES]] : !cir.vector), !cir.vector @@ -146,7 +146,7 @@ uint16x4_t test_vpadd_u16(uint16x4_t a, uint16x4_t b) { } // CIR-LABEL: vpadd_u16 -// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : +// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // CIR: {{%.*}} = cir.cast(bitcast, [[RES]] : !cir.vector), !cir.vector @@ -159,7 +159,7 @@ int32x2_t test_vpadd_s32(int32x2_t a, int32x2_t b) { } // CIR-LABEL: vpadd_s32 -// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : +// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // CIR: {{%.*}} = cir.cast(bitcast, [[RES]] : !cir.vector), !cir.vector @@ -172,7 +172,7 @@ int32x4_t test_vpaddq_s32(int32x4_t a, int32x4_t b) { } // CIR-LABEL: vpaddq_s32 -// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : +// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // CIR: {{%.*}} = cir.cast(bitcast, [[RES]] : !cir.vector), !cir.vector @@ -185,7 +185,7 @@ float32x2_t test_vpadd_f32(float32x2_t a, float32x2_t b) { } // CIR-LABEL: vpadd_f32 -// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : +// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // CIR: {{%.*}} = cir.cast(bitcast, [[RES]] : !cir.vector), !cir.vector @@ -198,7 +198,7 @@ float32x4_t test_vpaddq_f32(float32x4_t a, float32x4_t b) { } // CIR-LABEL: vpaddq_f32 -// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : +// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // CIR: {{%.*}} = cir.cast(bitcast, [[RES]] : !cir.vector), !cir.vector @@ -211,7 +211,7 @@ float64x2_t test_vpaddq_f64(float64x2_t a, float64x2_t b) { } // CIR-LABEL: vpaddq_f64 -// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : +// CIR: [[RES:%.*]] = cir.llvm.intrinsic "aarch64.neon.addp" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // CIR: {{%.*}} = cir.cast(bitcast, [[RES]] : !cir.vector), !cir.vector @@ -225,7 +225,7 @@ int16x4_t test_vqdmulh_lane_s16(int16x4_t a, int16x4_t v) { // CIR-LABEL: vqdmulh_lane_s16 // CIR: [[LANE:%.*]] = cir.const #cir.int<3> : !s32i -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : // CIR: (!cir.vector, !cir.vector, !s32i) -> !cir.vector // LLVM: {{.*}}test_vqdmulh_lane_s16(<4 x i16>{{.*}}[[A:%.*]], <4 x i16>{{.*}}[[V:%.*]]) @@ -240,7 +240,7 @@ int32x2_t test_vqdmulh_lane_s32(int32x2_t a, int32x2_t v) { // CIR-LABEL: vqdmulh_lane_s32 // CIR: [[LANE:%.*]] = cir.const #cir.int<1> : !s32i -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : // CIR: (!cir.vector, !cir.vector, !s32i) -> !cir.vector // LLVM: {{.*}}test_vqdmulh_lane_s32(<2 x i32>{{.*}}[[A:%.*]], <2 x i32>{{.*}}[[V:%.*]]) @@ -254,7 +254,7 @@ int16x8_t test_vqdmulhq_lane_s16(int16x8_t a, int16x4_t v) { // CIR-LABEL: vqdmulhq_lane_s16 // CIR: [[LANE:%.*]] = cir.const #cir.int<3> : !s32i -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : // CIR: (!cir.vector, !cir.vector, !s32i) -> !cir.vector // LLVM: {{.*}}test_vqdmulhq_lane_s16(<8 x i16>{{.*}}[[A:%.*]], <4 x i16>{{.*}}[[V:%.*]]) @@ -268,7 +268,7 @@ int32x4_t test_vqdmulhq_lane_s32(int32x4_t a, int32x2_t v) { // CIR-LABEL: vqdmulhq_lane_s32 // CIR: [[LANE:%.*]] = cir.const #cir.int<1> : !s32i -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : // CIR: (!cir.vector, !cir.vector, !s32i) -> !cir.vector // LLVM: {{.*}}test_vqdmulhq_lane_s32(<4 x i32>{{.*}}[[A:%.*]], <2 x i32>{{.*}}[[V:%.*]]) @@ -282,7 +282,7 @@ int16x4_t test_vqrdmulh_lane_s16(int16x4_t a, int16x4_t v) { // CIR-LABEL: vqrdmulh_lane_s16 // CIR: [[LANE:%.*]] = cir.const #cir.int<3> : !s32i -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqrdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqrdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : // CIR-SAME: (!cir.vector, !cir.vector, !s32i) -> !cir.vector // LLVM: {{.*}}test_vqrdmulh_lane_s16(<4 x i16>{{.*}}[[A:%.*]], <4 x i16>{{.*}}[[V:%.*]]) @@ -296,7 +296,7 @@ int16x8_t test_vqrdmulhq_lane_s16(int16x8_t a, int16x4_t v) { // CIR-LABEL: vqrdmulhq_lane_s16 // CIR: [[LANE:%.*]] = cir.const #cir.int<3> : !s32i -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqrdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqrdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : // CIR-SAME: (!cir.vector, !cir.vector, !s32i) -> !cir.vector // LLVM: {{.*}}test_vqrdmulhq_lane_s16(<8 x i16>{{.*}}[[A:%.*]], <4 x i16>{{.*}}[[V:%.*]]) @@ -310,7 +310,7 @@ int32x2_t test_vqrdmulh_lane_s32(int32x2_t a, int32x2_t v) { // CIR-LABEL: vqrdmulh_lane_s32 // CIR: [[LANE:%.*]] = cir.const #cir.int<1> : !s32i -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqrdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqrdmulh.lane" {{%.*}}, {{%.*}}, [[LANE]] : // CIR-SAME: (!cir.vector, !cir.vector, !s32i) -> !cir.vector // LLVM: {{.*}}test_vqrdmulh_lane_s32(<2 x i32>{{.*}}[[A:%.*]], <2 x i32>{{.*}}[[V:%.*]]) @@ -337,7 +337,7 @@ int8x16_t test_vqaddq_s8(int8x16_t a, int8x16_t b) { } // CIR-LABEL: vqaddq_s8 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqadd" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqadd" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqaddq_s8(<16 x i8>{{.*}} [[A:%.*]], <16 x i8>{{.*}} [[B:%.*]]) @@ -349,7 +349,7 @@ uint8x16_t test_vqaddq_u8(uint8x16_t a, uint8x16_t b) { } // CIR-LABEL: vqaddq_u8 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqadd" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqadd" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqaddq_u8(<16 x i8>{{.*}} [[A:%.*]], <16 x i8>{{.*}} [[B:%.*]]) @@ -361,7 +361,7 @@ int16x8_t test_vqaddq_s16(int16x8_t a, int16x8_t b) { } // CIR-LABEL: vqaddq_s16 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqadd" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqadd" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqaddq_s16(<8 x i16>{{.*}} [[A:%.*]], <8 x i16>{{.*}} [[B:%.*]]) @@ -373,7 +373,7 @@ uint16x8_t test_vqaddq_u16(uint16x8_t a, uint16x8_t b) { } // CIR-LABEL: vqaddq_u16 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqadd" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqadd" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqaddq_u16(<8 x i16>{{.*}} [[A:%.*]], <8 x i16>{{.*}} [[B:%.*]]) @@ -385,7 +385,7 @@ int32x4_t test_vqaddq_s32(int32x4_t a, int32x4_t b) { } // CIR-LABEL: vqaddq_s32 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqadd" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqadd" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqaddq_s32(<4 x i32>{{.*}} [[A:%.*]], <4 x i32>{{.*}} [[B:%.*]]) @@ -397,7 +397,7 @@ int64x2_t test_vqaddq_s64(int64x2_t a, int64x2_t b) { } // CIR-LABEL: vqaddq_s64 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqadd" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqadd" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqaddq_s64(<2 x i64>{{.*}} [[A:%.*]], <2 x i64>{{.*}} [[B:%.*]]) @@ -409,7 +409,7 @@ uint64x2_t test_vqaddq_u64(uint64x2_t a, uint64x2_t b) { } // CIR-LABEL: vqaddq_u64 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqadd" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqadd" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqaddq_u64(<2 x i64>{{.*}} [[A:%.*]], <2 x i64>{{.*}} [[B:%.*]]) @@ -421,7 +421,7 @@ int8x8_t test_vqsub_s8(int8x8_t a, int8x8_t b) { } // CIR-LABEL: vqsub_s8 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsub_s8(<8 x i8>{{.*}} [[A:%.*]], <8 x i8>{{.*}} [[B:%.*]]) @@ -433,7 +433,7 @@ uint8x8_t test_vqsub_u8(uint8x8_t a, uint8x8_t b) { } // CIR-LABEL: vqsub_u8 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsub_u8(<8 x i8>{{.*}} [[A:%.*]], <8 x i8>{{.*}} [[B:%.*]]) @@ -445,7 +445,7 @@ int16x4_t test_vqsub_s16(int16x4_t a, int16x4_t b) { } // CIR-LABEL: vqsub_s16 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsub_s16(<4 x i16>{{.*}} [[A:%.*]], <4 x i16>{{.*}} [[B:%.*]]) @@ -457,7 +457,7 @@ uint16x4_t test_vqsub_u16(uint16x4_t a, uint16x4_t b) { } // CIR-LABEL: vqsub_u16 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsub_u16(<4 x i16>{{.*}} [[A:%.*]], <4 x i16>{{.*}} [[B:%.*]]) @@ -469,7 +469,7 @@ int32x2_t test_vqsub_s32(int32x2_t a, int32x2_t b) { } // CIR-LABEL: vqsub_s32 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsub_s32(<2 x i32>{{.*}} [[A:%.*]], <2 x i32>{{.*}} [[B:%.*]]) @@ -481,7 +481,7 @@ uint32x2_t test_vqsub_u32(uint32x2_t a, uint32x2_t b) { } // CIR-LABEL: vqsub_u32 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsub_u32(<2 x i32>{{.*}} [[A:%.*]], <2 x i32>{{.*}} [[B:%.*]]) @@ -493,7 +493,7 @@ int64x1_t test_vqsub_s64(int64x1_t a, int64x1_t b) { } // CIR-LABEL: vqsub_s64 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsub_s64(<1 x i64>{{.*}} [[A:%.*]], <1 x i64>{{.*}} [[B:%.*]]) @@ -505,7 +505,7 @@ uint64x1_t test_vqsub_u64(uint64x1_t a, uint64x1_t b) { } // CIR-LABEL: vqsub_u64 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsub_u64(<1 x i64>{{.*}} [[A:%.*]], <1 x i64>{{.*}} [[B:%.*]]) @@ -517,7 +517,7 @@ int8x16_t test_vqsubq_s8(int8x16_t a, int8x16_t b) { } // CIR-LABEL: vqsubq_s8 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsubq_s8(<16 x i8>{{.*}} [[A:%.*]], <16 x i8>{{.*}} [[B:%.*]]) @@ -529,19 +529,19 @@ uint8x16_t test_vqsubq_u8(uint8x16_t a, uint8x16_t b) { } // CIR-LABEL: vqsubq_u8 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsubq_u8(<16 x i8>{{.*}} [[A:%.*]], <16 x i8>{{.*}} [[B:%.*]]) // LLVM: [[RES:%.*]] = call <16 x i8> @llvm.aarch64.neon.uqsub.v16i8(<16 x i8> [[A]], <16 x i8> [[B]]) // LLVM: ret <16 x i8> [[RES]] -int16x8_t test_vqsubq_s16(int16x8_t a, int16x8_t b) { +int16x8_t test_vqsubq_s16(int16x8_t a, int16x8_t b) { return vqsubq_s16(a, b); } // CIR-LABEL: vqsubq_s16 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsubq_s16(<8 x i16>{{.*}} [[A:%.*]], <8 x i16>{{.*}} [[B:%.*]]) @@ -553,7 +553,7 @@ uint16x8_t test_vqsubq_u16(uint16x8_t a, uint16x8_t b) { } // CIR-LABEL: vqsubq_u16 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsubq_u16(<8 x i16>{{.*}} [[A:%.*]], <8 x i16>{{.*}} [[B:%.*]]) @@ -565,7 +565,7 @@ int32x4_t test_vqsubq_s32(int32x4_t a, int32x4_t b) { } // CIR-LABEL: vqsubq_s32 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsubq_s32(<4 x i32>{{.*}} [[A:%.*]], <4 x i32>{{.*}} [[B:%.*]]) @@ -577,7 +577,7 @@ uint32x4_t test_vqsubq_u32(uint32x4_t a, uint32x4_t b) { } // CIR-LABEL: vqsubq_u32 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsubq_u32(<4 x i32>{{.*}} [[A:%.*]], <4 x i32>{{.*}} [[B:%.*]]) @@ -589,7 +589,7 @@ int64x2_t test_vqsubq_s64(int64x2_t a, int64x2_t b) { } // CIR-LABEL: vqsubq_s64 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.sqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsubq_s64(<2 x i64>{{.*}} [[A:%.*]], <2 x i64>{{.*}} [[B:%.*]]) @@ -601,7 +601,7 @@ uint64x2_t test_vqsubq_u64(uint64x2_t a, uint64x2_t b) { } // CIR-LABEL: vqsubq_u64 -// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : +// CIR: {{%.*}} = cir.llvm.intrinsic "aarch64.neon.uqsub" {{%.*}}, {{%.*}} : // CIR-SAME: (!cir.vector, !cir.vector) -> !cir.vector // LLVM: {{.*}}test_vqsubq_u64(<2 x i64>{{.*}} [[A:%.*]], <2 x i64>{{.*}} [[B:%.*]]) diff --git a/clang/test/CIR/CodeGen/CUDA/address-spaces.cu b/clang/test/CIR/CodeGen/CUDA/address-spaces.cu index 89605735d393..b25977f1305a 100644 --- a/clang/test/CIR/CodeGen/CUDA/address-spaces.cu +++ b/clang/test/CIR/CodeGen/CUDA/address-spaces.cu @@ -11,8 +11,8 @@ __global__ void fn() { j = i; } -// CIR: cir.global "private" internal dsolocal addrspace(offload_local) @_ZZ2fnvE1j : !s32i -// CIR: cir.func @_Z2fnv +// CIR: cir.global "private" internal dso_local addrspace(offload_local) @_ZZ2fnvE1j : !s32i +// CIR: cir.func dso_local @_Z2fnv // CIR: [[Local:%[0-9]+]] = cir.alloca !s32i, !cir.ptr, ["i", init] // CIR: [[Shared:%[0-9]+]] = cir.get_global @_ZZ2fnvE1j : !cir.ptr // CIR: [[Tmp:%[0-9]+]] = cir.load {{.*}} [[Local]] : !cir.ptr, !s32i diff --git a/clang/test/CIR/CodeGen/CUDA/destructor.cu b/clang/test/CIR/CodeGen/CUDA/destructor.cu index 53605187f946..8dfc05af3992 100644 --- a/clang/test/CIR/CodeGen/CUDA/destructor.cu +++ b/clang/test/CIR/CodeGen/CUDA/destructor.cu @@ -17,7 +17,7 @@ template struct A { ~A() { f<<<1, 1>>>(T()); } }; -// CIR-DEVICE: cir.func @_Z1fIiEvT_ +// CIR-DEVICE: cir.func dso_local @_Z1fIiEvT_ // CIR-HOST: cir.func {{.*}} @_ZN1AIiED2Ev{{.*}} { // CIR-HOST: cir.call @__cudaPushCallConfiguration diff --git a/clang/test/CIR/CodeGen/CUDA/mangling.cu b/clang/test/CIR/CodeGen/CUDA/mangling.cu index 27b9bc96bd7c..3c8306df9e89 100644 --- a/clang/test/CIR/CodeGen/CUDA/mangling.cu +++ b/clang/test/CIR/CodeGen/CUDA/mangling.cu @@ -12,81 +12,81 @@ namespace ns { __global__ void cpp_global_function_1(int a, int* b, float c) {} - // CIR-HOST: cir.func @_ZN2ns36__device_stub__cpp_global_function_1EiPif - // CIR-DEVICE: cir.func @_ZN2ns21cpp_global_function_1EiPif + // CIR-HOST: cir.func dso_local @_ZN2ns36__device_stub__cpp_global_function_1EiPif + // CIR-DEVICE: cir.func dso_local @_ZN2ns21cpp_global_function_1EiPif __global__ void cpp_global_function_2(int a, int* b, float c) {} - // CIR-HOST: cir.func @_ZN2ns36__device_stub__cpp_global_function_2EiPif - // CIR-DEVICE: cir.func @_ZN2ns21cpp_global_function_2EiPif + // CIR-HOST: cir.func dso_local @_ZN2ns36__device_stub__cpp_global_function_2EiPif + // CIR-DEVICE: cir.func dso_local @_ZN2ns21cpp_global_function_2EiPif __host__ void cpp_host_function_1(int a, int* b, float c) {} - // CIR-HOST: cir.func @_ZN2ns19cpp_host_function_1EiPif + // CIR-HOST: cir.func dso_local @_ZN2ns19cpp_host_function_1EiPif __host__ void cpp_host_function_2(int a, int* b, float c) {} - // CIR-HOST: cir.func @_ZN2ns19cpp_host_function_2EiPif + // CIR-HOST: cir.func dso_local @_ZN2ns19cpp_host_function_2EiPif __device__ void cpp_device_function_1(int a, int* b, float c) {} - // CIR-DEVICE: cir.func @_ZN2ns21cpp_device_function_1EiPif + // CIR-DEVICE: cir.func dso_local @_ZN2ns21cpp_device_function_1EiPif __device__ void cpp_device_function_2(int a, int* b, float c) {} - // CIR-DEVICE: cir.func @_ZN2ns21cpp_device_function_2EiPif + // CIR-DEVICE: cir.func dso_local @_ZN2ns21cpp_device_function_2EiPif } __global__ void cpp_global_function_1(int a, int* b, float c) {} -// CIR-HOST: cir.func @_Z36__device_stub__cpp_global_function_1iPif -// CIR-DEVICE: cir.func @_Z21cpp_global_function_1iPif +// CIR-HOST: cir.func dso_local @_Z36__device_stub__cpp_global_function_1iPif +// CIR-DEVICE: cir.func dso_local @_Z21cpp_global_function_1iPif __global__ void cpp_global_function_2(int a, int* b, float c) {} -// CIR-HOST: cir.func @_Z36__device_stub__cpp_global_function_2iPif -// CIR-DEVICE: cir.func @_Z21cpp_global_function_2iPif +// CIR-HOST: cir.func dso_local @_Z36__device_stub__cpp_global_function_2iPif +// CIR-DEVICE: cir.func dso_local @_Z21cpp_global_function_2iPif __host__ void cpp_host_function_1(int a, int* b, float c) {} -// CIR-HOST: cir.func @_Z19cpp_host_function_1iPif +// CIR-HOST: cir.func dso_local @_Z19cpp_host_function_1iPif __host__ void cpp_host_function_2(int a, int* b, float c) {} -// CIR-HOST: cir.func @_Z19cpp_host_function_2iPif +// CIR-HOST: cir.func dso_local @_Z19cpp_host_function_2iPif __device__ void cpp_device_function_1(int a, int* b, float c) {} -// CIR-DEVICE: cir.func @_Z21cpp_device_function_1iPif +// CIR-DEVICE: cir.func dso_local @_Z21cpp_device_function_1iPif __device__ void cpp_device_function_2(int a, int* b, float c) {} -// CIR-DEVICE: cir.func @_Z21cpp_device_function_2iPif +// CIR-DEVICE: cir.func dso_local @_Z21cpp_device_function_2iPif extern "C" { __global__ void c_global_function_1(int a, int* b, float c) {} - // CIR-HOST: cir.func @__device_stub__c_global_function_1 - // CIR-DEVICE: cir.func @c_global_function_1 + // CIR-HOST: cir.func dso_local @__device_stub__c_global_function_1 + // CIR-DEVICE: cir.func dso_local @c_global_function_1 __global__ void c_global_function_2(int a, int* b, float c) {} - // CIR-HOST: cir.func @__device_stub__c_global_function_2 - // CIR-DEVICE: cir.func @c_global_function_2 + // CIR-HOST: cir.func dso_local @__device_stub__c_global_function_2 + // CIR-DEVICE: cir.func dso_local @c_global_function_2 __host__ void c_host_function_1(int a, int* b, float c) {} - // CIR-HOST: cir.func @c_host_function_1 + // CIR-HOST: cir.func dso_local @c_host_function_1 __host__ void c_host_function_2(int a, int* b, float c) {} - // CIR-HOST: cir.func @c_host_function_2 + // CIR-HOST: cir.func dso_local @c_host_function_2 __device__ void c_device_function_1(int a, int* b, float c) {} - // CIR-DEVICE: cir.func @c_device_function_1 + // CIR-DEVICE: cir.func dso_local @c_device_function_1 __device__ void c_device_function_2(int a, int* b, float c) {} - // CIR-DEVICE: cir.func @c_device_function_2 -} \ No newline at end of file + // CIR-DEVICE: cir.func dso_local @c_device_function_2 +} diff --git a/clang/test/CIR/CodeGen/CUDA/printf.cu b/clang/test/CIR/CodeGen/CUDA/printf.cu index a693b491e6c1..250da31432a9 100644 --- a/clang/test/CIR/CodeGen/CUDA/printf.cu +++ b/clang/test/CIR/CodeGen/CUDA/printf.cu @@ -14,7 +14,7 @@ __device__ void printer() { printf("%d", 0); } -// CIR-DEVICE: cir.func @_Z7printerv() extra({{.*}}) { +// CIR-DEVICE: cir.func dso_local @_Z7printerv() extra({{.*}}) { // CIR-DEVICE: %[[#Packed:]] = cir.alloca !rec_anon_struct // CIR-DEVICE: %[[#Zero:]] = cir.const #cir.int<0> : !s32i loc(#loc5) // CIR-DEVICE: %[[#Field0:]] = cir.get_member %0[0] @@ -36,7 +36,7 @@ __device__ void no_extra() { printf("hello world"); } -// CIR-DEVICE: cir.func @_Z8no_extrav() extra(#fn_attr) { +// CIR-DEVICE: cir.func dso_local @_Z8no_extrav() extra(#fn_attr) { // CIR-DEVICE: %[[#NULLPTR:]] = cir.const #cir.ptr // CIR-DEVICE: cir.call @vprintf(%{{.+}}, %[[#NULLPTR]]) // CIR-DEVICE: cir.return diff --git a/clang/test/CIR/CodeGen/CUDA/simple-nvptx-triple.cu b/clang/test/CIR/CodeGen/CUDA/simple-nvptx-triple.cu index e5c1339cdd69..04ad44d788dd 100644 --- a/clang/test/CIR/CodeGen/CUDA/simple-nvptx-triple.cu +++ b/clang/test/CIR/CodeGen/CUDA/simple-nvptx-triple.cu @@ -6,4 +6,4 @@ // RUN: FileCheck --input-file=%t.cir %s __device__ void device_fn(int* a, double b, float c) {} -// CHECK: cir.func @_Z9device_fnPidf +// CHECK: cir.func dso_local @_Z9device_fnPidf diff --git a/clang/test/CIR/CodeGen/CUDA/simple.cu b/clang/test/CIR/CodeGen/CUDA/simple.cu index 9a5dd04f8d54..3c9c17d468f8 100644 --- a/clang/test/CIR/CodeGen/CUDA/simple.cu +++ b/clang/test/CIR/CodeGen/CUDA/simple.cu @@ -14,12 +14,12 @@ // CIR-HOST: [[Kernel:#[a-zA-Z_0-9]+]] = {{.*}}#cir.cu.kernel_name<_Z9global_fni>{{.*}} __host__ void host_fn(int *a, int *b, int *c) {} -// CIR-HOST: cir.func @_Z7host_fnPiS_S_ -// CIR-DEVICE-NOT: cir.func @_Z7host_fnPiS_S_ +// CIR-HOST: cir.func dso_local @_Z7host_fnPiS_S_ +// CIR-DEVICE-NOT: cir.func dso_local @_Z7host_fnPiS_S_ __device__ void device_fn(int* a, double b, float c) {} -// CIR-HOST-NOT: cir.func @_Z9device_fnPidf -// CIR-DEVICE: cir.func @_Z9device_fnPidf +// CIR-HOST-NOT: cir.func dso_local @_Z9device_fnPidf +// CIR-DEVICE: cir.func dso_local @_Z9device_fnPidf __global__ void global_fn(int a) {} // CIR-DEVICE: @_Z9global_fni({{.*}} cc(ptx_kernel) @@ -44,9 +44,9 @@ __global__ void global_fn(int a) {} int main() { global_fn<<<1, 1>>>(1); } -// CIR-DEVICE-NOT: cir.func @main() +// CIR-DEVICE-NOT: cir.func dso_local @main() -// CIR-HOST: cir.func @main() +// CIR-HOST: cir.func dso_local @main() // CIR-HOST: cir.call @_ZN4dim3C1Ejjj // CIR-HOST: cir.call @_ZN4dim3C1Ejjj // CIR-HOST: [[Push:%[0-9]+]] = cir.call @__cudaPushCallConfiguration diff --git a/clang/test/CIR/CodeGen/HIP/simple.cpp b/clang/test/CIR/CodeGen/HIP/simple.cpp index d4db01aa23b8..9c00b149e1c7 100644 --- a/clang/test/CIR/CodeGen/HIP/simple.cpp +++ b/clang/test/CIR/CodeGen/HIP/simple.cpp @@ -15,12 +15,12 @@ __host__ void host_fn(int *a, int *b, int *c) {} -// CIR-HOST: cir.func @_Z7host_fnPiS_S_ -// CIR-DEVICE-NOT: cir.func @_Z7host_fnPiS_S_ +// CIR-HOST: cir.func dso_local @_Z7host_fnPiS_S_ +// CIR-DEVICE-NOT: cir.func dso_local @_Z7host_fnPiS_S_ __device__ void device_fn(int* a, double b, float c) {} -// CIR-HOST-NOT: cir.func @_Z9device_fnPidf -// CIR-DEVICE: cir.func @_Z9device_fnPidf +// CIR-HOST-NOT: cir.func dso_local @_Z9device_fnPidf +// CIR-DEVICE: cir.func dso_local @_Z9device_fnPidf __global__ void global_fn(int a) {} // CIR-DEVICE: @_Z9global_fni diff --git a/clang/test/CIR/CodeGen/OpenCL/static-vardecl.cl b/clang/test/CIR/CodeGen/OpenCL/static-vardecl.cl index 88772183641a..0a8e03bbfc9d 100644 --- a/clang/test/CIR/CodeGen/OpenCL/static-vardecl.cl +++ b/clang/test/CIR/CodeGen/OpenCL/static-vardecl.cl @@ -5,11 +5,11 @@ kernel void test_static(int i) { static global int b = 15; - // CIR-DAG: cir.global "private" internal dsolocal addrspace(offload_global) @test_static.b = #cir.int<15> : !s32i {alignment = 4 : i64} + // CIR-DAG: cir.global "private" internal dso_local addrspace(offload_global) @test_static.b = #cir.int<15> : !s32i {alignment = 4 : i64} // LLVM-DAG: @test_static.b = internal addrspace(1) global i32 15 local int c; - // CIR-DAG: cir.global "private" internal dsolocal addrspace(offload_local) @test_static.c : !s32i {alignment = 4 : i64} + // CIR-DAG: cir.global "private" internal dso_local addrspace(offload_local) @test_static.c : !s32i {alignment = 4 : i64} // LLVM-DAG: @test_static.c = internal addrspace(3) global i32 undef // CIR-DAG: %[[#ADDRB:]] = cir.get_global @test_static.b : !cir.ptr diff --git a/clang/test/CIR/CodeGen/String.cpp b/clang/test/CIR/CodeGen/String.cpp index 51854ce910bf..6e5b8e046926 100644 --- a/clang/test/CIR/CodeGen/String.cpp +++ b/clang/test/CIR/CodeGen/String.cpp @@ -67,7 +67,7 @@ void test() { // CHECK-NEXT: cir.call @_ZN6StringC2EPKc(%2, %3) : (!cir.ptr, !cir.ptr) -> () // CHECK-NEXT: cir.return -// CHECK: cir.func @_Z4testv() +// CHECK: cir.func dso_local @_Z4testv() // CHECK: cir.call @_ZN6StringC1Ev(%0) : (!cir.ptr) -> () // CHECK: cir.call @_ZN6StringC1Ei(%1, %3) : (!cir.ptr, !s32i) -> () // CHECK: cir.call @_ZN6StringC1EPKc(%2, %5) : (!cir.ptr, !cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/address-space-conversion.cpp b/clang/test/CIR/CodeGen/address-space-conversion.cpp index be19335c24c3..78b69ae7eab6 100644 --- a/clang/test/CIR/CodeGen/address-space-conversion.cpp +++ b/clang/test/CIR/CodeGen/address-space-conversion.cpp @@ -9,7 +9,7 @@ using pi2_t = int __attribute__((address_space(2))) *; using ri1_t = int __attribute__((address_space(1))) &; using ri2_t = int __attribute__((address_space(2))) &; -// CIR: cir.func @{{.*test_ptr.*}} +// CIR: cir.func dso_local @{{.*test_ptr.*}} // LLVM: define dso_local void @{{.*test_ptr.*}} void test_ptr() { pi1_t ptr1; @@ -23,7 +23,7 @@ void test_ptr() { // LLVM-NEXT: store ptr addrspace(2) %[[#CAST]], ptr %{{[0-9]+}}, align 8 } -// CIR: cir.func @{{.*test_ref.*}} +// CIR: cir.func dso_local @{{.*test_ref.*}} // LLVM: define dso_local void @{{.*test_ref.*}} void test_ref() { pi1_t ptr; @@ -42,7 +42,7 @@ void test_ref() { // LLVM-NEXT: store ptr addrspace(2) %[[#CAST]], ptr %{{[0-9]+}}, align 8 } -// CIR: cir.func @{{.*test_nullptr.*}} +// CIR: cir.func dso_local @{{.*test_nullptr.*}} // LLVM: define dso_local void @{{.*test_nullptr.*}} void test_nullptr() { constexpr pi1_t null1 = nullptr; diff --git a/clang/test/CIR/CodeGen/address-space.c b/clang/test/CIR/CodeGen/address-space.c index b1b741594257..d131fb84d98d 100644 --- a/clang/test/CIR/CodeGen/address-space.c +++ b/clang/test/CIR/CodeGen/address-space.c @@ -3,19 +3,19 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t.ll // RUN: FileCheck --input-file=%t.ll %s -check-prefix=LLVM -// CIR: cir.func {{@.*foo.*}}(%arg0: !cir.ptr)> +// CIR: cir.func dso_local {{@.*foo.*}}(%arg0: !cir.ptr)> // LLVM: define dso_local void @foo(ptr addrspace(1) %0) void foo(int __attribute__((address_space(1))) *arg) { return; } -// CIR: cir.func {{@.*bar.*}}(%arg0: !cir.ptr)> +// CIR: cir.func dso_local {{@.*bar.*}}(%arg0: !cir.ptr)> // LLVM: define dso_local void @bar(ptr %0) void bar(int __attribute__((address_space(0))) *arg) { return; } -// CIR: cir.func {{@.*baz.*}}(%arg0: !cir.ptr +// CIR: cir.func dso_local {{@.*baz.*}}(%arg0: !cir.ptr // LLVM: define dso_local void @baz(ptr %0) void baz(int *arg) { return; diff --git a/clang/test/CIR/CodeGen/agg-copy.c b/clang/test/CIR/CodeGen/agg-copy.c index 5604f3f11382..8a8ea7fb7442 100644 --- a/clang/test/CIR/CodeGen/agg-copy.c +++ b/clang/test/CIR/CodeGen/agg-copy.c @@ -9,7 +9,7 @@ typedef struct { S s; } A; -// CHECK: cir.func @foo1 +// CHECK: cir.func dso_local @foo1 // CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a1", init] // CHECK: [[TMP1:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a2", init] // CHECK: cir.store{{.*}} %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> @@ -25,7 +25,7 @@ void foo1(A* a1, A* a2) { a1[1] = a2[1]; } -// CHECK: cir.func @foo2 +// CHECK: cir.func dso_local @foo2 // CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a1", init] // CHECK: [[TMP1:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a2", init] // CHECK: cir.store{{.*}} %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> @@ -40,7 +40,7 @@ void foo2(A* a1, A* a2) { } // CHECK: cir.global external @a = #cir.zero : !rec_A -// CHECK: cir.func @foo3 +// CHECK: cir.func dso_local @foo3 // CHECK: [[TMP0]] = cir.alloca !rec_A, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CHECK: [[TMP1]] = cir.get_global @a : !cir.ptr // CHECK: cir.copy [[TMP1]] to [[TMP0]] : !cir.ptr @@ -51,7 +51,7 @@ A foo3(void) { return a; } -// CHECK: cir.func @foo4 +// CHECK: cir.func dso_local @foo4 // CHECK: [[TMP0]] = cir.alloca !cir.ptr, !cir.ptr>, ["a1", init] // CHECK: [[TMP1]] = cir.alloca !rec_A, !cir.ptr, ["a2", init] // CHECK: cir.store{{.*}} %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> diff --git a/clang/test/CIR/CodeGen/agg-init.cpp b/clang/test/CIR/CodeGen/agg-init.cpp index a31b355fc02a..a8fd63ade305 100644 --- a/clang/test/CIR/CodeGen/agg-init.cpp +++ b/clang/test/CIR/CodeGen/agg-init.cpp @@ -16,7 +16,7 @@ typedef struct yep_ { void use() { yop{}; } -// CHECK: cir.func @_Z3usev() +// CHECK: cir.func dso_local @_Z3usev() // CHECK: %0 = cir.alloca !rec_yep_, !cir.ptr, ["agg.tmp.ensured"] {alignment = 4 : i64} // CHECK: %1 = cir.get_member %0[0] {name = "Status"} : !cir.ptr -> !cir.ptr // CHECK: %2 = cir.const #cir.int<0> : !u32i @@ -46,7 +46,7 @@ void yo() { Yo ext2 = {Y, &ext}; } -// CHECK: cir.func @_Z2yov() +// CHECK: cir.func dso_local @_Z2yov() // CHECK: %0 = cir.alloca !rec_Yo, !cir.ptr, ["ext"] {alignment = 8 : i64} // CHECK: %1 = cir.alloca !rec_Yo, !cir.ptr, ["ext2", init] {alignment = 8 : i64} // CHECK: %2 = cir.const #cir.const_record<{#cir.int<1000070000> : !u32i, #cir.ptr : !cir.ptr, #cir.int<0> : !u64i}> : !rec_Yo diff --git a/clang/test/CIR/CodeGen/agg-init2.cpp b/clang/test/CIR/CodeGen/agg-init2.cpp index 47a881308750..fc4de943d6a8 100644 --- a/clang/test/CIR/CodeGen/agg-init2.cpp +++ b/clang/test/CIR/CodeGen/agg-init2.cpp @@ -13,7 +13,7 @@ void f() { Zero z1 = Zero{}; } -// CHECK: cir.func @_Z1fv() +// CHECK: cir.func dso_local @_Z1fv() // CHECK: %0 = cir.alloca !rec_Zero, !cir.ptr, ["z0", init] // CHECK: %1 = cir.alloca !rec_Zero, !cir.ptr, ["z1"] // CHECK: cir.call @_ZN4ZeroC1Ev(%0) : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/align-load.c b/clang/test/CIR/CodeGen/align-load.c index 3d6f037e7be6..93937320392a 100644 --- a/clang/test/CIR/CodeGen/align-load.c +++ b/clang/test/CIR/CodeGen/align-load.c @@ -4,7 +4,7 @@ // RUN: FileCheck --input-file=%t-cir.ll %s -check-prefix=LLVM // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -emit-llvm %s -o %t.ll // RUN: FileCheck --input-file=%t.ll %s -check-prefix=OGCG - + struct S { char b; short s; @@ -21,7 +21,7 @@ void accessStruct(struct S u) { u.d; } -// CIR: cir.func @accessStruct +// CIR: cir.func dso_local @accessStruct // CIR: cir.load align(8) // CIR: cir.load align(2) // CIR: cir.load align(4) @@ -58,7 +58,7 @@ void accessUnion(union U u) { u.d; } -// CIR: cir.func @accessUnion +// CIR: cir.func dso_local @accessUnion // CIR: cir.load align(8) // CIR: cir.load align(8) // CIR: cir.load align(8) diff --git a/clang/test/CIR/CodeGen/array-init-destroy.cpp b/clang/test/CIR/CodeGen/array-init-destroy.cpp index 874e85738eea..883e89c25678 100644 --- a/clang/test/CIR/CodeGen/array-init-destroy.cpp +++ b/clang/test/CIR/CodeGen/array-init-destroy.cpp @@ -19,7 +19,7 @@ void x() { xpto array[2]; } -// BEFORE: cir.func @_Z1xv() +// BEFORE: cir.func dso_local @_Z1xv() // BEFORE: %[[ArrayAddr:.*]] = cir.alloca !cir.array // BEFORE: cir.array.ctor(%[[ArrayAddr]] : !cir.ptr>) { @@ -34,7 +34,7 @@ void x() { // BEFORE: cir.yield // BEFORE: } -// AFTER: cir.func @_Z1xv() +// AFTER: cir.func dso_local @_Z1xv() // AFTER: %[[ArrayAddr0:.*]] = cir.alloca !cir.array // AFTER: %[[ConstTwo:.*]] = cir.const #cir.int<2> : !u64i // AFTER: %[[ArrayBegin:.*]] = cir.cast(array_to_ptrdecay, %[[ArrayAddr0]] : !cir.ptr>), !cir.ptr diff --git a/clang/test/CIR/CodeGen/array-init.c b/clang/test/CIR/CodeGen/array-init.c index 661873860672..4a76efa834b9 100644 --- a/clang/test/CIR/CodeGen/array-init.c +++ b/clang/test/CIR/CodeGen/array-init.c @@ -12,7 +12,7 @@ typedef struct { void buz(int x) { T arr[] = { {0, x}, {0, 0} }; } -// CIR: cir.func @buz +// CIR: cir.func dso_local @buz // CIR-NEXT: [[X_ALLOCA:%.*]] = cir.alloca !s32i, !cir.ptr, ["x", init] {alignment = 4 : i64} // CIR-NEXT: [[ARR:%.*]] = cir.alloca !cir.array, !cir.ptr>, ["arr", init] {alignment = 16 : i64} // CIR-NEXT: cir.store{{.*}} %arg0, [[X_ALLOCA]] : !s32i, !cir.ptr @@ -41,7 +41,7 @@ void foo() { void bar(int a, int b, int c) { int arr[] = {a,b,c}; } -// CIR: cir.func @bar +// CIR: cir.func dso_local @bar // CIR: [[ARR:%.*]] = cir.alloca !cir.array, !cir.ptr>, ["arr", init] {alignment = 4 : i64} // CIR-NEXT: cir.store{{.*}} %arg0, [[A:%.*]] : !s32i, !cir.ptr // CIR-NEXT: cir.store{{.*}} %arg1, [[B:%.*]] : !s32i, !cir.ptr @@ -61,7 +61,7 @@ void bar(int a, int b, int c) { void zero_init(int x) { int arr[3] = {x}; } -// CIR: cir.func @zero_init +// CIR: cir.func dso_local @zero_init // CIR: [[VAR_ALLOC:%.*]] = cir.alloca !s32i, !cir.ptr, ["x", init] {alignment = 4 : i64} // CIR: %1 = cir.alloca !cir.array, !cir.ptr>, ["arr", init] {alignment = 4 : i64} // CIR: [[TEMP:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["arrayinit.temp", init] {alignment = 8 : i64} @@ -93,7 +93,7 @@ void aggr_init() { int g = 5; int g_arr[5] = {1, 2, 3, g}; } -// CIR-LABEL: cir.func no_proto @aggr_init +// CIR-LABEL: cir.func no_proto dso_local @aggr_init // CIR: [[VAR_ALLOC:%.*]] = cir.alloca !s32i, !cir.ptr, ["g", init] {alignment = 4 : i64} // CIR: %1 = cir.alloca !cir.array, !cir.ptr>, ["g_arr", init] {alignment = 16 : i64} // CIR: [[TEMP:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["arrayinit.temp", init] {alignment = 8 : i64} diff --git a/clang/test/CIR/CodeGen/array-new-init.cpp b/clang/test/CIR/CodeGen/array-new-init.cpp index aec1d99f544d..a3dc8dc03b7b 100644 --- a/clang/test/CIR/CodeGen/array-new-init.cpp +++ b/clang/test/CIR/CodeGen/array-new-init.cpp @@ -11,7 +11,7 @@ void t_new_constant_size_constructor() { auto p = new E[3]; } -// BEFORE: cir.func @_Z31t_new_constant_size_constructorv +// BEFORE: cir.func dso_local @_Z31t_new_constant_size_constructorv // BEFORE: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<3> : !u64i // BEFORE: %[[SIZE_WITHOUT_COOKIE:.*]] = cir.const #cir.int<3> : !u64i // BEFORE: %[[ALLOC_SIZE:.*]] = cir.const #cir.int<11> : !u64i @@ -29,7 +29,7 @@ void t_new_constant_size_constructor() { // BEFORE: cir.yield // BEFORE: } -// AFTER: cir.func @_Z31t_new_constant_size_constructorv +// AFTER: cir.func dso_local @_Z31t_new_constant_size_constructorv // AFTER: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<3> : !u64i // AFTER: %[[SIZE_WITHOUT_COOKIE:.*]] = cir.const #cir.int<3> : !u64i // AFTER: %[[ALLOC_SIZE:.*]] = cir.const #cir.int<11> : !u64i diff --git a/clang/test/CIR/CodeGen/array-unknown-bound.cpp b/clang/test/CIR/CodeGen/array-unknown-bound.cpp index 805b8c5d5867..c18e44d8faf4 100644 --- a/clang/test/CIR/CodeGen/array-unknown-bound.cpp +++ b/clang/test/CIR/CodeGen/array-unknown-bound.cpp @@ -7,7 +7,7 @@ int *table_ptr = table; // CHECK: cir.global external @table_ptr = #cir.global_view<@table> : !cir.ptr int test() { return table[1]; } -// CHECK: cir.func @_Z4testv() +// CHECK: cir.func dso_local @_Z4testv() // CHECK-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CHECK-NEXT: %1 = cir.get_global @table : !cir.ptr> diff --git a/clang/test/CIR/CodeGen/array.cpp b/clang/test/CIR/CodeGen/array.cpp index 8a093dde5ab0..51e9044be202 100644 --- a/clang/test/CIR/CodeGen/array.cpp +++ b/clang/test/CIR/CodeGen/array.cpp @@ -5,7 +5,7 @@ void a0() { int a[10]; } -// CHECK: cir.func @_Z2a0v() +// CHECK: cir.func dso_local @_Z2a0v() // CHECK-NEXT: %0 = cir.alloca !cir.array, !cir.ptr>, ["a"] {alignment = 16 : i64} void a1() { @@ -13,7 +13,7 @@ void a1() { a[0] = 1; } -// CHECK: cir.func @_Z2a1v() +// CHECK: cir.func dso_local @_Z2a1v() // CHECK-NEXT: %0 = cir.alloca !cir.array, !cir.ptr>, ["a"] {alignment = 16 : i64} // CHECK-NEXT: %1 = cir.const #cir.int<1> : !s32i // CHECK-NEXT: %2 = cir.const #cir.int<0> : !s32i @@ -26,7 +26,7 @@ int *a2() { return &a[0]; } -// CHECK: cir.func @_Z2a2v() -> !cir.ptr +// CHECK: cir.func dso_local @_Z2a2v() -> !cir.ptr // CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["__retval"] {alignment = 8 : i64} // CHECK-NEXT: %1 = cir.alloca !cir.array, !cir.ptr>, ["a"] {alignment = 16 : i64} // CHECK-NEXT: %2 = cir.const #cir.int<0> : !s32i @@ -40,8 +40,8 @@ void local_stringlit() { const char *s = "whatnow"; } -// CHECK: cir.global "private" constant cir_private dsolocal @".str" = #cir.const_array<"whatnow\00" : !cir.array> : !cir.array {alignment = 1 : i64} -// CHECK: cir.func @_Z15local_stringlitv() +// CHECK: cir.global "private" constant cir_private dso_local @".str" = #cir.const_array<"whatnow\00" : !cir.array> : !cir.array {alignment = 1 : i64} +// CHECK: cir.func dso_local @_Z15local_stringlitv() // CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] {alignment = 8 : i64} // CHECK-NEXT: %1 = cir.get_global @".str" : !cir.ptr> // CHECK-NEXT: %2 = cir.cast(array_to_ptrdecay, %1 : !cir.ptr>), !cir.ptr @@ -73,7 +73,7 @@ struct S { // CHECK: cir.global external @arr = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !rec_S, #cir.zero : !rec_S, #cir.zero : !rec_S]> : !cir.array void testPointerDecaySubscriptAccess(int arr[]) { -// CHECK: cir.func @{{.+}}testPointerDecaySubscriptAccess +// CHECK: cir.func dso_local @{{.+}}testPointerDecaySubscriptAccess arr[1]; // CHECK: %[[#BASE:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr // CHECK: %[[#DIM1:]] = cir.const #cir.int<1> : !s32i @@ -81,7 +81,7 @@ void testPointerDecaySubscriptAccess(int arr[]) { } void testPointerDecayedArrayMultiDimSubscriptAccess(int arr[][3]) { -// CHECK: cir.func @{{.+}}testPointerDecayedArrayMultiDimSubscriptAccess +// CHECK: cir.func dso_local @{{.+}}testPointerDecayedArrayMultiDimSubscriptAccess arr[1][2]; // CHECK: %[[#V1:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>>, !cir.ptr> // CHECK: %[[#V2:]] = cir.const #cir.int<1> : !s32i diff --git a/clang/test/CIR/CodeGen/assign-operator.cpp b/clang/test/CIR/CodeGen/assign-operator.cpp index 1bf6fc784984..482742895eda 100644 --- a/clang/test/CIR/CodeGen/assign-operator.cpp +++ b/clang/test/CIR/CodeGen/assign-operator.cpp @@ -72,7 +72,7 @@ int main() { } } -// CHECK: cir.func @main() -> !s32i +// CHECK: cir.func dso_local @main() -> !s32i // CHECK: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CHECK: %1 = cir.alloca !rec_StringView, !cir.ptr, ["sv", init] {alignment = 8 : i64} // CHECK: cir.call @_ZN10StringViewC2Ev(%1) : (!cir.ptr) -> () @@ -107,7 +107,7 @@ struct ContainsNonTrivial { ContainsNonTrivial &operator=(const ContainsNonTrivial &); }; -// CHECK-LABEL: cir.func @_ZN18ContainsNonTrivialaSERKS_( +// CHECK-LABEL: cir.func dso_local @_ZN18ContainsNonTrivialaSERKS_( // CHECK-NEXT: %[[#THIS:]] = cir.alloca !cir.ptr // CHECK-NEXT: %[[#OTHER:]] = cir.alloca !cir.ptr // CHECK-NEXT: %[[#RETVAL:]] = cir.alloca !cir.ptr @@ -175,7 +175,7 @@ struct Trivial { // CHECK-NEXT: } // We should explicitly call operator= even for trivial types. -// CHECK-LABEL: cir.func @_Z11copyTrivialR7TrivialS0_( +// CHECK-LABEL: cir.func dso_local @_Z11copyTrivialR7TrivialS0_( // CHECK: cir.call @_ZN7TrivialaSERKS_( void copyTrivial(Trivial &a, Trivial &b) { a = b; @@ -188,7 +188,7 @@ struct ContainsTrivial { }; // We should explicitly call operator= even for trivial types. -// CHECK-LABEL: cir.func @_ZN15ContainsTrivialaSERKS_( +// CHECK-LABEL: cir.func dso_local @_ZN15ContainsTrivialaSERKS_( // CHECK: cir.call @_ZN7TrivialaSERKS_( // CHECK: cir.call @_ZN7TrivialaSERKS_( ContainsTrivial &ContainsTrivial::operator=(const ContainsTrivial &) = default; @@ -199,7 +199,7 @@ struct ContainsTrivialArray { }; // We should be calling operator= here but don't currently. -// CHECK-LABEL: cir.func @_ZN20ContainsTrivialArrayaSERKS_( +// CHECK-LABEL: cir.func dso_local @_ZN20ContainsTrivialArrayaSERKS_( // CHECK: %[[#THIS_LOAD:]] = cir.load{{.*}} deref %[[#]] // CHECK-NEXT: %[[#THIS_ARR:]] = cir.get_member %[[#THIS_LOAD]][0] {name = "arr"} // CHECK-NEXT: %[[#THIS_ARR_CAST:]] = cir.cast(bitcast, %[[#THIS_ARR]] : !cir.ptr>), !cir.ptr diff --git a/clang/test/CIR/CodeGen/atomic.cpp b/clang/test/CIR/CodeGen/atomic.cpp index 10ff51f70a9c..380d47e8adf9 100644 --- a/clang/test/CIR/CodeGen/atomic.cpp +++ b/clang/test/CIR/CodeGen/atomic.cpp @@ -27,7 +27,7 @@ int basic_binop_fetch(int *i) { return __atomic_add_fetch(i, 1, memory_order_seq_cst); } -// CHECK: cir.func @_Z17basic_binop_fetchPi +// CHECK: cir.func dso_local @_Z17basic_binop_fetchPi // CHECK: %[[ARGI:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["i", init] {alignment = 8 : i64} // CHECK: %[[ONE_ADDR:.*]] = cir.alloca !s32i, !cir.ptr, [".atomictmp"] {alignment = 4 : i64} // CHECK: cir.store{{.*}} %arg0, %[[ARGI]] : !cir.ptr, !cir.ptr> @@ -48,7 +48,7 @@ int other_binop_fetch(int *i) { return __atomic_xor_fetch(i, 1, memory_order_release); } -// CHECK: cir.func @_Z17other_binop_fetchPi +// CHECK: cir.func dso_local @_Z17other_binop_fetchPi // CHECK: cir.atomic.fetch(sub, {{.*}}, relaxed // CHECK: cir.atomic.fetch(and, {{.*}}, acquire // CHECK: cir.atomic.fetch(or, {{.*}}, acquire @@ -68,7 +68,7 @@ int nand_binop_fetch(int *i) { return __atomic_nand_fetch(i, 1, memory_order_acq_rel); } -// CHECK: cir.func @_Z16nand_binop_fetchPi +// CHECK: cir.func dso_local @_Z16nand_binop_fetchPi // CHECK: cir.atomic.fetch(nand, {{.*}}, acq_rel // LLVM: define dso_local i32 @_Z16nand_binop_fetchPi @@ -81,7 +81,7 @@ int fp_binop_fetch(float *i) { return __atomic_sub_fetch(i, 1, memory_order_seq_cst); } -// CHECK: cir.func @_Z14fp_binop_fetchPf +// CHECK: cir.func dso_local @_Z14fp_binop_fetchPf // CHECK: cir.atomic.fetch(add, // CHECK: cir.atomic.fetch(sub, @@ -100,7 +100,7 @@ int fetch_binop(int *i) { return __atomic_fetch_nand(i, 1, memory_order_seq_cst); } -// CHECK: cir.func @_Z11fetch_binopPi +// CHECK: cir.func dso_local @_Z11fetch_binopPi // CHECK: cir.atomic.fetch(add, {{.*}}) fetch_first // CHECK: cir.atomic.fetch(sub, {{.*}}) fetch_first // CHECK: cir.atomic.fetch(and, {{.*}}) fetch_first @@ -129,7 +129,7 @@ void min_max_fetch(int *i) { __atomic_min_fetch(i, 1, memory_order_seq_cst); } -// CHECK: cir.func @_Z13min_max_fetchPi +// CHECK: cir.func dso_local @_Z13min_max_fetchPi // CHECK: = cir.atomic.fetch(max, {{.*}}) fetch_first // CHECK: = cir.atomic.fetch(min, {{.*}}) fetch_first // CHECK: = cir.atomic.fetch(max, {{.*}}) : !s32i @@ -151,7 +151,7 @@ int fi1(_Atomic(int) *i) { return __c11_atomic_load(i, memory_order_seq_cst); } -// CHECK: cir.func @_Z3fi1PU7_Atomici +// CHECK: cir.func dso_local @_Z3fi1PU7_Atomici // CHECK: cir.load{{.*}} atomic(seq_cst) // LLVM-LABEL: @_Z3fi1PU7_Atomici @@ -694,7 +694,7 @@ extern "C" void test_op_and_fetch(void) // LLVM: [[RET1:%.*]] = add i8 [[RES1]], [[VAL1]] // LLVM: store i8 [[RET1]], ptr @uc, align 1 uc = __sync_add_and_fetch(&uc, uc); - + // CHECK: [[VAL2:%.*]] = cir.cast(integral, {{%.*}} : !u8i), !s16i // CHECK: [[RES2:%.*]] = cir.atomic.fetch(add, {{%.*}} : !cir.ptr, [[VAL2]] : !s16i, seq_cst) fetch_first : !s16i // CHECK: [[RET2:%.*]] = cir.binop(add, [[RES2]], [[VAL2]]) : !s16i @@ -771,7 +771,7 @@ extern "C" void test_op_and_fetch(void) // LLVM: [[RET1:%.*]] = sub i8 [[RES1]], [[VAL1]] // LLVM: store i8 [[RET1]], ptr @uc, align 1 uc = __sync_sub_and_fetch(&uc, uc); - + // CHECK: [[VAL2:%.*]] = cir.cast(integral, {{%.*}} : !u8i), !s16i // CHECK: [[RES2:%.*]] = cir.atomic.fetch(sub, {{%.*}} : !cir.ptr, [[VAL2]] : !s16i, seq_cst) fetch_first : !s16i // CHECK: [[RET2:%.*]] = cir.binop(sub, [[RES2]], [[VAL2]]) : !s16i @@ -848,7 +848,7 @@ extern "C" void test_op_and_fetch(void) // LLVM: [[RET1:%.*]] = and i8 [[RES1]], [[VAL1]] // LLVM: store i8 [[RET1]], ptr @uc, align 1 uc = __sync_and_and_fetch(&uc, uc); - + // CHECK: [[VAL2:%.*]] = cir.cast(integral, {{%.*}} : !u8i), !s16i // CHECK: [[RES2:%.*]] = cir.atomic.fetch(and, {{%.*}} : !cir.ptr, [[VAL2]] : !s16i, seq_cst) fetch_first : !s16i // CHECK: [[RET2:%.*]] = cir.binop(and, [[RES2]], [[VAL2]]) : !s16i @@ -925,7 +925,7 @@ extern "C" void test_op_and_fetch(void) // LLVM: [[RET1:%.*]] = or i8 [[RES1]], [[VAL1]] // LLVM: store i8 [[RET1]], ptr @uc, align 1 uc = __sync_or_and_fetch(&uc, uc); - + // CHECK: [[VAL2:%.*]] = cir.cast(integral, {{%.*}} : !u8i), !s16i // CHECK: [[RES2:%.*]] = cir.atomic.fetch(or, {{%.*}} : !cir.ptr, [[VAL2]] : !s16i, seq_cst) fetch_first : !s16i // CHECK: [[RET2:%.*]] = cir.binop(or, [[RES2]], [[VAL2]]) : !s16i @@ -1002,7 +1002,7 @@ extern "C" void test_op_and_fetch(void) // LLVM: [[RET1:%.*]] = xor i8 [[RES1]], [[VAL1]] // LLVM: store i8 [[RET1]], ptr @uc, align 1 uc = __sync_xor_and_fetch(&uc, uc); - + // CHECK: [[VAL2:%.*]] = cir.cast(integral, {{%.*}} : !u8i), !s16i // CHECK: [[RES2:%.*]] = cir.atomic.fetch(xor, {{%.*}} : !cir.ptr, [[VAL2]] : !s16i, seq_cst) fetch_first : !s16i // CHECK: [[RET2:%.*]] = cir.binop(xor, [[RES2]], [[VAL2]]) : !s16i @@ -1083,7 +1083,7 @@ extern "C" void test_op_and_fetch(void) // LLVM: [[RET1:%.*]] = xor i8 [[INTERM1]], -1 // LLVM: store i8 [[RET1]], ptr @uc, align 1 uc = __sync_nand_and_fetch(&uc, uc); - + // CHECK: [[VAL2:%.*]] = cir.cast(integral, {{%.*}} : !u8i), !s16i // CHECK: [[RES2:%.*]] = cir.atomic.fetch(nand, {{%.*}} : !cir.ptr, [[VAL2]] : !s16i, seq_cst) fetch_first : !s16i // CHECK: [[INTERM2:%.*]] = cir.binop(and, [[RES2]], [[VAL2]]) : !s16i diff --git a/clang/test/CIR/CodeGen/attribute-annotate-multiple.cpp b/clang/test/CIR/CodeGen/attribute-annotate-multiple.cpp index 55a8285aa9b1..9876ad2dd3f1 100644 --- a/clang/test/CIR/CodeGen/attribute-annotate-multiple.cpp +++ b/clang/test/CIR/CodeGen/attribute-annotate-multiple.cpp @@ -27,9 +27,9 @@ void bar() __attribute__((annotate("withargfunc", "os", 22))) { // BEFORE: cir.global external @tile = #cir.int<7> : !s32i // BEFORE-SAME: #cir.annotation] -// BEFORE: cir.func @_Z3fooi(%arg0: !s32i) [#cir.annotation, +// BEFORE: cir.func dso_local @_Z3fooi(%arg0: !s32i) [#cir.annotation, // BEFORE-SAME: #cir.annotation] -// BEFORE: cir.func @_Z3barv() [#cir.annotation] +// BEFORE: cir.func dso_local @_Z3barv() [#cir.annotation] // AFTER: module {{.*}}attribute-annotate-multiple.cpp" attributes @@ -57,9 +57,9 @@ void bar() __attribute__((annotate("withargfunc", "os", 22))) { // LLVM: @.str.4.annotation = private unnamed_addr constant [10 x i8] c"noargfunc\00", section "llvm.metadata" // LLVM: @.str.5.annotation = private unnamed_addr constant [12 x i8] c"withargfunc\00", section "llvm.metadata" // LLVM: @.str.1.annotation.arg = private unnamed_addr constant [3 x i8] c"os\00", align 1 -// LLVM: @.args.2.annotation = private unnamed_addr constant { ptr, i32 } +// LLVM: @.args.2.annotation = private unnamed_addr constant { ptr, i32 } // LLVM-SAME: { ptr @.str.1.annotation.arg, i32 23 }, section "llvm.metadata" -// LLVM: @.args.3.annotation = private unnamed_addr constant { ptr, i32 } +// LLVM: @.args.3.annotation = private unnamed_addr constant { ptr, i32 } // LLVM-SAME: { ptr @.str.1.annotation.arg, i32 22 }, section "llvm.metadata" // LLVM: @llvm.global.annotations = appending global [7 x { ptr, ptr, ptr, i32, ptr }] diff --git a/clang/test/CIR/CodeGen/basic.c b/clang/test/CIR/CodeGen/basic.c index 9d61b2e05e96..076df0ce7844 100644 --- a/clang/test/CIR/CodeGen/basic.c +++ b/clang/test/CIR/CodeGen/basic.c @@ -11,7 +11,7 @@ int foo(int i) { } // CIR: module @"{{.*}}basic.c" attributes {{{.*}}cir.lang = #cir.lang -// CIR-NEXT: cir.func @foo(%arg0: !s32i loc({{.*}})) -> !s32i +// CIR-NEXT: cir.func dso_local @foo(%arg0: !s32i loc({{.*}})) -> !s32i // CIR-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["i", init] {alignment = 4 : i64} // CIR-NEXT: %1 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CIR-NEXT: cir.store{{.*}} %arg0, %0 : !s32i, !cir.ptr @@ -23,7 +23,7 @@ int foo(int i) { int f2(void) { return 3; } -// CIR: cir.func @f2() -> !s32i +// CIR: cir.func dso_local @f2() -> !s32i // CIR-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CIR-NEXT: %1 = cir.const #cir.int<3> : !s32i // CIR-NEXT: cir.store{{.*}} %1, %0 : !s32i, !cir.ptr @@ -43,7 +43,7 @@ int f3(void) { return i; } -// CIR: cir.func @f3() -> !s32i +// CIR: cir.func dso_local @f3() -> !s32i // CIR-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CIR-NEXT: %1 = cir.alloca !s32i, !cir.ptr, ["i", init] {alignment = 4 : i64} // CIR-NEXT: %2 = cir.const #cir.int<3> : !s32i diff --git a/clang/test/CIR/CodeGen/basic.cpp b/clang/test/CIR/CodeGen/basic.cpp index e93b4050bb39..6e25371c5140 100644 --- a/clang/test/CIR/CodeGen/basic.cpp +++ b/clang/test/CIR/CodeGen/basic.cpp @@ -6,7 +6,7 @@ int *p0() { return p; } -// CHECK: cir.func @_Z2p0v() -> !cir.ptr +// CHECK: cir.func dso_local @_Z2p0v() -> !cir.ptr // CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["p", init] // CHECK: %2 = cir.const #cir.ptr : !cir.ptr // CHECK: cir.store{{.*}} %2, %1 : !cir.ptr, !cir.ptr> @@ -17,7 +17,7 @@ int *p1() { return p; } -// CHECK: cir.func @_Z2p1v() -> !cir.ptr +// CHECK: cir.func dso_local @_Z2p1v() -> !cir.ptr // CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["p"] // CHECK: %2 = cir.const #cir.ptr : !cir.ptr // CHECK: cir.store{{.*}} %2, %1 : !cir.ptr, !cir.ptr> @@ -33,7 +33,7 @@ int *p2() { return p; } -// CHECK: cir.func @_Z2p2v() -> !cir.ptr +// CHECK: cir.func dso_local @_Z2p2v() -> !cir.ptr // CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["__retval"] {alignment = 8 : i64} // CHECK-NEXT: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["p", init] {alignment = 8 : i64} // CHECK-NEXT: %2 = cir.const #cir.ptr : !cir.ptr @@ -57,13 +57,13 @@ int *p2() { void b0() { bool x = true, y = false; } -// CHECK: cir.func @_Z2b0v() +// CHECK: cir.func dso_local @_Z2b0v() // CHECK: %2 = cir.const #true // CHECK: %3 = cir.const #false void b1(int a) { bool b = a; } -// CHECK: cir.func @_Z2b1i(%arg0: !s32i loc({{.*}})) +// CHECK: cir.func dso_local @_Z2b1i(%arg0: !s32i loc({{.*}})) // CHECK: %2 = cir.load{{.*}} %0 : !cir.ptr, !s32i // CHECK: %3 = cir.cast(int_to_bool, %2 : !s32i), !cir.bool // CHECK: cir.store{{.*}} %3, %1 : !cir.bool, !cir.ptr @@ -77,7 +77,7 @@ void if0(int a) { } } -// CHECK: cir.func @_Z3if0i(%arg0: !s32i loc({{.*}})) +// CHECK: cir.func dso_local @_Z3if0i(%arg0: !s32i loc({{.*}})) // CHECK: cir.scope { // CHECK: %3 = cir.load{{.*}} %0 : !cir.ptr, !s32i // CHECK: %4 = cir.cast(int_to_bool, %3 : !s32i), !cir.bool @@ -105,7 +105,7 @@ void if1(int a, bool b, bool c) { } } -// CHECK: cir.func @_Z3if1ibb(%arg0: !s32i loc({{.*}}), %arg1: !cir.bool loc({{.*}}), %arg2: !cir.bool loc({{.*}})) +// CHECK: cir.func dso_local @_Z3if1ibb(%arg0: !s32i loc({{.*}}), %arg1: !cir.bool loc({{.*}}), %arg2: !cir.bool loc({{.*}})) // CHECK: cir.scope { // CHECK: %5 = cir.load{{.*}} %0 : !cir.ptr, !s32i // CHECK: %6 = cir.cast(int_to_bool, %5 : !s32i), !cir.bool @@ -144,7 +144,7 @@ struct regs { }; // Check it's not mangled. -// CHECK: cir.func @use_regs() +// CHECK: cir.func dso_local @use_regs() void use_regs() { regs r; } } @@ -154,7 +154,7 @@ void x() { const bool b1 = false; } -// CHECK: cir.func @_Z1xv() +// CHECK: cir.func dso_local @_Z1xv() // CHECK: %0 = cir.alloca !cir.bool, !cir.ptr, ["b0", init, const] {alignment = 1 : i64} // CHECK: %1 = cir.alloca !cir.bool, !cir.ptr, ["b1", init, const] {alignment = 1 : i64} // CHECK: %2 = cir.const #true @@ -169,7 +169,7 @@ size_type max_size() { return size_type(~0) / sizeof(_Tp); } -// CHECK: cir.func @_Z8max_sizev() +// CHECK: cir.func dso_local @_Z8max_sizev() // CHECK: %0 = cir.alloca !u64i, !cir.ptr, ["__retval"] {alignment = 8 : i64} // CHECK: %1 = cir.const #cir.int<0> : !s32i // CHECK: %2 = cir.unary(not, %1) : !s32i, !s32i diff --git a/clang/test/CIR/CodeGen/binassign.cpp b/clang/test/CIR/CodeGen/binassign.cpp index 0c17533c82b8..934742d13404 100644 --- a/clang/test/CIR/CodeGen/binassign.cpp +++ b/clang/test/CIR/CodeGen/binassign.cpp @@ -60,7 +60,7 @@ void exec() { if ((r = getty()) < 0) {} } -// CHECK: cir.func @_Z4execv() +// CHECK: cir.func dso_local @_Z4execv() // CHECK: %0 = cir.alloca !u32i, !cir.ptr, ["r"] {alignment = 4 : i64} // CHECK: cir.scope { // CHECK: %1 = cir.call @_Z5gettyv() : () -> !u32i diff --git a/clang/test/CIR/CodeGen/bitfield-union.c b/clang/test/CIR/CodeGen/bitfield-union.c index 96f21ab15977..fca8a869b062 100644 --- a/clang/test/CIR/CodeGen/bitfield-union.c +++ b/clang/test/CIR/CodeGen/bitfield-union.c @@ -17,7 +17,7 @@ void main() { // CHECK: #bfi_y = #cir.bitfield_info // CHECK: #bfi_z = #cir.bitfield_info -// cir.func no_proto @main() extra(#fn_attr) { +// cir.func no_proto dso_local @main() extra(#fn_attr) { // %0 = cir.alloca !rec_demo, !cir.ptr, ["d"] {alignment = 4 : i64} // %1 = cir.const #cir.int<1> : !s32i // %2 = cir.get_member %0[0] {name = "x"} : !cir.ptr -> !cir.ptr diff --git a/clang/test/CIR/CodeGen/bitfields.cpp b/clang/test/CIR/CodeGen/bitfields.cpp index 4a0a0ce36d07..9b825f7c7f39 100644 --- a/clang/test/CIR/CodeGen/bitfields.cpp +++ b/clang/test/CIR/CodeGen/bitfields.cpp @@ -32,7 +32,7 @@ typedef struct { // CHECK: !rec_S = !cir.record, !u16i, !u32i}> // CHECK: !rec___long = !cir.record}> -// CHECK: cir.func @_Z11store_field +// CHECK: cir.func dso_local @_Z11store_field // CHECK: [[TMP0:%.*]] = cir.alloca !rec_S, !cir.ptr // CHECK: [[TMP1:%.*]] = cir.const #cir.int<3> : !s32i // CHECK: [[TMP2:%.*]] = cir.cast(bitcast, [[TMP0]] : !cir.ptr), !cir.ptr @@ -42,7 +42,7 @@ void store_field() { s.a = 3; } -// CHECK: cir.func @_Z10load_field +// CHECK: cir.func dso_local @_Z10load_field // CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["s", init, const] // CHECK: [[TMP1:%.*]] = cir.load{{.*}} [[TMP0]] : !cir.ptr>, !cir.ptr // CHECK: [[TMP2:%.*]] = cir.get_member [[TMP1]][1] {name = "d"} : !cir.ptr -> !cir.ptr> @@ -51,14 +51,14 @@ int load_field(S& s) { return s.d; } -// CHECK: cir.func @_Z17load_non_bitfield +// CHECK: cir.func dso_local @_Z17load_non_bitfield // CHECK: cir.get_member {{%.}}[3] {name = "f"} : !cir.ptr -> !cir.ptr unsigned load_non_bitfield(S& s) { return s.f; } // just create a usage of T type -// CHECK: cir.func @_Z17load_one_bitfield +// CHECK: cir.func dso_local @_Z17load_one_bitfield int load_one_bitfield(T& t) { return t.a; } diff --git a/clang/test/CIR/CodeGen/bitint.c b/clang/test/CIR/CodeGen/bitint.c index a2337f1caebb..8ff3dbcc4c76 100644 --- a/clang/test/CIR/CodeGen/bitint.c +++ b/clang/test/CIR/CodeGen/bitint.c @@ -7,7 +7,7 @@ void VLATest(_BitInt(3) A, _BitInt(42) B, _BitInt(17) C) { int AR3[C]; } -// CHECK: cir.func @VLATest +// CHECK: cir.func dso_local @VLATest // CHECK: %[[#A:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CHECK-NEXT: %[[#A_PROMOTED:]] = cir.cast(integral, %[[#A]] : !cir.int), !u64i // CHECK-NEXT: %[[#SP:]] = cir.stack_save : !cir.ptr diff --git a/clang/test/CIR/CodeGen/bitint.cpp b/clang/test/CIR/CodeGen/bitint.cpp index 3dfcbc1a7237..999d3f747cbb 100644 --- a/clang/test/CIR/CodeGen/bitint.cpp +++ b/clang/test/CIR/CodeGen/bitint.cpp @@ -11,21 +11,21 @@ i10 test_signed(i10 arg) { return arg; } -// CHECK: cir.func @_Z11test_signedDB10_(%arg0: !cir.int loc({{.*}}) -> !cir.int +// CHECK: cir.func dso_local @_Z11test_signedDB10_(%arg0: !cir.int loc({{.*}}) -> !cir.int // CHECK: } u10 test_unsigned(u10 arg) { return arg; } -// CHECK: cir.func @_Z13test_unsignedDU10_(%arg0: !cir.int loc({{.*}}) -> !cir.int +// CHECK: cir.func dso_local @_Z13test_unsignedDU10_(%arg0: !cir.int loc({{.*}}) -> !cir.int // CHECK: } i10 test_init() { return 42; } -// CHECK: cir.func @_Z9test_initv() -> !cir.int +// CHECK: cir.func dso_local @_Z9test_initv() -> !cir.int // CHECK: %[[#LITERAL:]] = cir.const #cir.int<42> : !s32i // CHECK-NEXT: %{{.+}} = cir.cast(integral, %[[#LITERAL]] : !s32i), !cir.int // CHECK: } @@ -34,7 +34,7 @@ void test_init_for_mem() { i10 x = 42; } -// CHECK: cir.func @_Z17test_init_for_memv() +// CHECK: cir.func dso_local @_Z17test_init_for_memv() // CHECK: %[[#LITERAL:]] = cir.const #cir.int<42> : !s32i // CHECK-NEXT: %[[#INIT:]] = cir.cast(integral, %[[#LITERAL]] : !s32i), !cir.int // CHECK-NEXT: cir.store{{.*}} %[[#INIT]], %{{.+}} : !cir.int, !cir.ptr> @@ -44,7 +44,7 @@ i10 test_arith(i10 lhs, i10 rhs) { return lhs + rhs; } -// CHECK: cir.func @_Z10test_arithDB10_S_(%arg0: !cir.int loc({{.+}}), %arg1: !cir.int loc({{.+}})) -> !cir.int +// CHECK: cir.func dso_local @_Z10test_arithDB10_S_(%arg0: !cir.int loc({{.+}}), %arg1: !cir.int loc({{.+}})) -> !cir.int // CHECK: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CHECK-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CHECK-NEXT: %{{.+}} = cir.binop(add, %[[#LHS]], %[[#RHS]]) nsw : !cir.int @@ -55,7 +55,7 @@ void Size1ExtIntParam(unsigned _BitInt(1) A) { B[2] = A; } -// CHECK: cir.func @_Z16Size1ExtIntParamDU1_ +// CHECK: cir.func dso_local @_Z16Size1ExtIntParamDU1_ // CHECK: %[[#A:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CHECK-NEXT: %[[#IDX:]] = cir.const #cir.int<2> : !s32i // CHECK-NEXT: %[[#ARRAY:]] = cir.cast(array_to_ptrdecay, %1 : !cir.ptr x 5>>), !cir.ptr> @@ -75,7 +75,7 @@ void OffsetOfTest(void) { int C = __builtin_offsetof(struct S,C); } -// CHECK: cir.func @_Z12OffsetOfTestv() +// CHECK: cir.func dso_local @_Z12OffsetOfTestv() // CHECK: %{{.+}} = cir.const #cir.int<0> : !u64i // CHECK: %{{.+}} = cir.const #cir.int<4> : !u64i // CHECK: %{{.+}} = cir.const #cir.int<8> : !u64i @@ -83,4 +83,4 @@ void OffsetOfTest(void) { _BitInt(2) ParamPassing(_BitInt(15) a, _BitInt(31) b) {} -// CHECK: cir.func @_Z12ParamPassingDB15_DB31_(%arg0: !cir.int loc({{.+}}), %arg1: !cir.int loc({{.+}})) -> !cir.int +// CHECK: cir.func dso_local @_Z12ParamPassingDB15_DB31_(%arg0: !cir.int loc({{.+}}), %arg1: !cir.int loc({{.+}})) -> !cir.int diff --git a/clang/test/CIR/CodeGen/bool.c b/clang/test/CIR/CodeGen/bool.c index 8d8f8dd1af85..565188dbb77b 100644 --- a/clang/test/CIR/CodeGen/bool.c +++ b/clang/test/CIR/CodeGen/bool.c @@ -7,7 +7,7 @@ typedef struct { bool x; } S; -// CHECK: cir.func @init_bool +// CHECK: cir.func dso_local @init_bool // CHECK: [[ALLOC:%.*]] = cir.alloca !rec_S, !cir.ptr // CHECK: [[ZERO:%.*]] = cir.const #cir.zero : !rec_S // CHECK: cir.store{{.*}} [[ZERO]], [[ALLOC]] : !rec_S, !cir.ptr @@ -15,7 +15,7 @@ void init_bool(void) { S s = {0}; } -// CHECK: cir.func @store_bool +// CHECK: cir.func dso_local @store_bool // CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr> // CHECK: cir.store{{.*}} %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> // CHECK: [[TMP1:%.*]] = cir.const #cir.int<0> : !s32i @@ -27,7 +27,7 @@ void store_bool(S *s) { s->x = false; } -// CHECK: cir.func @load_bool +// CHECK: cir.func dso_local @load_bool // CHECK: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["s", init] {alignment = 8 : i64} // CHECK: [[TMP1:%.*]] = cir.alloca !cir.bool, !cir.ptr, ["x", init] {alignment = 1 : i64} // CHECK: cir.store{{.*}} %arg0, [[TMP0]] : !cir.ptr, !cir.ptr> diff --git a/clang/test/CIR/CodeGen/bswap.cpp b/clang/test/CIR/CodeGen/bswap.cpp index 66a6ccf3ffec..4f5226d806ba 100644 --- a/clang/test/CIR/CodeGen/bswap.cpp +++ b/clang/test/CIR/CodeGen/bswap.cpp @@ -9,7 +9,7 @@ u16 bswap_u16(u16 x) { return __builtin_bswap16(x); } -// CHECK: cir.func @_Z9bswap_u16t +// CHECK: cir.func dso_local @_Z9bswap_u16t // CHECK: %{{.+}} = cir.bswap(%{{.+}} : !u16i) : !u16i // CHECK: } @@ -17,7 +17,7 @@ u32 bswap_u32(u32 x) { return __builtin_bswap32(x); } -// CHECK: cir.func @_Z9bswap_u32j +// CHECK: cir.func dso_local @_Z9bswap_u32j // CHECK: %{{.+}} = cir.bswap(%{{.+}} : !u32i) : !u32i // CHECK: } @@ -25,6 +25,6 @@ u64 bswap_u64(u64 x) { return __builtin_bswap64(x); } -// CHECK: cir.func @_Z9bswap_u64y +// CHECK: cir.func dso_local @_Z9bswap_u64y // CHECK: %{{.+}} = cir.bswap(%{{.+}} : !u64i) : !u64i // CHECK: } diff --git a/clang/test/CIR/CodeGen/build-deferred.cpp b/clang/test/CIR/CodeGen/build-deferred.cpp index ceb58684ae77..89dd52947e6f 100644 --- a/clang/test/CIR/CodeGen/build-deferred.cpp +++ b/clang/test/CIR/CodeGen/build-deferred.cpp @@ -23,5 +23,5 @@ void test() { // CHECK-NOT: cir.func linkonce_odr @_ZN6StringC2EPKc // CHECK-NOT: cir.func linkonce_odr @_ZN6StringC1EPKc -// CHECK: cir.func @_Z4testv() +// CHECK: cir.func dso_local @_Z4testv() // CHECK: cir.call @_ZN6StringC1Ev(%0) : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/builtin-alloca.c b/clang/test/CIR/CodeGen/builtin-alloca.c index 8a682a17cb63..d4e7498f10d8 100644 --- a/clang/test/CIR/CodeGen/builtin-alloca.c +++ b/clang/test/CIR/CodeGen/builtin-alloca.c @@ -9,7 +9,7 @@ void my_alloca(size_t n) { int *c1 = alloca(n); } -// CIR: cir.func @my_alloca([[ALLOCA_SIZE:%.*]]: !u64i +// CIR: cir.func dso_local @my_alloca([[ALLOCA_SIZE:%.*]]: !u64i // CIR: cir.store [[ALLOCA_SIZE]], [[LOCAL_VAR_ALLOCA_SIZE:%.*]] : !u64i, !cir.ptr // CIR: [[TMP_ALLOCA_SIZE:%.*]] = cir.load{{.*}} [[LOCAL_VAR_ALLOCA_SIZE]] : !cir.ptr, !u64i // CIR: [[ALLOCA_RES:%.*]] = cir.alloca !u8i, !cir.ptr, [[TMP_ALLOCA_SIZE]] : !u64i, ["bi_alloca"] {alignment = 16 : i64} @@ -28,7 +28,7 @@ void my___builtin_alloca(size_t n) int *c1 = (int *)__builtin_alloca(n); } -// CIR: cir.func @my___builtin_alloca([[ALLOCA_SIZE:%.*]]: !u64i +// CIR: cir.func dso_local @my___builtin_alloca([[ALLOCA_SIZE:%.*]]: !u64i // CIR: cir.store [[ALLOCA_SIZE]], [[LOCAL_VAR_ALLOCA_SIZE:%.*]] : !u64i, !cir.ptr // CIR: [[TMP_ALLOCA_SIZE:%.*]] = cir.load{{.*}} [[LOCAL_VAR_ALLOCA_SIZE]] : !cir.ptr, !u64i // CIR: [[ALLOCA_RES:%.*]] = cir.alloca !u8i, !cir.ptr, [[TMP_ALLOCA_SIZE]] : !u64i, ["bi_alloca"] {alignment = 16 : i64} @@ -47,7 +47,7 @@ void my__builtin_alloca_uninitialized(size_t n) int *c1 = (int *)__builtin_alloca_uninitialized(n); } -// CIR: cir.func @my__builtin_alloca_uninitialized([[ALLOCA_SIZE:%.*]]: !u64i +// CIR: cir.func dso_local @my__builtin_alloca_uninitialized([[ALLOCA_SIZE:%.*]]: !u64i // CIR: cir.store [[ALLOCA_SIZE]], [[LOCAL_VAR_ALLOCA_SIZE:%.*]] : !u64i, !cir.ptr // CIR: [[TMP_ALLOCA_SIZE:%.*]] = cir.load{{.*}} [[LOCAL_VAR_ALLOCA_SIZE]] : !cir.ptr, !u64i // CIR: [[ALLOCA_RES:%.*]] = cir.alloca !u8i, !cir.ptr, [[TMP_ALLOCA_SIZE]] : !u64i, ["bi_alloca"] {alignment = 16 : i64} diff --git a/clang/test/CIR/CodeGen/builtin-assume.cpp b/clang/test/CIR/CodeGen/builtin-assume.cpp index 73167a513cde..04e8f2b0b7a8 100644 --- a/clang/test/CIR/CodeGen/builtin-assume.cpp +++ b/clang/test/CIR/CodeGen/builtin-assume.cpp @@ -8,7 +8,7 @@ int test_assume(int x) { return x; } -// CIR: cir.func @_Z11test_assumei +// CIR: cir.func dso_local @_Z11test_assumei // CIR: %[[#x:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#zero:]] = cir.const #cir.int<0> : !s32i // CIR-NEXT: %[[#cond:]] = cir.cmp(gt, %[[#x]], %[[#zero]]) : !s32i, !cir.bool @@ -24,7 +24,7 @@ int test_assume_attr(int x) { return x; } -// CIR: cir.func @_Z16test_assume_attri +// CIR: cir.func dso_local @_Z16test_assume_attri // CIR: %[[#x:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#zero:]] = cir.const #cir.int<0> : !s32i // CIR-NEXT: %[[#cond:]] = cir.cmp(gt, %[[#x]], %[[#zero]]) : !s32i, !cir.bool @@ -40,7 +40,7 @@ int test_assume_aligned(int *ptr) { return *aligned; } -// CIR: cir.func @_Z19test_assume_alignedPi +// CIR: cir.func dso_local @_Z19test_assume_alignedPi // CIR: %[[#ptr:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr // CIR-NEXT: %[[#aligned:]] = cir.assume.aligned %[[#ptr]] : !cir.ptr[alignment 8] // CIR-NEXT: cir.store{{.*}} %[[#aligned]], %[[#aligned_slot:]] : !cir.ptr, !cir.ptr> @@ -58,7 +58,7 @@ int test_assume_aligned_offset(int *ptr) { return *aligned; } -// CIR: cir.func @_Z26test_assume_aligned_offsetPi +// CIR: cir.func dso_local @_Z26test_assume_aligned_offsetPi // CIR: %[[#ptr:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr // CIR-NEXT: %[[#offset:]] = cir.const #cir.int<4> : !s32i // CIR-NEXT: %[[#offset2:]] = cir.cast(integral, %[[#offset]] : !s32i), !u64i @@ -78,7 +78,7 @@ int test_separate_storage(int *p1, int *p2) { return *p1 + *p2; } -// CIR: cir.func @_Z21test_separate_storagePiS_ +// CIR: cir.func dso_local @_Z21test_separate_storagePiS_ // CIR: %[[#p1:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr // CIR-NEXT: %[[#p1_voidptr:]] = cir.cast(bitcast, %[[#p1]] : !cir.ptr), !cir.ptr // CIR-NEXT: %[[#p2:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr diff --git a/clang/test/CIR/CodeGen/builtin-bit-cast.cpp b/clang/test/CIR/CodeGen/builtin-bit-cast.cpp index 063d64d1a821..aeeae56d4f83 100644 --- a/clang/test/CIR/CodeGen/builtin-bit-cast.cpp +++ b/clang/test/CIR/CodeGen/builtin-bit-cast.cpp @@ -7,7 +7,7 @@ float test_scalar(int &oper) { return __builtin_bit_cast(float, oper); } -// CIR-LABEL: cir.func @_Z11test_scalarRi +// CIR-LABEL: cir.func dso_local @_Z11test_scalarRi // CIR: %[[#SRC_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr // CIR-NEXT: %[[#DST_PTR:]] = cir.cast(bitcast, %[[#SRC_PTR]] : !cir.ptr), !cir.ptr // CIR-NEXT: %{{.+}} = cir.load{{.*}} %[[#DST_PTR]] : !cir.ptr, !cir.float @@ -27,7 +27,7 @@ unsigned long test_aggregate_to_scalar(two_ints &ti) { return __builtin_bit_cast(unsigned long, ti); } -// CIR-LABEL: cir.func @_Z24test_aggregate_to_scalarR8two_ints +// CIR-LABEL: cir.func dso_local @_Z24test_aggregate_to_scalarR8two_ints // CIR: %[[#SRC_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr // CIR-NEXT: %[[#DST_PTR:]] = cir.cast(bitcast, %[[#SRC_PTR]] : !cir.ptr), !cir.ptr // CIR-NEXT: %{{.+}} = cir.load{{.*}} %[[#DST_PTR]] : !cir.ptr, !u64i @@ -47,7 +47,7 @@ two_floats test_aggregate_record(two_ints& ti) { return __builtin_bit_cast(two_floats, ti); } -// CIR-LABEL: cir.func @_Z21test_aggregate_recordR8two_ints +// CIR-LABEL: cir.func dso_local @_Z21test_aggregate_recordR8two_ints // CIR: %[[#SRC_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr // CIR-NEXT: %[[#SRC_VOID_PTR:]] = cir.cast(bitcast, %[[#SRC_PTR]] : !cir.ptr), !cir.ptr // CIR-NEXT: %[[#DST_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr @@ -66,7 +66,7 @@ two_floats test_aggregate_array(int (&ary)[2]) { return __builtin_bit_cast(two_floats, ary); } -// CIR-LABEL: cir.func @_Z20test_aggregate_arrayRA2_i +// CIR-LABEL: cir.func dso_local @_Z20test_aggregate_arrayRA2_i // CIR: %[[#SRC_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>>, !cir.ptr> // CIR-NEXT: %[[#SRC_VOID_PTR:]] = cir.cast(bitcast, %[[#SRC_PTR]] : !cir.ptr>), !cir.ptr // CIR-NEXT: %[[#DST_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr @@ -85,7 +85,7 @@ two_ints test_scalar_to_aggregate(unsigned long ul) { return __builtin_bit_cast(two_ints, ul); } -// CIR-LABEL: cir.func @_Z24test_scalar_to_aggregatem +// CIR-LABEL: cir.func dso_local @_Z24test_scalar_to_aggregatem // CIR: %[[#SRC_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr // CIR-NEXT: %[[#DST_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr // CIR-NEXT: %[[#SIZE:]] = cir.const #cir.int<8> : !u64i @@ -102,7 +102,7 @@ unsigned long test_array(int (&ary)[2]) { return __builtin_bit_cast(unsigned long, ary); } -// CIR-LABEL: cir.func @_Z10test_arrayRA2_i +// CIR-LABEL: cir.func dso_local @_Z10test_arrayRA2_i // CIR: %[[#SRC_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>>, !cir.ptr> // CIR-NEXT: %[[#DST_PTR:]] = cir.cast(bitcast, %[[#SRC_PTR]] : !cir.ptr>), !cir.ptr // CIR-NEXT: %{{.+}} = cir.load{{.*}} %[[#DST_PTR]] : !cir.ptr, !u64i @@ -117,7 +117,7 @@ two_ints test_rvalue_aggregate() { return __builtin_bit_cast(two_ints, 42ul); } -// CIR-LABEL: cir.func @_Z21test_rvalue_aggregatev() +// CIR-LABEL: cir.func dso_local @_Z21test_rvalue_aggregatev() // CIR: cir.scope { // CIR-NEXT: %[[#TMP_SLOT:]] = cir.alloca !u64i, !cir.ptr // CIR-NEXT: %[[#A:]] = cir.const #cir.int<42> : !u64i diff --git a/clang/test/CIR/CodeGen/builtin-constant-evaluated.cpp b/clang/test/CIR/CodeGen/builtin-constant-evaluated.cpp index 7aee7a60bcc4..c83a21f6708d 100644 --- a/clang/test/CIR/CodeGen/builtin-constant-evaluated.cpp +++ b/clang/test/CIR/CodeGen/builtin-constant-evaluated.cpp @@ -3,7 +3,7 @@ auto func() { return __builtin_strcmp("", ""); - // CIR: cir.func @_Z4funcv() + // CIR: cir.func dso_local @_Z4funcv() // CIR-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CIR-NEXT: %1 = cir.const #cir.int<0> : !s32i // CIR-NEXT: cir.store %1, %0 : !s32i, !cir.ptr diff --git a/clang/test/CIR/CodeGen/builtin-constant-p.c b/clang/test/CIR/CodeGen/builtin-constant-p.c index 9ba08c996bec..58c071b16f16 100644 --- a/clang/test/CIR/CodeGen/builtin-constant-p.c +++ b/clang/test/CIR/CodeGen/builtin-constant-p.c @@ -6,7 +6,7 @@ int foo() { return __builtin_constant_p(a); } -// CIR: cir.func no_proto @foo() -> !s32i extra(#fn_attr) +// CIR: cir.func no_proto dso_local @foo() -> !s32i extra(#fn_attr) // CIR: [[TMP0:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CIR: [[TMP1:%.*]] = cir.get_global @a : !cir.ptr // CIR: [[TMP2:%.*]] = cir.load{{.*}} [[TMP1]] : !cir.ptr, !s32i @@ -24,4 +24,3 @@ int foo() { // LLVM: store i32 [[TMP5]], ptr [[TMP1]] // LLVM: [[TMP6:%.*]] = load i32, ptr [[TMP1]] // LLVM: ret i32 [[TMP6]] - diff --git a/clang/test/CIR/CodeGen/builtin-floating-point.c b/clang/test/CIR/CodeGen/builtin-floating-point.c index 8af6fd7b4ed4..e2c7fddde940 100644 --- a/clang/test/CIR/CodeGen/builtin-floating-point.c +++ b/clang/test/CIR/CodeGen/builtin-floating-point.c @@ -7,7 +7,7 @@ long my_lroundf(float f) { return __builtin_lroundf(f); - // CHECK: cir.func @my_lroundf + // CHECK: cir.func dso_local @my_lroundf // CHECK: %{{.+}} = cir.lround %{{.+}} : !cir.float -> !s64i // LLVM: define dso_local i64 @my_lroundf @@ -17,7 +17,7 @@ long my_lroundf(float f) { long my_lround(double f) { return __builtin_lround(f); - // CHECK: cir.func @my_lround + // CHECK: cir.func dso_local @my_lround // CHECK: %{{.+}} = cir.lround %{{.+}} : !cir.double -> !s64i // LLVM: define dso_local i64 @my_lround @@ -27,7 +27,7 @@ long my_lround(double f) { long my_lroundl(long double f) { return __builtin_lroundl(f); - // CHECK: cir.func @my_lroundl + // CHECK: cir.func dso_local @my_lroundl // CHECK: %{{.+}} = cir.lround %{{.+}} : !cir.long_double -> !s64i // AARCH64: %{{.+}} = cir.lround %{{.+}} : !cir.long_double -> !s64i @@ -42,7 +42,7 @@ long lroundl(long double); long call_lroundf(float f) { return lroundf(f); - // CHECK: cir.func @call_lroundf + // CHECK: cir.func dso_local @call_lroundf // CHECK: %{{.+}} = cir.lround %{{.+}} : !cir.float -> !s64i // LLVM: define dso_local i64 @call_lroundf @@ -52,7 +52,7 @@ long call_lroundf(float f) { long call_lround(double f) { return lround(f); - // CHECK: cir.func @call_lround + // CHECK: cir.func dso_local @call_lround // CHECK: %{{.+}} = cir.lround %{{.+}} : !cir.double -> !s64i // LLVM: define dso_local i64 @call_lround @@ -62,7 +62,7 @@ long call_lround(double f) { long call_lroundl(long double f) { return lroundl(f); - // CHECK: cir.func @call_lroundl + // CHECK: cir.func dso_local @call_lroundl // CHECK: %{{.+}} = cir.lround %{{.+}} : !cir.long_double -> !s64i // AARCH64: %{{.+}} = cir.lround %{{.+}} : !cir.long_double -> !s64i @@ -75,7 +75,7 @@ long call_lroundl(long double f) { long long my_llroundf(float f) { return __builtin_llroundf(f); - // CHECK: cir.func @my_llroundf + // CHECK: cir.func dso_local @my_llroundf // CHECK: %{{.+}} = cir.llround %{{.+}} : !cir.float -> !s64i // LLVM: define dso_local i64 @my_llroundf @@ -85,7 +85,7 @@ long long my_llroundf(float f) { long long my_llround(double f) { return __builtin_llround(f); - // CHECK: cir.func @my_llround + // CHECK: cir.func dso_local @my_llround // CHECK: %{{.+}} = cir.llround %{{.+}} : !cir.double -> !s64i // LLVM: define dso_local i64 @my_llround @@ -95,7 +95,7 @@ long long my_llround(double f) { long long my_llroundl(long double f) { return __builtin_llroundl(f); - // CHECK: cir.func @my_llroundl + // CHECK: cir.func dso_local @my_llroundl // CHECK: %{{.+}} = cir.llround %{{.+}} : !cir.long_double -> !s64i // AARCH64: %{{.+}} = cir.llround %{{.+}} : !cir.long_double -> !s64i @@ -110,7 +110,7 @@ long long llroundl(long double); long long call_llroundf(float f) { return llroundf(f); - // CHECK: cir.func @call_llroundf + // CHECK: cir.func dso_local @call_llroundf // CHECK: %{{.+}} = cir.llround %{{.+}} : !cir.float -> !s64i // LLVM: define dso_local i64 @call_llroundf @@ -120,7 +120,7 @@ long long call_llroundf(float f) { long long call_llround(double f) { return llround(f); - // CHECK: cir.func @call_llround + // CHECK: cir.func dso_local @call_llround // CHECK: %{{.+}} = cir.llround %{{.+}} : !cir.double -> !s64i // LLVM: define dso_local i64 @call_llround @@ -130,7 +130,7 @@ long long call_llround(double f) { long long call_llroundl(long double f) { return llroundl(f); - // CHECK: cir.func @call_llroundl + // CHECK: cir.func dso_local @call_llroundl // CHECK: %{{.+}} = cir.llround %{{.+}} : !cir.long_double -> !s64i // AARCH64: %{{.+}} = cir.llround %{{.+}} : !cir.long_double -> !s64i @@ -143,7 +143,7 @@ long long call_llroundl(long double f) { long my_lrintf(float f) { return __builtin_lrintf(f); - // CHECK: cir.func @my_lrintf + // CHECK: cir.func dso_local @my_lrintf // CHECK: %{{.+}} = cir.lrint %{{.+}} : !cir.float -> !s64i // LLVM: define dso_local i64 @my_lrintf @@ -153,7 +153,7 @@ long my_lrintf(float f) { long my_lrint(double f) { return __builtin_lrint(f); - // CHECK: cir.func @my_lrint + // CHECK: cir.func dso_local @my_lrint // CHECK: %{{.+}} = cir.lrint %{{.+}} : !cir.double -> !s64i // LLVM: define dso_local i64 @my_lrint @@ -163,7 +163,7 @@ long my_lrint(double f) { long my_lrintl(long double f) { return __builtin_lrintl(f); - // CHECK: cir.func @my_lrintl + // CHECK: cir.func dso_local @my_lrintl // CHECK: %{{.+}} = cir.lrint %{{.+}} : !cir.long_double -> !s64i // AARCH64: %{{.+}} = cir.lrint %{{.+}} : !cir.long_double -> !s64i @@ -178,7 +178,7 @@ long lrintl(long double); long call_lrintf(float f) { return lrintf(f); - // CHECK: cir.func @call_lrintf + // CHECK: cir.func dso_local @call_lrintf // CHECK: %{{.+}} = cir.lrint %{{.+}} : !cir.float -> !s64i // LLVM: define dso_local i64 @call_lrintf @@ -188,7 +188,7 @@ long call_lrintf(float f) { long call_lrint(double f) { return lrint(f); - // CHECK: cir.func @call_lrint + // CHECK: cir.func dso_local @call_lrint // CHECK: %{{.+}} = cir.lrint %{{.+}} : !cir.double -> !s64i // LLVM: define dso_local i64 @call_lrint @@ -198,7 +198,7 @@ long call_lrint(double f) { long call_lrintl(long double f) { return lrintl(f); - // CHECK: cir.func @call_lrintl + // CHECK: cir.func dso_local @call_lrintl // CHECK: %{{.+}} = cir.lrint %{{.+}} : !cir.long_double -> !s64i // AARCH64: %{{.+}} = cir.lrint %{{.+}} : !cir.long_double -> !s64i @@ -211,7 +211,7 @@ long call_lrintl(long double f) { long long my_llrintf(float f) { return __builtin_llrintf(f); - // CHECK: cir.func @my_llrintf + // CHECK: cir.func dso_local @my_llrintf // CHECK: %{{.+}} = cir.llrint %{{.+}} : !cir.float -> !s64i // LLVM: define dso_local i64 @my_llrintf @@ -221,7 +221,7 @@ long long my_llrintf(float f) { long long my_llrint(double f) { return __builtin_llrint(f); - // CHECK: cir.func @my_llrint + // CHECK: cir.func dso_local @my_llrint // CHECK: %{{.+}} = cir.llrint %{{.+}} : !cir.double -> !s64i // LLVM: define dso_local i64 @my_llrint @@ -231,7 +231,7 @@ long long my_llrint(double f) { long long my_llrintl(long double f) { return __builtin_llrintl(f); - // CHECK: cir.func @my_llrintl + // CHECK: cir.func dso_local @my_llrintl // CHECK: %{{.+}} = cir.llrint %{{.+}} : !cir.long_double -> !s64i // AARCH64: %{{.+}} = cir.llrint %{{.+}} : !cir.long_double -> !s64i @@ -246,7 +246,7 @@ long long llrintl(long double); long long call_llrintf(float f) { return llrintf(f); - // CHECK: cir.func @call_llrintf + // CHECK: cir.func dso_local @call_llrintf // CHECK: %{{.+}} = cir.llrint %{{.+}} : !cir.float -> !s64i // LLVM: define dso_local i64 @call_llrintf @@ -256,7 +256,7 @@ long long call_llrintf(float f) { long long call_llrint(double f) { return llrint(f); - // CHECK: cir.func @call_llrint + // CHECK: cir.func dso_local @call_llrint // CHECK: %{{.+}} = cir.llrint %{{.+}} : !cir.double -> !s64i // LLVM: define dso_local i64 @call_llrint @@ -266,7 +266,7 @@ long long call_llrint(double f) { long long call_llrintl(long double f) { return llrintl(f); - // CHECK: cir.func @call_llrintl + // CHECK: cir.func dso_local @call_llrintl // CHECK: %{{.+}} = cir.llrint %{{.+}} : !cir.long_double -> !s64i // AARCH64: %{{.+}} = cir.llrint %{{.+}} : !cir.long_double -> !s64i @@ -279,7 +279,7 @@ long long call_llrintl(long double f) { float my_ceilf(float f) { return __builtin_ceilf(f); - // CHECK: cir.func @my_ceilf + // CHECK: cir.func dso_local @my_ceilf // CHECK: {{.+}} = cir.ceil {{.+}} : !cir.float // LLVM: define dso_local float @my_ceilf(float %0) @@ -289,7 +289,7 @@ float my_ceilf(float f) { double my_ceil(double f) { return __builtin_ceil(f); - // CHECK: cir.func @my_ceil + // CHECK: cir.func dso_local @my_ceil // CHECK: {{.+}} = cir.ceil {{.+}} : !cir.double // LLVM: define dso_local double @my_ceil(double %0) @@ -299,7 +299,7 @@ double my_ceil(double f) { long double my_ceill(long double f) { return __builtin_ceill(f); - // CHECK: cir.func @my_ceill + // CHECK: cir.func dso_local @my_ceill // CHECK: {{.+}} = cir.ceil {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.ceil {{.+}} : !cir.long_double @@ -314,7 +314,7 @@ long double ceill(long double); float call_ceilf(float f) { return ceilf(f); - // CHECK: cir.func @call_ceilf + // CHECK: cir.func dso_local @call_ceilf // CHECK: {{.+}} = cir.ceil {{.+}} : !cir.float // LLVM: define dso_local float @call_ceilf(float %0) @@ -324,7 +324,7 @@ float call_ceilf(float f) { double call_ceil(double f) { return ceil(f); - // CHECK: cir.func @call_ceil + // CHECK: cir.func dso_local @call_ceil // CHECK: {{.+}} = cir.ceil {{.+}} : !cir.double // LLVM: define dso_local double @call_ceil(double %0) @@ -334,7 +334,7 @@ double call_ceil(double f) { long double call_ceill(long double f) { return ceill(f); - // CHECK: cir.func @call_ceill + // CHECK: cir.func dso_local @call_ceill // CHECK: {{.+}} = cir.ceil {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.ceil {{.+}} : !cir.long_double @@ -347,7 +347,7 @@ long double call_ceill(long double f) { float my_cosf(float f) { return __builtin_cosf(f); - // CHECK: cir.func @my_cosf + // CHECK: cir.func dso_local @my_cosf // CHECK: {{.+}} = cir.cos {{.+}} : !cir.float // LLVM: define dso_local float @my_cosf(float %0) @@ -357,7 +357,7 @@ float my_cosf(float f) { double my_cos(double f) { return __builtin_cos(f); - // CHECK: cir.func @my_cos + // CHECK: cir.func dso_local @my_cos // CHECK: {{.+}} = cir.cos {{.+}} : !cir.double // LLVM: define dso_local double @my_cos(double %0) @@ -367,7 +367,7 @@ double my_cos(double f) { long double my_cosl(long double f) { return __builtin_cosl(f); - // CHECK: cir.func @my_cosl + // CHECK: cir.func dso_local @my_cosl // CHECK: {{.+}} = cir.cos {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.cos {{.+}} : !cir.long_double @@ -382,7 +382,7 @@ long double cosl(long double); float call_cosf(float f) { return cosf(f); - // CHECK: cir.func @call_cosf + // CHECK: cir.func dso_local @call_cosf // CHECK: {{.+}} = cir.cos {{.+}} : !cir.float // LLVM: define dso_local float @call_cosf(float %0) @@ -392,7 +392,7 @@ float call_cosf(float f) { double call_cos(double f) { return cos(f); - // CHECK: cir.func @call_cos + // CHECK: cir.func dso_local @call_cos // CHECK: {{.+}} = cir.cos {{.+}} : !cir.double // LLVM: define dso_local double @call_cos(double %0) @@ -402,7 +402,7 @@ double call_cos(double f) { long double call_cosl(long double f) { return cosl(f); - // CHECK: cir.func @call_cosl + // CHECK: cir.func dso_local @call_cosl // CHECK: {{.+}} = cir.cos {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.cos {{.+}} : !cir.long_double @@ -415,7 +415,7 @@ long double call_cosl(long double f) { float my_expf(float f) { return __builtin_expf(f); - // CHECK: cir.func @my_expf + // CHECK: cir.func dso_local @my_expf // CHECK: {{.+}} = cir.exp {{.+}} : !cir.float // LLVM: define dso_local float @my_expf(float %0) @@ -425,7 +425,7 @@ float my_expf(float f) { double my_exp(double f) { return __builtin_exp(f); - // CHECK: cir.func @my_exp + // CHECK: cir.func dso_local @my_exp // CHECK: {{.+}} = cir.exp {{.+}} : !cir.double // LLVM: define dso_local double @my_exp(double %0) @@ -435,7 +435,7 @@ double my_exp(double f) { long double my_expl(long double f) { return __builtin_expl(f); - // CHECK: cir.func @my_expl + // CHECK: cir.func dso_local @my_expl // CHECK: {{.+}} = cir.exp {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.exp {{.+}} : !cir.long_double @@ -450,7 +450,7 @@ long double expl(long double); float call_expf(float f) { return expf(f); - // CHECK: cir.func @call_expf + // CHECK: cir.func dso_local @call_expf // CHECK: {{.+}} = cir.exp {{.+}} : !cir.float // LLVM: define dso_local float @call_expf(float %0) @@ -460,7 +460,7 @@ float call_expf(float f) { double call_exp(double f) { return exp(f); - // CHECK: cir.func @call_exp + // CHECK: cir.func dso_local @call_exp // CHECK: {{.+}} = cir.exp {{.+}} : !cir.double // LLVM: define dso_local double @call_exp(double %0) @@ -470,7 +470,7 @@ double call_exp(double f) { long double call_expl(long double f) { return expl(f); - // CHECK: cir.func @call_expl + // CHECK: cir.func dso_local @call_expl // CHECK: {{.+}} = cir.exp {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.exp {{.+}} : !cir.long_double @@ -483,7 +483,7 @@ long double call_expl(long double f) { float my_exp2f(float f) { return __builtin_exp2f(f); - // CHECK: cir.func @my_exp2f + // CHECK: cir.func dso_local @my_exp2f // CHECK: {{.+}} = cir.exp2 {{.+}} : !cir.float // LLVM: define dso_local float @my_exp2f(float %0) @@ -493,7 +493,7 @@ float my_exp2f(float f) { double my_exp2(double f) { return __builtin_exp2(f); - // CHECK: cir.func @my_exp2 + // CHECK: cir.func dso_local @my_exp2 // CHECK: {{.+}} = cir.exp2 {{.+}} : !cir.double // LLVM: define dso_local double @my_exp2(double %0) @@ -503,7 +503,7 @@ double my_exp2(double f) { long double my_exp2l(long double f) { return __builtin_exp2l(f); - // CHECK: cir.func @my_exp2l + // CHECK: cir.func dso_local @my_exp2l // CHECK: {{.+}} = cir.exp2 {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.exp2 {{.+}} : !cir.long_double @@ -518,7 +518,7 @@ long double exp2l(long double); float call_exp2f(float f) { return exp2f(f); - // CHECK: cir.func @call_exp2f + // CHECK: cir.func dso_local @call_exp2f // CHECK: {{.+}} = cir.exp2 {{.+}} : !cir.float // LLVM: define dso_local float @call_exp2f(float %0) @@ -528,7 +528,7 @@ float call_exp2f(float f) { double call_exp2(double f) { return exp2(f); - // CHECK: cir.func @call_exp2 + // CHECK: cir.func dso_local @call_exp2 // CHECK: {{.+}} = cir.exp2 {{.+}} : !cir.double // LLVM: define dso_local double @call_exp2(double %0) @@ -538,7 +538,7 @@ double call_exp2(double f) { long double call_exp2l(long double f) { return exp2l(f); - // CHECK: cir.func @call_exp2l + // CHECK: cir.func dso_local @call_exp2l // CHECK: {{.+}} = cir.exp2 {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.exp2 {{.+}} : !cir.long_double @@ -551,7 +551,7 @@ long double call_exp2l(long double f) { float my_floorf(float f) { return __builtin_floorf(f); - // CHECK: cir.func @my_floorf + // CHECK: cir.func dso_local @my_floorf // CHECK: {{.+}} = cir.floor {{.+}} : !cir.float // LLVM: define dso_local float @my_floorf(float %0) @@ -561,7 +561,7 @@ float my_floorf(float f) { double my_floor(double f) { return __builtin_floor(f); - // CHECK: cir.func @my_floor + // CHECK: cir.func dso_local @my_floor // CHECK: {{.+}} = cir.floor {{.+}} : !cir.double // LLVM: define dso_local double @my_floor(double %0) @@ -571,7 +571,7 @@ double my_floor(double f) { long double my_floorl(long double f) { return __builtin_floorl(f); - // CHECK: cir.func @my_floorl + // CHECK: cir.func dso_local @my_floorl // CHECK: {{.+}} = cir.floor {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.floor {{.+}} : !cir.long_double @@ -586,7 +586,7 @@ long double floorl(long double); float call_floorf(float f) { return floorf(f); - // CHECK: cir.func @call_floorf + // CHECK: cir.func dso_local @call_floorf // CHECK: {{.+}} = cir.floor {{.+}} : !cir.float // LLVM: define dso_local float @call_floorf(float %0) @@ -596,7 +596,7 @@ float call_floorf(float f) { double call_floor(double f) { return floor(f); - // CHECK: cir.func @call_floor + // CHECK: cir.func dso_local @call_floor // CHECK: {{.+}} = cir.floor {{.+}} : !cir.double // LLVM: define dso_local double @call_floor(double %0) @@ -606,7 +606,7 @@ double call_floor(double f) { long double call_floorl(long double f) { return floorl(f); - // CHECK: cir.func @call_floorl + // CHECK: cir.func dso_local @call_floorl // CHECK: {{.+}} = cir.floor {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.floor {{.+}} : !cir.long_double @@ -619,7 +619,7 @@ long double call_floorl(long double f) { float my_logf(float f) { return __builtin_logf(f); - // CHECK: cir.func @my_logf + // CHECK: cir.func dso_local @my_logf // CHECK: {{.+}} = cir.log {{.+}} : !cir.float // LLVM: define dso_local float @my_logf(float %0) @@ -629,7 +629,7 @@ float my_logf(float f) { double my_log(double f) { return __builtin_log(f); - // CHECK: cir.func @my_log + // CHECK: cir.func dso_local @my_log // CHECK: {{.+}} = cir.log {{.+}} : !cir.double // LLVM: define dso_local double @my_log(double %0) @@ -639,7 +639,7 @@ double my_log(double f) { long double my_logl(long double f) { return __builtin_logl(f); - // CHECK: cir.func @my_logl + // CHECK: cir.func dso_local @my_logl // CHECK: {{.+}} = cir.log {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.log {{.+}} : !cir.long_double @@ -654,7 +654,7 @@ long double logl(long double); float call_logf(float f) { return logf(f); - // CHECK: cir.func @call_logf + // CHECK: cir.func dso_local @call_logf // CHECK: {{.+}} = cir.log {{.+}} : !cir.float // LLVM: define dso_local float @call_logf(float %0) @@ -664,7 +664,7 @@ float call_logf(float f) { double call_log(double f) { return log(f); - // CHECK: cir.func @call_log + // CHECK: cir.func dso_local @call_log // CHECK: {{.+}} = cir.log {{.+}} : !cir.double // LLVM: define dso_local double @call_log(double %0) @@ -674,7 +674,7 @@ double call_log(double f) { long double call_logl(long double f) { return logl(f); - // CHECK: cir.func @call_logl + // CHECK: cir.func dso_local @call_logl // CHECK: {{.+}} = cir.log {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.log {{.+}} : !cir.long_double @@ -687,7 +687,7 @@ long double call_logl(long double f) { float my_log10f(float f) { return __builtin_log10f(f); - // CHECK: cir.func @my_log10f + // CHECK: cir.func dso_local @my_log10f // CHECK: {{.+}} = cir.log10 {{.+}} : !cir.float // LLVM: define dso_local float @my_log10f(float %0) @@ -697,7 +697,7 @@ float my_log10f(float f) { double my_log10(double f) { return __builtin_log10(f); - // CHECK: cir.func @my_log10 + // CHECK: cir.func dso_local @my_log10 // CHECK: {{.+}} = cir.log10 {{.+}} : !cir.double // LLVM: define dso_local double @my_log10(double %0) @@ -707,7 +707,7 @@ double my_log10(double f) { long double my_log10l(long double f) { return __builtin_log10l(f); - // CHECK: cir.func @my_log10l + // CHECK: cir.func dso_local @my_log10l // CHECK: {{.+}} = cir.log10 {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.log10 {{.+}} : !cir.long_double @@ -722,7 +722,7 @@ long double log10l(long double); float call_log10f(float f) { return log10f(f); - // CHECK: cir.func @call_log10f + // CHECK: cir.func dso_local @call_log10f // CHECK: {{.+}} = cir.log10 {{.+}} : !cir.float // LLVM: define dso_local float @call_log10f(float %0) @@ -732,7 +732,7 @@ float call_log10f(float f) { double call_log10(double f) { return log10(f); - // CHECK: cir.func @call_log10 + // CHECK: cir.func dso_local @call_log10 // CHECK: {{.+}} = cir.log10 {{.+}} : !cir.double // LLVM: define dso_local double @call_log10(double %0) @@ -742,7 +742,7 @@ double call_log10(double f) { long double call_log10l(long double f) { return log10l(f); - // CHECK: cir.func @call_log10l + // CHECK: cir.func dso_local @call_log10l // CHECK: {{.+}} = cir.log10 {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.log10 {{.+}} : !cir.long_double @@ -755,7 +755,7 @@ long double call_log10l(long double f) { float my_log2f(float f) { return __builtin_log2f(f); - // CHECK: cir.func @my_log2f + // CHECK: cir.func dso_local @my_log2f // CHECK: {{.+}} = cir.log2 {{.+}} : !cir.float // LLVM: define dso_local float @my_log2f(float %0) @@ -765,7 +765,7 @@ float my_log2f(float f) { double my_log2(double f) { return __builtin_log2(f); - // CHECK: cir.func @my_log2 + // CHECK: cir.func dso_local @my_log2 // CHECK: {{.+}} = cir.log2 {{.+}} : !cir.double // LLVM: define dso_local double @my_log2(double %0) @@ -775,7 +775,7 @@ double my_log2(double f) { long double my_log2l(long double f) { return __builtin_log2l(f); - // CHECK: cir.func @my_log2l + // CHECK: cir.func dso_local @my_log2l // CHECK: {{.+}} = cir.log2 {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.log2 {{.+}} : !cir.long_double @@ -790,7 +790,7 @@ long double log2l(long double); float call_log2f(float f) { return log2f(f); - // CHECK: cir.func @call_log2f + // CHECK: cir.func dso_local @call_log2f // CHECK: {{.+}} = cir.log2 {{.+}} : !cir.float // LLVM: define dso_local float @call_log2f(float %0) @@ -800,7 +800,7 @@ float call_log2f(float f) { double call_log2(double f) { return log2(f); - // CHECK: cir.func @call_log2 + // CHECK: cir.func dso_local @call_log2 // CHECK: {{.+}} = cir.log2 {{.+}} : !cir.double // LLVM: define dso_local double @call_log2(double %0) @@ -810,7 +810,7 @@ double call_log2(double f) { long double call_log2l(long double f) { return log2l(f); - // CHECK: cir.func @call_log2l + // CHECK: cir.func dso_local @call_log2l // CHECK: {{.+}} = cir.log2 {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.log2 {{.+}} : !cir.long_double @@ -823,7 +823,7 @@ long double call_log2l(long double f) { float my_nearbyintf(float f) { return __builtin_nearbyintf(f); - // CHECK: cir.func @my_nearbyintf + // CHECK: cir.func dso_local @my_nearbyintf // CHECK: {{.+}} = cir.nearbyint {{.+}} : !cir.float // LLVM: define dso_local float @my_nearbyintf(float %0) @@ -833,7 +833,7 @@ float my_nearbyintf(float f) { double my_nearbyint(double f) { return __builtin_nearbyint(f); - // CHECK: cir.func @my_nearbyint + // CHECK: cir.func dso_local @my_nearbyint // CHECK: {{.+}} = cir.nearbyint {{.+}} : !cir.double // LLVM: define dso_local double @my_nearbyint(double %0) @@ -843,7 +843,7 @@ double my_nearbyint(double f) { long double my_nearbyintl(long double f) { return __builtin_nearbyintl(f); - // CHECK: cir.func @my_nearbyintl + // CHECK: cir.func dso_local @my_nearbyintl // CHECK: {{.+}} = cir.nearbyint {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.nearbyint {{.+}} : !cir.long_double @@ -858,7 +858,7 @@ long double nearbyintl(long double); float call_nearbyintf(float f) { return nearbyintf(f); - // CHECK: cir.func @call_nearbyintf + // CHECK: cir.func dso_local @call_nearbyintf // CHECK: {{.+}} = cir.nearbyint {{.+}} : !cir.float // LLVM: define dso_local float @call_nearbyintf(float %0) @@ -868,7 +868,7 @@ float call_nearbyintf(float f) { double call_nearbyint(double f) { return nearbyint(f); - // CHECK: cir.func @call_nearbyint + // CHECK: cir.func dso_local @call_nearbyint // CHECK: {{.+}} = cir.nearbyint {{.+}} : !cir.double // LLVM: define dso_local double @call_nearbyint(double %0) @@ -878,7 +878,7 @@ double call_nearbyint(double f) { long double call_nearbyintl(long double f) { return nearbyintl(f); - // CHECK: cir.func @call_nearbyintl + // CHECK: cir.func dso_local @call_nearbyintl // CHECK: {{.+}} = cir.nearbyint {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.nearbyint {{.+}} : !cir.long_double @@ -891,7 +891,7 @@ long double call_nearbyintl(long double f) { float my_rintf(float f) { return __builtin_rintf(f); - // CHECK: cir.func @my_rintf + // CHECK: cir.func dso_local @my_rintf // CHECK: {{.+}} = cir.rint {{.+}} : !cir.float // LLVM: define dso_local float @my_rintf(float %0) @@ -901,7 +901,7 @@ float my_rintf(float f) { double my_rint(double f) { return __builtin_rint(f); - // CHECK: cir.func @my_rint + // CHECK: cir.func dso_local @my_rint // CHECK: {{.+}} = cir.rint {{.+}} : !cir.double // LLVM: define dso_local double @my_rint(double %0) @@ -911,7 +911,7 @@ double my_rint(double f) { long double my_rintl(long double f) { return __builtin_rintl(f); - // CHECK: cir.func @my_rintl + // CHECK: cir.func dso_local @my_rintl // CHECK: {{.+}} = cir.rint {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.rint {{.+}} : !cir.long_double @@ -926,7 +926,7 @@ long double rintl(long double); float call_rintf(float f) { return rintf(f); - // CHECK: cir.func @call_rintf + // CHECK: cir.func dso_local @call_rintf // CHECK: {{.+}} = cir.rint {{.+}} : !cir.float // LLVM: define dso_local float @call_rintf(float %0) @@ -936,7 +936,7 @@ float call_rintf(float f) { double call_rint(double f) { return rint(f); - // CHECK: cir.func @call_rint + // CHECK: cir.func dso_local @call_rint // CHECK: {{.+}} = cir.rint {{.+}} : !cir.double // LLVM: define dso_local double @call_rint(double %0) @@ -946,7 +946,7 @@ double call_rint(double f) { long double call_rintl(long double f) { return rintl(f); - // CHECK: cir.func @call_rintl + // CHECK: cir.func dso_local @call_rintl // CHECK: {{.+}} = cir.rint {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.rint {{.+}} : !cir.long_double @@ -959,7 +959,7 @@ long double call_rintl(long double f) { float my_roundf(float f) { return __builtin_roundf(f); - // CHECK: cir.func @my_roundf + // CHECK: cir.func dso_local @my_roundf // CHECK: {{.+}} = cir.round {{.+}} : !cir.float // LLVM: define dso_local float @my_roundf(float %0) @@ -969,7 +969,7 @@ float my_roundf(float f) { double my_round(double f) { return __builtin_round(f); - // CHECK: cir.func @my_round + // CHECK: cir.func dso_local @my_round // CHECK: {{.+}} = cir.round {{.+}} : !cir.double // LLVM: define dso_local double @my_round(double %0) @@ -979,7 +979,7 @@ double my_round(double f) { long double my_roundl(long double f) { return __builtin_roundl(f); - // CHECK: cir.func @my_roundl + // CHECK: cir.func dso_local @my_roundl // CHECK: {{.+}} = cir.round {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.round {{.+}} : !cir.long_double @@ -994,7 +994,7 @@ long double roundl(long double); float call_roundf(float f) { return roundf(f); - // CHECK: cir.func @call_roundf + // CHECK: cir.func dso_local @call_roundf // CHECK: {{.+}} = cir.round {{.+}} : !cir.float // LLVM: define dso_local float @call_roundf(float %0) @@ -1004,7 +1004,7 @@ float call_roundf(float f) { double call_round(double f) { return round(f); - // CHECK: cir.func @call_round + // CHECK: cir.func dso_local @call_round // CHECK: {{.+}} = cir.round {{.+}} : !cir.double // LLVM: define dso_local double @call_round(double %0) @@ -1014,7 +1014,7 @@ double call_round(double f) { long double call_roundl(long double f) { return roundl(f); - // CHECK: cir.func @call_roundl + // CHECK: cir.func dso_local @call_roundl // CHECK: {{.+}} = cir.round {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.round {{.+}} : !cir.long_double @@ -1027,7 +1027,7 @@ long double call_roundl(long double f) { float my_sinf(float f) { return __builtin_sinf(f); - // CHECK: cir.func @my_sinf + // CHECK: cir.func dso_local @my_sinf // CHECK: {{.+}} = cir.sin {{.+}} : !cir.float // LLVM: define dso_local float @my_sinf(float %0) @@ -1037,7 +1037,7 @@ float my_sinf(float f) { double my_sin(double f) { return __builtin_sin(f); - // CHECK: cir.func @my_sin + // CHECK: cir.func dso_local @my_sin // CHECK: {{.+}} = cir.sin {{.+}} : !cir.double // LLVM: define dso_local double @my_sin(double %0) @@ -1047,7 +1047,7 @@ double my_sin(double f) { long double my_sinl(long double f) { return __builtin_sinl(f); - // CHECK: cir.func @my_sinl + // CHECK: cir.func dso_local @my_sinl // CHECK: {{.+}} = cir.sin {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.sin {{.+}} : !cir.long_double @@ -1062,7 +1062,7 @@ long double sinl(long double); float call_sinf(float f) { return sinf(f); - // CHECK: cir.func @call_sinf + // CHECK: cir.func dso_local @call_sinf // CHECK: {{.+}} = cir.sin {{.+}} : !cir.float // LLVM: define dso_local float @call_sinf(float %0) @@ -1072,7 +1072,7 @@ float call_sinf(float f) { double call_sin(double f) { return sin(f); - // CHECK: cir.func @call_sin + // CHECK: cir.func dso_local @call_sin // CHECK: {{.+}} = cir.sin {{.+}} : !cir.double // LLVM: define dso_local double @call_sin(double %0) @@ -1082,7 +1082,7 @@ double call_sin(double f) { long double call_sinl(long double f) { return sinl(f); - // CHECK: cir.func @call_sinl + // CHECK: cir.func dso_local @call_sinl // CHECK: {{.+}} = cir.sin {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.sin {{.+}} : !cir.long_double @@ -1095,7 +1095,7 @@ long double call_sinl(long double f) { float my_sqrtf(float f) { return __builtin_sqrtf(f); - // CHECK: cir.func @my_sqrtf + // CHECK: cir.func dso_local @my_sqrtf // CHECK: {{.+}} = cir.sqrt {{.+}} : !cir.float // LLVM: define dso_local float @my_sqrtf(float %0) @@ -1105,7 +1105,7 @@ float my_sqrtf(float f) { double my_sqrt(double f) { return __builtin_sqrt(f); - // CHECK: cir.func @my_sqrt + // CHECK: cir.func dso_local @my_sqrt // CHECK: {{.+}} = cir.sqrt {{.+}} : !cir.double // LLVM: define dso_local double @my_sqrt(double %0) @@ -1115,7 +1115,7 @@ double my_sqrt(double f) { long double my_sqrtl(long double f) { return __builtin_sqrtl(f); - // CHECK: cir.func @my_sqrtl + // CHECK: cir.func dso_local @my_sqrtl // CHECK: {{.+}} = cir.sqrt {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.sqrt {{.+}} : !cir.long_double @@ -1130,7 +1130,7 @@ long double sqrtl(long double); float call_sqrtf(float f) { return sqrtf(f); - // CHECK: cir.func @call_sqrtf + // CHECK: cir.func dso_local @call_sqrtf // CHECK: {{.+}} = cir.sqrt {{.+}} : !cir.float // LLVM: define dso_local float @call_sqrtf(float %0) @@ -1140,7 +1140,7 @@ float call_sqrtf(float f) { double call_sqrt(double f) { return sqrt(f); - // CHECK: cir.func @call_sqrt + // CHECK: cir.func dso_local @call_sqrt // CHECK: {{.+}} = cir.sqrt {{.+}} : !cir.double // LLVM: define dso_local double @call_sqrt(double %0) @@ -1150,7 +1150,7 @@ double call_sqrt(double f) { long double call_sqrtl(long double f) { return sqrtl(f); - // CHECK: cir.func @call_sqrtl + // CHECK: cir.func dso_local @call_sqrtl // CHECK: {{.+}} = cir.sqrt {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.sqrt {{.+}} : !cir.long_double @@ -1163,7 +1163,7 @@ long double call_sqrtl(long double f) { float my_tanf(float f) { return __builtin_tanf(f); - // CHECK: cir.func @my_tanf + // CHECK: cir.func dso_local @my_tanf // CHECK: {{.+}} = cir.tan {{.+}} : !cir.float // LLVM: define dso_local float @my_tanf(float %0) @@ -1173,7 +1173,7 @@ float my_tanf(float f) { double my_tan(double f) { return __builtin_tan(f); - // CHECK: cir.func @my_tan + // CHECK: cir.func dso_local @my_tan // CHECK: {{.+}} = cir.tan {{.+}} : !cir.double // LLVM: define dso_local double @my_tan(double %0) @@ -1183,7 +1183,7 @@ double my_tan(double f) { long double my_tanl(long double f) { return __builtin_tanl(f); - // CHECK: cir.func @my_tanl + // CHECK: cir.func dso_local @my_tanl // CHECK: {{.+}} = cir.tan {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.tan {{.+}} : !cir.long_double @@ -1198,7 +1198,7 @@ long double tanl(long double); float call_tanf(float f) { return tanf(f); - // CHECK: cir.func @call_tanf + // CHECK: cir.func dso_local @call_tanf // CHECK: {{.+}} = cir.tan {{.+}} : !cir.float // LLVM: define dso_local float @call_tanf(float %0) @@ -1208,7 +1208,7 @@ float call_tanf(float f) { double call_tan(double f) { return tan(f); - // CHECK: cir.func @call_tan + // CHECK: cir.func dso_local @call_tan // CHECK: {{.+}} = cir.tan {{.+}} : !cir.double // LLVM: define dso_local double @call_tan(double %0) @@ -1218,7 +1218,7 @@ double call_tan(double f) { long double call_tanl(long double f) { return tanl(f); - // CHECK: cir.func @call_tanl + // CHECK: cir.func dso_local @call_tanl // CHECK: {{.+}} = cir.tan {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.tan {{.+}} : !cir.long_double @@ -1231,7 +1231,7 @@ long double call_tanl(long double f) { float my_truncf(float f) { return __builtin_truncf(f); - // CHECK: cir.func @my_truncf + // CHECK: cir.func dso_local @my_truncf // CHECK: {{.+}} = cir.trunc {{.+}} : !cir.float // LLVM: define dso_local float @my_truncf(float %0) @@ -1241,7 +1241,7 @@ float my_truncf(float f) { double my_trunc(double f) { return __builtin_trunc(f); - // CHECK: cir.func @my_trunc + // CHECK: cir.func dso_local @my_trunc // CHECK: {{.+}} = cir.trunc {{.+}} : !cir.double // LLVM: define dso_local double @my_trunc(double %0) @@ -1251,7 +1251,7 @@ double my_trunc(double f) { long double my_truncl(long double f) { return __builtin_truncl(f); - // CHECK: cir.func @my_truncl + // CHECK: cir.func dso_local @my_truncl // CHECK: {{.+}} = cir.trunc {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.trunc {{.+}} : !cir.long_double @@ -1266,7 +1266,7 @@ long double truncl(long double); float call_truncf(float f) { return truncf(f); - // CHECK: cir.func @call_truncf + // CHECK: cir.func dso_local @call_truncf // CHECK: {{.+}} = cir.trunc {{.+}} : !cir.float // LLVM: define dso_local float @call_truncf(float %0) @@ -1276,7 +1276,7 @@ float call_truncf(float f) { double call_trunc(double f) { return trunc(f); - // CHECK: cir.func @call_trunc + // CHECK: cir.func dso_local @call_trunc // CHECK: {{.+}} = cir.trunc {{.+}} : !cir.double // LLVM: define dso_local double @call_trunc(double %0) @@ -1286,7 +1286,7 @@ double call_trunc(double f) { long double call_truncl(long double f) { return truncl(f); - // CHECK: cir.func @call_truncl + // CHECK: cir.func dso_local @call_truncl // CHECK: {{.+}} = cir.trunc {{.+}} : !cir.long_double // AARCH64: {{.+}} = cir.trunc {{.+}} : !cir.long_double @@ -1299,7 +1299,7 @@ long double call_truncl(long double f) { float my_copysignf(float x, float y) { return __builtin_copysignf(x, y); - // CHECK: cir.func @my_copysignf + // CHECK: cir.func dso_local @my_copysignf // CHECK: %{{.+}} = cir.copysign %{{.+}}, %{{.+}} : !cir.float // LLVM: define dso_local float @my_copysignf @@ -1309,7 +1309,7 @@ float my_copysignf(float x, float y) { double my_copysign(double x, double y) { return __builtin_copysign(x, y); - // CHECK: cir.func @my_copysign + // CHECK: cir.func dso_local @my_copysign // CHECK: %{{.+}} = cir.copysign %{{.+}}, %{{.+}} : !cir.double // LLVM: define dso_local double @my_copysign @@ -1319,7 +1319,7 @@ double my_copysign(double x, double y) { long double my_copysignl(long double x, long double y) { return __builtin_copysignl(x, y); - // CHECK: cir.func @my_copysignl + // CHECK: cir.func dso_local @my_copysignl // CHECK: %{{.+}} = cir.copysign %{{.+}}, %{{.+}} : !cir.long_double // AARCH64: %{{.+}} = cir.copysign %{{.+}}, %{{.+}} : !cir.long_double @@ -1334,7 +1334,7 @@ long double copysignl(long double, long double); float call_copysignf(float x, float y) { return copysignf(x, y); - // CHECK: cir.func @call_copysignf + // CHECK: cir.func dso_local @call_copysignf // CHECK: %{{.+}} = cir.copysign %{{.+}}, %{{.+}} : !cir.float // LLVM: define dso_local float @call_copysignf @@ -1344,7 +1344,7 @@ float call_copysignf(float x, float y) { double call_copysign(double x, double y) { return copysign(x, y); - // CHECK: cir.func @call_copysign + // CHECK: cir.func dso_local @call_copysign // CHECK: %{{.+}} = cir.copysign %{{.+}}, %{{.+}} : !cir.double // LLVM: define dso_local double @call_copysign @@ -1354,7 +1354,7 @@ double call_copysign(double x, double y) { long double call_copysignl(long double x, long double y) { return copysignl(x, y); - // CHECK: cir.func @call_copysignl + // CHECK: cir.func dso_local @call_copysignl // CHECK: %{{.+}} = cir.copysign %{{.+}}, %{{.+}} : !cir.long_double // AARCH64: %{{.+}} = cir.copysign %{{.+}}, %{{.+}} : !cir.long_double @@ -1367,7 +1367,7 @@ long double call_copysignl(long double x, long double y) { float my_fmaxf(float x, float y) { return __builtin_fmaxf(x, y); - // CHECK: cir.func @my_fmaxf + // CHECK: cir.func dso_local @my_fmaxf // CHECK: %{{.+}} = cir.fmaxnum %{{.+}}, %{{.+}} : !cir.float // LLVM: define dso_local float @my_fmaxf @@ -1377,7 +1377,7 @@ float my_fmaxf(float x, float y) { double my_fmax(double x, double y) { return __builtin_fmax(x, y); - // CHECK: cir.func @my_fmax + // CHECK: cir.func dso_local @my_fmax // CHECK: %{{.+}} = cir.fmaxnum %{{.+}}, %{{.+}} : !cir.double // LLVM: define dso_local double @my_fmax @@ -1387,7 +1387,7 @@ double my_fmax(double x, double y) { long double my_fmaxl(long double x, long double y) { return __builtin_fmaxl(x, y); - // CHECK: cir.func @my_fmaxl + // CHECK: cir.func dso_local @my_fmaxl // CHECK: %{{.+}} = cir.fmaxnum %{{.+}}, %{{.+}} : !cir.long_double // AARCH64: %{{.+}} = cir.fmaxnum %{{.+}}, %{{.+}} : !cir.long_double @@ -1402,7 +1402,7 @@ long double fmaxl(long double, long double); float call_fmaxf(float x, float y) { return fmaxf(x, y); - // CHECK: cir.func @call_fmaxf + // CHECK: cir.func dso_local @call_fmaxf // CHECK: %{{.+}} = cir.fmaxnum %{{.+}}, %{{.+}} : !cir.float // LLVM: define dso_local float @call_fmaxf @@ -1412,7 +1412,7 @@ float call_fmaxf(float x, float y) { double call_fmax(double x, double y) { return fmax(x, y); - // CHECK: cir.func @call_fmax + // CHECK: cir.func dso_local @call_fmax // CHECK: %{{.+}} = cir.fmaxnum %{{.+}}, %{{.+}} : !cir.double // LLVM: define dso_local double @call_fmax @@ -1422,7 +1422,7 @@ double call_fmax(double x, double y) { long double call_fmaxl(long double x, long double y) { return fmaxl(x, y); - // CHECK: cir.func @call_fmaxl + // CHECK: cir.func dso_local @call_fmaxl // CHECK: %{{.+}} = cir.fmaxnum %{{.+}}, %{{.+}} : !cir.long_double // AARCH64: %{{.+}} = cir.fmaxnum %{{.+}}, %{{.+}} : !cir.long_double @@ -1435,7 +1435,7 @@ long double call_fmaxl(long double x, long double y) { float my_fminf(float x, float y) { return __builtin_fminf(x, y); - // CHECK: cir.func @my_fminf + // CHECK: cir.func dso_local @my_fminf // CHECK: %{{.+}} = cir.fminnum %{{.+}}, %{{.+}} : !cir.float // LLVM: define dso_local float @my_fminf @@ -1445,7 +1445,7 @@ float my_fminf(float x, float y) { double my_fmin(double x, double y) { return __builtin_fmin(x, y); - // CHECK: cir.func @my_fmin + // CHECK: cir.func dso_local @my_fmin // CHECK: %{{.+}} = cir.fminnum %{{.+}}, %{{.+}} : !cir.double // LLVM: define dso_local double @my_fmin @@ -1455,7 +1455,7 @@ double my_fmin(double x, double y) { long double my_fminl(long double x, long double y) { return __builtin_fminl(x, y); - // CHECK: cir.func @my_fminl + // CHECK: cir.func dso_local @my_fminl // CHECK: %{{.+}} = cir.fminnum %{{.+}}, %{{.+}} : !cir.long_double // AARCH64: %{{.+}} = cir.fminnum %{{.+}}, %{{.+}} : !cir.long_double @@ -1470,7 +1470,7 @@ long double fminl(long double, long double); float call_fminf(float x, float y) { return fminf(x, y); - // CHECK: cir.func @call_fminf + // CHECK: cir.func dso_local @call_fminf // CHECK: %{{.+}} = cir.fminnum %{{.+}}, %{{.+}} : !cir.float // LLVM: define dso_local float @call_fminf @@ -1480,7 +1480,7 @@ float call_fminf(float x, float y) { double call_fmin(double x, double y) { return fmin(x, y); - // CHECK: cir.func @call_fmin + // CHECK: cir.func dso_local @call_fmin // CHECK: %{{.+}} = cir.fminnum %{{.+}}, %{{.+}} : !cir.double // LLVM: define dso_local double @call_fmin @@ -1490,7 +1490,7 @@ double call_fmin(double x, double y) { long double call_fminl(long double x, long double y) { return fminl(x, y); - // CHECK: cir.func @call_fminl + // CHECK: cir.func dso_local @call_fminl // CHECK: %{{.+}} = cir.fminnum %{{.+}}, %{{.+}} : !cir.long_double // AARCH64: %{{.+}} = cir.fminnum %{{.+}}, %{{.+}} : !cir.long_double @@ -1503,7 +1503,7 @@ long double call_fminl(long double x, long double y) { float my_fmodf(float x, float y) { return __builtin_fmodf(x, y); - // CHECK: cir.func @my_fmodf + // CHECK: cir.func dso_local @my_fmodf // CHECK: %{{.+}} = cir.fmod %{{.+}}, %{{.+}} : !cir.float // LLVM: define dso_local float @my_fmodf @@ -1513,7 +1513,7 @@ float my_fmodf(float x, float y) { double my_fmod(double x, double y) { return __builtin_fmod(x, y); - // CHECK: cir.func @my_fmod + // CHECK: cir.func dso_local @my_fmod // CHECK: %{{.+}} = cir.fmod %{{.+}}, %{{.+}} : !cir.double // LLVM: define dso_local double @my_fmod @@ -1523,7 +1523,7 @@ double my_fmod(double x, double y) { long double my_fmodl(long double x, long double y) { return __builtin_fmodl(x, y); - // CHECK: cir.func @my_fmodl + // CHECK: cir.func dso_local @my_fmodl // CHECK: %{{.+}} = cir.fmod %{{.+}}, %{{.+}} : !cir.long_double // AARCH64: %{{.+}} = cir.fmod %{{.+}}, %{{.+}} : !cir.long_double @@ -1538,7 +1538,7 @@ long double fmodl(long double, long double); float call_fmodf(float x, float y) { return fmodf(x, y); - // CHECK: cir.func @call_fmodf + // CHECK: cir.func dso_local @call_fmodf // CHECK: %{{.+}} = cir.fmod %{{.+}}, %{{.+}} : !cir.float // LLVM: define dso_local float @call_fmodf @@ -1548,7 +1548,7 @@ float call_fmodf(float x, float y) { double call_fmod(double x, double y) { return fmod(x, y); - // CHECK: cir.func @call_fmod + // CHECK: cir.func dso_local @call_fmod // CHECK: %{{.+}} = cir.fmod %{{.+}}, %{{.+}} : !cir.double // LLVM: define dso_local double @call_fmod @@ -1558,7 +1558,7 @@ double call_fmod(double x, double y) { long double call_fmodl(long double x, long double y) { return fmodl(x, y); - // CHECK: cir.func @call_fmodl + // CHECK: cir.func dso_local @call_fmodl // CHECK: %{{.+}} = cir.fmod %{{.+}}, %{{.+}} : !cir.long_double // AARCH64: %{{.+}} = cir.fmod %{{.+}}, %{{.+}} : !cir.long_double @@ -1571,7 +1571,7 @@ long double call_fmodl(long double x, long double y) { float my_powf(float x, float y) { return __builtin_powf(x, y); - // CHECK: cir.func @my_powf + // CHECK: cir.func dso_local @my_powf // CHECK: %{{.+}} = cir.pow %{{.+}}, %{{.+}} : !cir.float // LLVM: define dso_local float @my_powf @@ -1581,7 +1581,7 @@ float my_powf(float x, float y) { double my_pow(double x, double y) { return __builtin_pow(x, y); - // CHECK: cir.func @my_pow + // CHECK: cir.func dso_local @my_pow // CHECK: %{{.+}} = cir.pow %{{.+}}, %{{.+}} : !cir.double // LLVM: define dso_local double @my_pow @@ -1591,7 +1591,7 @@ double my_pow(double x, double y) { long double my_powl(long double x, long double y) { return __builtin_powl(x, y); - // CHECK: cir.func @my_powl + // CHECK: cir.func dso_local @my_powl // CHECK: %{{.+}} = cir.pow %{{.+}}, %{{.+}} : !cir.long_double // AARCH64: %{{.+}} = cir.pow %{{.+}}, %{{.+}} : !cir.long_double @@ -1606,7 +1606,7 @@ long double powl(long double, long double); float call_powf(float x, float y) { return powf(x, y); - // CHECK: cir.func @call_powf + // CHECK: cir.func dso_local @call_powf // CHECK: %{{.+}} = cir.pow %{{.+}}, %{{.+}} : !cir.float // LLVM: define dso_local float @call_powf @@ -1616,7 +1616,7 @@ float call_powf(float x, float y) { double call_pow(double x, double y) { return pow(x, y); - // CHECK: cir.func @call_pow + // CHECK: cir.func dso_local @call_pow // CHECK: %{{.+}} = cir.pow %{{.+}}, %{{.+}} : !cir.double // LLVM: define dso_local double @call_pow @@ -1626,7 +1626,7 @@ double call_pow(double x, double y) { long double call_powl(long double x, long double y) { return powl(x, y); - // CHECK: cir.func @call_powl + // CHECK: cir.func dso_local @call_powl // CHECK: %{{.+}} = cir.pow %{{.+}}, %{{.+}} : !cir.long_double // AARCH64: %{{.+}} = cir.pow %{{.+}}, %{{.+}} : !cir.long_double diff --git a/clang/test/CIR/CodeGen/builtin-ms-alloca.c b/clang/test/CIR/CodeGen/builtin-ms-alloca.c index 8e2bd906a957..20cada4c43ea 100644 --- a/clang/test/CIR/CodeGen/builtin-ms-alloca.c +++ b/clang/test/CIR/CodeGen/builtin-ms-alloca.c @@ -8,7 +8,7 @@ void my_win_alloca(size_t n) int *c1 = (int *)_alloca(n); } -// CIR: cir.func @my_win_alloca([[ALLOCA_SIZE:%.*]]: !u64i +// CIR: cir.func dso_local @my_win_alloca([[ALLOCA_SIZE:%.*]]: !u64i // CIR: cir.store [[ALLOCA_SIZE]], [[LOCAL_VAR_ALLOCA_SIZE:%.*]] : !u64i, !cir.ptr // CIR: [[TMP_ALLOCA_SIZE:%.*]] = cir.load{{.*}} [[LOCAL_VAR_ALLOCA_SIZE]] : !cir.ptr, !u64i // CIR: [[ALLOCA_RES:%.*]] = cir.alloca !u8i, !cir.ptr, [[TMP_ALLOCA_SIZE]] : !u64i, ["bi_alloca"] {alignment = 16 : i64} diff --git a/clang/test/CIR/CodeGen/builtin-prefetch.c b/clang/test/CIR/CodeGen/builtin-prefetch.c index c6aa093da734..343d9a808ad6 100644 --- a/clang/test/CIR/CodeGen/builtin-prefetch.c +++ b/clang/test/CIR/CodeGen/builtin-prefetch.c @@ -5,7 +5,7 @@ void foo(void *a) { __builtin_prefetch(a, 1, 1); } -// CIR: cir.func @foo(%arg0: !cir.ptr loc({{.*}})) +// CIR: cir.func dso_local @foo(%arg0: !cir.ptr loc({{.*}})) // CIR: [[PTR_ALLOC:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["a", init] {alignment = 8 : i64} // CIR: cir.store %arg0, [[PTR_ALLOC]] : !cir.ptr, !cir.ptr> // CIR: [[PTR:%.*]] = cir.load{{.*}} [[PTR_ALLOC]] : !cir.ptr>, !cir.ptr diff --git a/clang/test/CIR/CodeGen/builtins-memory.c b/clang/test/CIR/CodeGen/builtins-memory.c index 0a597379c9b8..7fb854eea1f9 100644 --- a/clang/test/CIR/CodeGen/builtins-memory.c +++ b/clang/test/CIR/CodeGen/builtins-memory.c @@ -1,12 +1,12 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir // RUN: FileCheck %s --check-prefix=CIR --input-file=%t.cir // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o - \ -// RUN: | opt -S -passes=instcombine,mem2reg,simplifycfg -o %t.ll +// RUN: | opt -S -passes=instcombine,mem2reg,simplifycfg -o %t.ll // RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s typedef __SIZE_TYPE__ size_t; void test_memcpy_chk(void *dest, const void *src, size_t n) { - // CIR-LABEL: cir.func @test_memcpy_chk + // CIR-LABEL: cir.func dso_local @test_memcpy_chk // CIR: %[[#DEST:]] = cir.alloca {{.*}} ["dest", init] // CIR: %[[#SRC:]] = cir.alloca {{.*}} ["src", init] // CIR: %[[#N:]] = cir.alloca {{.*}} ["n", init] @@ -59,7 +59,7 @@ void test_memcpy_chk(void *dest, const void *src, size_t n) { } void test_memmove_chk(void *dest, const void *src, size_t n) { - // CIR-LABEL: cir.func @test_memmove_chk + // CIR-LABEL: cir.func dso_local @test_memmove_chk // CIR: %[[#DEST:]] = cir.alloca {{.*}} ["dest", init] // CIR: %[[#SRC:]] = cir.alloca {{.*}} ["src", init] // CIR: %[[#N:]] = cir.alloca {{.*}} ["n", init] @@ -124,7 +124,7 @@ void test_memmove_chk(void *dest, const void *src, size_t n) { void test_memset_chk(void *dest, int ch, size_t n) { - // CIR-LABEL: cir.func @test_memset_chk + // CIR-LABEL: cir.func dso_local @test_memset_chk // CIR: %[[#DEST:]] = cir.alloca {{.*}} ["dest", init] // CIR: %[[#CH:]] = cir.alloca {{.*}} ["ch", init] // CIR: %[[#N:]] = cir.alloca {{.*}} ["n", init] @@ -176,9 +176,9 @@ void test_memset_chk(void *dest, int ch, size_t n) { __builtin___memset_chk(dest, ch, n, n); } -// FIXME: The test should test intrinsic argument alignment, however, -// currently we lack support for argument attributes. -// Thus, added `COM: LLVM:` lines so we can easily flip the test +// FIXME: The test should test intrinsic argument alignment, however, +// currently we lack support for argument attributes. +// Thus, added `COM: LLVM:` lines so we can easily flip the test // when the support of argument attributes is in. void test_memcpy_inline(void *dst, const void *src, size_t n) { @@ -202,7 +202,7 @@ void test_memcpy_inline(void *dst, const void *src, size_t n) { // COM: LLVM: call void @llvm.memcpy.inline.p0.p0.i64(ptr align 1 {{%.*}}, ptr align 1 {{%.*}}, i64 4, i1 false) __builtin_memcpy_inline(dst, src, 4); } - + void test_memcpy_inline_aligned_buffers(unsigned long long *dst, const unsigned long long *src) { // LLVM-LABEL: test_memcpy_inline_aligned_buffers diff --git a/clang/test/CIR/CodeGen/builtins-overflow.cpp b/clang/test/CIR/CodeGen/builtins-overflow.cpp index 70343c4d7339..a4513cf71add 100644 --- a/clang/test/CIR/CodeGen/builtins-overflow.cpp +++ b/clang/test/CIR/CodeGen/builtins-overflow.cpp @@ -5,7 +5,7 @@ bool test_add_overflow_uint_uint_uint(unsigned x, unsigned y, unsigned *res) { return __builtin_add_overflow(x, y, res); } -// CIR: cir.func @_Z32test_add_overflow_uint_uint_uintjjPj +// CIR: cir.func dso_local @_Z32test_add_overflow_uint_uint_uintjjPj // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -17,7 +17,7 @@ bool test_add_overflow_int_int_int(int x, int y, int *res) { return __builtin_add_overflow(x, y, res); } -// CIR: cir.func @_Z29test_add_overflow_int_int_intiiPi +// CIR: cir.func dso_local @_Z29test_add_overflow_int_int_intiiPi // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -29,7 +29,7 @@ bool test_add_overflow_xint31_xint31_xint31(_BitInt(31) x, _BitInt(31) y, _BitIn return __builtin_add_overflow(x, y, res); } -// CIR: cir.func @_Z38test_add_overflow_xint31_xint31_xint31DB31_S_PS_ +// CIR: cir.func dso_local @_Z38test_add_overflow_xint31_xint31_xint31DB31_S_PS_ // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>>, !cir.ptr> @@ -41,7 +41,7 @@ bool test_sub_overflow_uint_uint_uint(unsigned x, unsigned y, unsigned *res) { return __builtin_sub_overflow(x, y, res); } -// CIR: cir.func @_Z32test_sub_overflow_uint_uint_uintjjPj +// CIR: cir.func dso_local @_Z32test_sub_overflow_uint_uint_uintjjPj // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -53,7 +53,7 @@ bool test_sub_overflow_int_int_int(int x, int y, int *res) { return __builtin_sub_overflow(x, y, res); } -// CIR: cir.func @_Z29test_sub_overflow_int_int_intiiPi +// CIR: cir.func dso_local @_Z29test_sub_overflow_int_int_intiiPi // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -65,7 +65,7 @@ bool test_sub_overflow_xint31_xint31_xint31(_BitInt(31) x, _BitInt(31) y, _BitIn return __builtin_sub_overflow(x, y, res); } -// CIR: cir.func @_Z38test_sub_overflow_xint31_xint31_xint31DB31_S_PS_ +// CIR: cir.func dso_local @_Z38test_sub_overflow_xint31_xint31_xint31DB31_S_PS_ // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>>, !cir.ptr> @@ -77,7 +77,7 @@ bool test_mul_overflow_uint_uint_uint(unsigned x, unsigned y, unsigned *res) { return __builtin_mul_overflow(x, y, res); } -// CIR: cir.func @_Z32test_mul_overflow_uint_uint_uintjjPj +// CIR: cir.func dso_local @_Z32test_mul_overflow_uint_uint_uintjjPj // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -89,7 +89,7 @@ bool test_mul_overflow_int_int_int(int x, int y, int *res) { return __builtin_mul_overflow(x, y, res); } -// CIR: cir.func @_Z29test_mul_overflow_int_int_intiiPi +// CIR: cir.func dso_local @_Z29test_mul_overflow_int_int_intiiPi // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -101,7 +101,7 @@ bool test_mul_overflow_xint31_xint31_xint31(_BitInt(31) x, _BitInt(31) y, _BitIn return __builtin_mul_overflow(x, y, res); } -// CIR: cir.func @_Z38test_mul_overflow_xint31_xint31_xint31DB31_S_PS_ +// CIR: cir.func dso_local @_Z38test_mul_overflow_xint31_xint31_xint31DB31_S_PS_ // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.int // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>>, !cir.ptr> @@ -113,7 +113,7 @@ bool test_mul_overflow_ulong_ulong_long(unsigned long x, unsigned long y, unsign return __builtin_mul_overflow(x, y, res); } -// CIR: cir.func @_Z34test_mul_overflow_ulong_ulong_longmmPm +// CIR: cir.func dso_local @_Z34test_mul_overflow_ulong_ulong_longmmPm // CIR: %[[#LHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RHS:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -125,7 +125,7 @@ bool test_add_overflow_uint_int_int(unsigned x, int y, int *res) { return __builtin_add_overflow(x, y, res); } -// CIR: cir.func @_Z30test_add_overflow_uint_int_intjiPi +// CIR: cir.func dso_local @_Z30test_add_overflow_uint_int_intjiPi // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -139,7 +139,7 @@ bool test_add_overflow_volatile(int x, int y, volatile int *res) { return __builtin_add_overflow(x, y, res); } -// CIR: cir.func @_Z26test_add_overflow_volatileiiPVi +// CIR: cir.func dso_local @_Z26test_add_overflow_volatileiiPVi // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -151,7 +151,7 @@ bool test_uadd_overflow(unsigned x, unsigned y, unsigned *res) { return __builtin_uadd_overflow(x, y, res); } -// CIR: cir.func @_Z18test_uadd_overflowjjPj +// CIR: cir.func dso_local @_Z18test_uadd_overflowjjPj // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -163,7 +163,7 @@ bool test_uaddl_overflow(unsigned long x, unsigned long y, unsigned long *res) { return __builtin_uaddl_overflow(x, y, res); } -// CIR: cir.func @_Z19test_uaddl_overflowmmPm +// CIR: cir.func dso_local @_Z19test_uaddl_overflowmmPm // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -175,7 +175,7 @@ bool test_uaddll_overflow(unsigned long long x, unsigned long long y, unsigned l return __builtin_uaddll_overflow(x, y, res); } -// CIR: cir.func @_Z20test_uaddll_overflowyyPy +// CIR: cir.func dso_local @_Z20test_uaddll_overflowyyPy // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -187,7 +187,7 @@ bool test_usub_overflow(unsigned x, unsigned y, unsigned *res) { return __builtin_usub_overflow(x, y, res); } -// CIR: cir.func @_Z18test_usub_overflowjjPj +// CIR: cir.func dso_local @_Z18test_usub_overflowjjPj // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -199,7 +199,7 @@ bool test_usubl_overflow(unsigned long x, unsigned long y, unsigned long *res) { return __builtin_usubl_overflow(x, y, res); } -// CIR: cir.func @_Z19test_usubl_overflowmmPm +// CIR: cir.func dso_local @_Z19test_usubl_overflowmmPm // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -211,7 +211,7 @@ bool test_usubll_overflow(unsigned long long x, unsigned long long y, unsigned l return __builtin_usubll_overflow(x, y, res); } -// CIR: cir.func @_Z20test_usubll_overflowyyPy +// CIR: cir.func dso_local @_Z20test_usubll_overflowyyPy // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -223,7 +223,7 @@ bool test_umul_overflow(unsigned x, unsigned y, unsigned *res) { return __builtin_umul_overflow(x, y, res); } -// CIR: cir.func @_Z18test_umul_overflowjjPj +// CIR: cir.func dso_local @_Z18test_umul_overflowjjPj // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -235,7 +235,7 @@ bool test_umull_overflow(unsigned long x, unsigned long y, unsigned long *res) { return __builtin_umull_overflow(x, y, res); } -// CIR: cir.func @_Z19test_umull_overflowmmPm +// CIR: cir.func dso_local @_Z19test_umull_overflowmmPm // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -247,7 +247,7 @@ bool test_umulll_overflow(unsigned long long x, unsigned long long y, unsigned l return __builtin_umulll_overflow(x, y, res); } -// CIR: cir.func @_Z20test_umulll_overflowyyPy +// CIR: cir.func dso_local @_Z20test_umulll_overflowyyPy // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !u64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -259,7 +259,7 @@ bool test_sadd_overflow(int x, int y, int *res) { return __builtin_sadd_overflow(x, y, res); } -// CIR: cir.func @_Z18test_sadd_overflowiiPi +// CIR: cir.func dso_local @_Z18test_sadd_overflowiiPi // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -271,7 +271,7 @@ bool test_saddl_overflow(long x, long y, long *res) { return __builtin_saddl_overflow(x, y, res); } -// CIR: cir.func @_Z19test_saddl_overflowllPl +// CIR: cir.func dso_local @_Z19test_saddl_overflowllPl // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -283,7 +283,7 @@ bool test_saddll_overflow(long long x, long long y, long long *res) { return __builtin_saddll_overflow(x, y, res); } -// CIR: cir.func @_Z20test_saddll_overflowxxPx +// CIR: cir.func dso_local @_Z20test_saddll_overflowxxPx // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -295,7 +295,7 @@ bool test_ssub_overflow(int x, int y, int *res) { return __builtin_ssub_overflow(x, y, res); } -// CIR: cir.func @_Z18test_ssub_overflowiiPi +// CIR: cir.func dso_local @_Z18test_ssub_overflowiiPi // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -307,7 +307,7 @@ bool test_ssubl_overflow(long x, long y, long *res) { return __builtin_ssubl_overflow(x, y, res); } -// CIR: cir.func @_Z19test_ssubl_overflowllPl +// CIR: cir.func dso_local @_Z19test_ssubl_overflowllPl // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -319,7 +319,7 @@ bool test_ssubll_overflow(long long x, long long y, long long *res) { return __builtin_ssubll_overflow(x, y, res); } -// CIR: cir.func @_Z20test_ssubll_overflowxxPx +// CIR: cir.func dso_local @_Z20test_ssubll_overflowxxPx // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -331,7 +331,7 @@ bool test_smul_overflow(int x, int y, int *res) { return __builtin_smul_overflow(x, y, res); } -// CIR: cir.func @_Z18test_smul_overflowiiPi +// CIR: cir.func dso_local @_Z18test_smul_overflowiiPi // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -343,7 +343,7 @@ bool test_smull_overflow(long x, long y, long *res) { return __builtin_smull_overflow(x, y, res); } -// CIR: cir.func @_Z19test_smull_overflowllPl +// CIR: cir.func dso_local @_Z19test_smull_overflowllPl // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr @@ -355,7 +355,7 @@ bool test_smulll_overflow(long long x, long long y, long long *res) { return __builtin_smulll_overflow(x, y, res); } -// CIR: cir.func @_Z20test_smulll_overflowxxPx +// CIR: cir.func dso_local @_Z20test_smulll_overflowxxPx // CIR: %[[#X:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#Y:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s64i // CIR-NEXT: %[[#RES_PTR:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr diff --git a/clang/test/CIR/CodeGen/c89-implicit-int.c b/clang/test/CIR/CodeGen/c89-implicit-int.c index 8fe7b285c338..4e2392c44a80 100644 --- a/clang/test/CIR/CodeGen/c89-implicit-int.c +++ b/clang/test/CIR/CodeGen/c89-implicit-int.c @@ -5,6 +5,6 @@ test = 0; // CHECK: cir.global external @test = #cir.int<0> : !s32i func (void) { -// CHECK: cir.func @func() -> !s32i +// CHECK: cir.func dso_local @func() -> !s32i return 0; } diff --git a/clang/test/CIR/CodeGen/call-extra-attrs.cpp b/clang/test/CIR/CodeGen/call-extra-attrs.cpp index 674343f44a6f..3ec0c06fd741 100644 --- a/clang/test/CIR/CodeGen/call-extra-attrs.cpp +++ b/clang/test/CIR/CodeGen/call-extra-attrs.cpp @@ -21,10 +21,10 @@ int s2(int a, int b) { // CIR: #fn_attr = #cir, nothrow = #cir.nothrow, optnone = #cir.optnone})> // CIR: #fn_attr1 = #cir -// CIR: cir.func @_Z2s0ii(%{{.*}}, %{{.*}}) -> {{.*}} extra(#fn_attr) -// CIR: cir.func @_Z2s1ii(%{{.*}}, %{{.*}}) -> {{.*}} extra(#fn_attr) +// CIR: cir.func dso_local @_Z2s0ii(%{{.*}}, %{{.*}}) -> {{.*}} extra(#fn_attr) +// CIR: cir.func dso_local @_Z2s1ii(%{{.*}}, %{{.*}}) -> {{.*}} extra(#fn_attr) // CIR: cir.call @_Z2s0ii(%{{.*}}, %{{.*}}) : ({{.*}}, {{.*}}) -> {{.*}} extra(#fn_attr1) -// CIR: cir.func @_Z2s2ii(%{{.*}}, %{{.*}}) -> {{.*}} extra(#fn_attr) +// CIR: cir.func dso_local @_Z2s2ii(%{{.*}}, %{{.*}}) -> {{.*}} extra(#fn_attr) // CHECK-NOT: cir.call @_Z2s1ii(%{{.*}}, %{{.*}}) : ({{.*}}, {{.*}}) -> {{.*}} extra(#fn_attr{{.*}}) // LLVM: define dso_local i32 @_Z2s0ii(i32 %0, i32 %1) #[[#ATTR1:]] diff --git a/clang/test/CIR/CodeGen/call-via-class-member-funcptr.cpp b/clang/test/CIR/CodeGen/call-via-class-member-funcptr.cpp index 3f9914e5b02c..d28ff510ac7b 100644 --- a/clang/test/CIR/CodeGen/call-via-class-member-funcptr.cpp +++ b/clang/test/CIR/CodeGen/call-via-class-member-funcptr.cpp @@ -22,7 +22,7 @@ void fn1() { f f1; } // CIR: cir.global external @h = #cir.int<0> // CIR: cir.func private @_ZN1a1bEi(!s32i) -> !cir.ptr -// CIR: cir.func @_ZN1f1bEv(%arg0: !cir.ptr loc{{.*}}) -> !cir.ptr +// CIR: cir.func dso_local @_ZN1f1bEv(%arg0: !cir.ptr loc{{.*}}) -> !cir.ptr // CIR: [[H_PTR:%.*]] = cir.get_global @h : !cir.ptr loc(#loc18) // CIR: [[H_VAL:%.*]] = cir.load{{.*}} [[H_PTR]] : !cir.ptr, !s32i // CIR: [[RET1_VAL:%.*]] = cir.call @_ZN1a1bEi([[H_VAL]]) : (!s32i) -> !cir.ptr @@ -31,7 +31,7 @@ void fn1() { f f1; } // %7 = cir.load %1 : !cir.ptr>, !cir.ptr // CIR: cir.return [[RET1_VAL2]] : !cir.ptr -// CIR: cir.func @_Z3fn1v() +// CIR: cir.func dso_local @_Z3fn1v() // CIR: [[CLS_F:%.*]] = cir.alloca !rec_f, !cir.ptr, ["f1"] {alignment = 1 : i64} // CIR: cir.return diff --git a/clang/test/CIR/CodeGen/call.c b/clang/test/CIR/CodeGen/call.c index 5f5e5e1124f6..12c471d56347 100644 --- a/clang/test/CIR/CodeGen/call.c +++ b/clang/test/CIR/CodeGen/call.c @@ -15,10 +15,10 @@ void d(void) { } // CHECK: module {{.*}} { -// CHECK: cir.func @a() +// CHECK: cir.func dso_local @a() // CHECK: cir.return // CHECK: } -// CHECK: cir.func @b(%arg0: !s32i {{.*}}, %arg1: !s32i {{.*}}) -> !s32i +// CHECK: cir.func dso_local @b(%arg0: !s32i {{.*}}, %arg1: !s32i {{.*}}) -> !s32i // CHECK: %0 = cir.alloca !s32i, !cir.ptr, ["a", init] // CHECK: %1 = cir.alloca !s32i, !cir.ptr, ["b", init] // CHECK: %2 = cir.alloca !s32i, !cir.ptr, ["__retval"] @@ -31,7 +31,7 @@ void d(void) { // CHECK: %6 = cir.load{{.*}} %2 : !cir.ptr, !s32i // CHECK: cir.return %6 // CHECK: } -// CHECK: cir.func @c(%arg0: !cir.double {{.*}}, %arg1: !cir.double {{.*}}) -> !cir.double +// CHECK: cir.func dso_local @c(%arg0: !cir.double {{.*}}, %arg1: !cir.double {{.*}}) -> !cir.double // CHECK: %0 = cir.alloca !cir.double, !cir.ptr, ["a", init] // CHECK: %1 = cir.alloca !cir.double, !cir.ptr, ["b", init] // CHECK: %2 = cir.alloca !cir.double, !cir.ptr, ["__retval"] @@ -44,7 +44,7 @@ void d(void) { // CHECK: %6 = cir.load{{.*}} %2 : !cir.ptr, !cir.double // CHECK: cir.return %6 : !cir.double // CHECK: } -// CHECK: cir.func @d() +// CHECK: cir.func dso_local @d() // CHECK: call @a() : () -> () // CHECK: %0 = cir.const #cir.int<0> : !s32i // CHECK: %1 = cir.const #cir.int<1> : !s32i @@ -53,10 +53,10 @@ void d(void) { // CHECK: } // // CXX: module {{.*}} { -// CXX-NEXT: cir.func @_Z1av() +// CXX-NEXT: cir.func dso_local @_Z1av() // CXX-NEXT: cir.return // CXX-NEXT: } -// CXX-NEXT: cir.func @_Z1bii(%arg0: !s32i {{.*}}, %arg1: !s32i {{.*}}) -> !s32i +// CXX-NEXT: cir.func dso_local @_Z1bii(%arg0: !s32i {{.*}}, %arg1: !s32i {{.*}}) -> !s32i // CXX-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["a", init] // CXX-NEXT: %1 = cir.alloca !s32i, !cir.ptr, ["b", init] // CXX-NEXT: %2 = cir.alloca !s32i, !cir.ptr, ["__retval"] @@ -69,7 +69,7 @@ void d(void) { // CXX-NEXT: %6 = cir.load{{.*}} %2 : !cir.ptr, !s32i // CXX-NEXT: cir.return %6 // CXX-NEXT: } -// CXX-NEXT: cir.func @_Z1cdd(%arg0: !cir.double {{.*}}, %arg1: !cir.double {{.*}}) -> !cir.double +// CXX-NEXT: cir.func dso_local @_Z1cdd(%arg0: !cir.double {{.*}}, %arg1: !cir.double {{.*}}) -> !cir.double // CXX-NEXT: %0 = cir.alloca !cir.double, !cir.ptr, ["a", init] // CXX-NEXT: %1 = cir.alloca !cir.double, !cir.ptr, ["b", init] // CXX-NEXT: %2 = cir.alloca !cir.double, !cir.ptr, ["__retval"] @@ -82,7 +82,7 @@ void d(void) { // CXX-NEXT: %6 = cir.load{{.*}} %2 : !cir.ptr, !cir.double // CXX-NEXT: cir.return %6 : !cir.double // CXX-NEXT: } -// CXX-NEXT: cir.func @_Z1dv() +// CXX-NEXT: cir.func dso_local @_Z1dv() // CXX-NEXT: call @_Z1av() : () -> () // CXX-NEXT: %0 = cir.const #cir.int<0> : !s32i // CXX-NEXT: %1 = cir.const #cir.int<1> : !s32i diff --git a/clang/test/CIR/CodeGen/call.cpp b/clang/test/CIR/CodeGen/call.cpp index 09c3bc80d9ac..06a6e6d6fe3f 100644 --- a/clang/test/CIR/CodeGen/call.cpp +++ b/clang/test/CIR/CodeGen/call.cpp @@ -6,7 +6,7 @@ int f() { return p() - 22; } -// CHECK: cir.func @_Z1fv() -> !s32i +// CHECK: cir.func dso_local @_Z1fv() -> !s32i // CHECK: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CHECK: %1 = cir.call @_Z1pv() : () -> !cir.ptr // CHECK: %2 = cir.load{{.*}} %1 : !cir.ptr, !s32i diff --git a/clang/test/CIR/CodeGen/cast.c b/clang/test/CIR/CodeGen/cast.c index ad76d7f46032..bea0eb98f0d4 100644 --- a/clang/test/CIR/CodeGen/cast.c +++ b/clang/test/CIR/CodeGen/cast.c @@ -8,7 +8,7 @@ int cstyle_cast_lvalue(A a) { return ((A)(a)).x; } -// CHECK: cir.func @cstyle_cast_lvalue(%arg0: !rec_A loc({{.*}})) +// CHECK: cir.func dso_local @cstyle_cast_lvalue(%arg0: !rec_A loc({{.*}})) // CHECK: [[ALLOC_A:%.*]] = cir.alloca !rec_A, !cir.ptr, ["a", init] {alignment = 4 : i64} // CHECK: [[ALLOC_RET:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CHECK: cir.store{{.*}} %arg0, [[ALLOC_A]] : !rec_A, !cir.ptr @@ -17,4 +17,3 @@ int cstyle_cast_lvalue(A a) { // CHECK: cir.store{{.*}} [[X]], [[ALLOC_RET]] : !s32i, !cir.ptr // CHECK: [[RET:%.*]] = cir.load{{.*}} [[ALLOC_RET]] : !cir.ptr, !s32i // CHECK: cir.return [[RET]] : !s32i - diff --git a/clang/test/CIR/CodeGen/cast.cpp b/clang/test/CIR/CodeGen/cast.cpp index 0c62d7ce5e14..4d7e23a22329 100644 --- a/clang/test/CIR/CodeGen/cast.cpp +++ b/clang/test/CIR/CodeGen/cast.cpp @@ -5,7 +5,7 @@ unsigned char cxxstaticcast_0(unsigned int x) { return static_cast(x); } -// CHECK: cir.func @_Z15cxxstaticcast_0j +// CHECK: cir.func dso_local @_Z15cxxstaticcast_0j // CHECK: %0 = cir.alloca !u32i, !cir.ptr, ["x", init] {alignment = 4 : i64} // CHECK: %1 = cir.alloca !u8i, !cir.ptr, ["__retval"] {alignment = 1 : i64} // CHECK: cir.store{{.*}} %arg0, %0 : !u32i, !cir.ptr @@ -18,7 +18,7 @@ unsigned char cxxstaticcast_0(unsigned int x) { int cStyleCasts_0(unsigned x1, int x2, float x3, short x4, double x5) { -// CHECK: cir.func @_{{.*}}cStyleCasts_0{{.*}} +// CHECK: cir.func dso_local @_{{.*}}cStyleCasts_0{{.*}} char a = (char)x1; // truncate // CHECK: %{{[0-9]+}} = cir.cast(integral, %{{[0-9]+}} : !u32i), !s8i @@ -91,7 +91,7 @@ bool cptr(void *d) { return x; } -// CHECK: cir.func @_Z4cptrPv(%arg0: !cir.ptr +// CHECK: cir.func dso_local @_Z4cptrPv(%arg0: !cir.ptr // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["d", init] {alignment = 8 : i64} // CHECK: %3 = cir.load{{.*}} %0 : !cir.ptr>, !cir.ptr @@ -102,7 +102,7 @@ void call_cptr(void *d) { } } -// CHECK: cir.func @_Z9call_cptrPv(%arg0: !cir.ptr +// CHECK: cir.func dso_local @_Z9call_cptrPv(%arg0: !cir.ptr // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["d", init] {alignment = 8 : i64} // CHECK: cir.scope { @@ -115,7 +115,7 @@ void lvalue_cast(int x) { *(int *)&x = 42; } -// CHECK: cir.func @_Z11lvalue_cast +// CHECK: cir.func dso_local @_Z11lvalue_cast // CHECK: %1 = cir.const #cir.int<42> : !s32i // CHECK: cir.store{{.*}} %1, %0 : !s32i, !cir.ptr @@ -126,7 +126,7 @@ void null_cast(long ptr) { ((A *)0)->x = 0; } -// CHECK: cir.func @_Z9null_castl +// CHECK: cir.func dso_local @_Z9null_castl // CHECK: %[[ADDR:[0-9]+]] = cir.const #cir.ptr : !cir.ptr // CHECK: cir.store{{.*}} %{{[0-9]+}}, %[[ADDR]] : !s32i, !cir.ptr // CHECK: %[[BASE:[0-9]+]] = cir.const #cir.ptr : !cir.ptr @@ -137,8 +137,7 @@ void int_cast(long ptr) { ((A *)ptr)->x = 0; } -// CHECK: cir.func @_Z8int_castl +// CHECK: cir.func dso_local @_Z8int_castl // CHECK: %[[BASE:[0-9]+]] = cir.cast(int_to_ptr, %{{[0-9]+}} : !u64i), !cir.ptr // CHECK: %[[FIELD:[0-9]+]] = cir.get_member %[[BASE]][0] {name = "x"} : !cir.ptr -> !cir.ptr // CHECK: cir.store{{.*}} %{{[0-9]+}}, %[[FIELD]] : !s32i, !cir.ptr - diff --git a/clang/test/CIR/CodeGen/comma.cpp b/clang/test/CIR/CodeGen/comma.cpp index c523d2136fdb..e10be4ac0228 100644 --- a/clang/test/CIR/CodeGen/comma.cpp +++ b/clang/test/CIR/CodeGen/comma.cpp @@ -7,7 +7,7 @@ int c0() { return b + 1, a; } -// CHECK: cir.func @_Z2c0v() -> !s32i +// CHECK: cir.func dso_local @_Z2c0v() -> !s32i // CHECK: %[[#RET:]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CHECK: %[[#A:]] = cir.alloca !s32i, !cir.ptr, ["a", init] // CHECK: %[[#B:]] = cir.alloca !s32i, !cir.ptr, ["b", init] @@ -23,7 +23,7 @@ void c1() { int &x = (foo1(), foo2()); } -// CHECK: cir.func @_Z2c1v() +// CHECK: cir.func dso_local @_Z2c1v() // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr> // CHECK: %1 = cir.call @_Z4foo1v() : () -> !cir.ptr // CHECK: %2 = cir.call @_Z4foo2v() : () -> !cir.ptr diff --git a/clang/test/CIR/CodeGen/compound-literal.c b/clang/test/CIR/CodeGen/compound-literal.c index a7a2d58e86ed..b77e259a1ee1 100644 --- a/clang/test/CIR/CodeGen/compound-literal.c +++ b/clang/test/CIR/CodeGen/compound-literal.c @@ -35,7 +35,7 @@ int foo() { .i; } -// CIR: cir.func no_proto @foo() -> !s32i +// CIR: cir.func no_proto dso_local @foo() -> !s32i // CIR: [[RET_MEM:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CIR: [[COMPLITERAL_MEM:%.*]] = cir.alloca !rec_anon2E0, !cir.ptr, [".compoundliteral"] {alignment = 4 : i64} // CIR: [[FIELD:%.*]] = cir.get_member [[COMPLITERAL_MEM]][0] {name = "i"} : !cir.ptr -> !cir.ptr @@ -51,7 +51,7 @@ struct G g(int x, int y, int z) { return (struct G) { x, y, z }; } -// CIR: cir.func @g +// CIR: cir.func dso_local @g // CIR: %[[RETVAL:.*]] = cir.alloca !rec_G, !cir.ptr, ["__retval"] {alignment = 2 : i64} // CIR: %[[X:.*]] = cir.get_member %[[RETVAL]][0] {name = "x"} // CIR: cir.store{{.*}} {{.*}}, %[[X]] : !s16i diff --git a/clang/test/CIR/CodeGen/cond.cpp b/clang/test/CIR/CodeGen/cond.cpp index dfff1f465fbd..48b5d71acab0 100644 --- a/clang/test/CIR/CodeGen/cond.cpp +++ b/clang/test/CIR/CodeGen/cond.cpp @@ -10,7 +10,7 @@ min(const unsigned long& __a, const unsigned long& __b) { return __less()(__b, __a) ? __b : __a; } -// CHECK: cir.func @_Z3minRKmS0_(%arg0: !cir.ptr +// CHECK: cir.func dso_local @_Z3minRKmS0_(%arg0: !cir.ptr // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["__a", init, const] {alignment = 8 : i64} // CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["__b", init, const] {alignment = 8 : i64} // CHECK: %2 = cir.alloca !cir.ptr, !cir.ptr>, ["__retval"] {alignment = 8 : i64} diff --git a/clang/test/CIR/CodeGen/const-array.c b/clang/test/CIR/CodeGen/const-array.c index dd9a68ea2d37..73eefa776f59 100644 --- a/clang/test/CIR/CodeGen/const-array.c +++ b/clang/test/CIR/CodeGen/const-array.c @@ -4,8 +4,8 @@ void bar() { const int arr[1] = {1}; } -// CHECK: cir.global "private" constant internal dsolocal @bar.arr = #cir.const_array<[#cir.int<1> : !s32i]> : !cir.array {alignment = 4 : i64} -// CHECK: cir.func no_proto @bar() +// CHECK: cir.global "private" constant internal dso_local @bar.arr = #cir.const_array<[#cir.int<1> : !s32i]> : !cir.array {alignment = 4 : i64} +// CHECK: cir.func no_proto dso_local @bar() // CHECK: {{.*}} = cir.get_global @bar.arr : !cir.ptr> void foo() { @@ -15,4 +15,4 @@ void foo() { // CHECK-LABEL: @foo() // CHECK: %[[ADDR:.*]] = cir.alloca !cir.array, !cir.ptr>, ["a"] // CHECK: %[[SRC:.*]] = cir.get_global @__const.foo.a : !cir.ptr> -// CHECK: cir.copy %[[SRC]] to %[[ADDR]] : !cir.ptr> \ No newline at end of file +// CHECK: cir.copy %[[SRC]] to %[[ADDR]] : !cir.ptr> diff --git a/clang/test/CIR/CodeGen/copy-constructor.cpp b/clang/test/CIR/CodeGen/copy-constructor.cpp index 91defbf3efee..73eb720189c6 100644 --- a/clang/test/CIR/CodeGen/copy-constructor.cpp +++ b/clang/test/CIR/CodeGen/copy-constructor.cpp @@ -8,7 +8,7 @@ struct HasScalarArrayMember { HasScalarArrayMember(const HasScalarArrayMember &); }; -// CIR-LABEL: cir.func @_ZN20HasScalarArrayMemberC2ERKS_( +// CIR-LABEL: cir.func dso_local @_ZN20HasScalarArrayMemberC2ERKS_( // CIR-NEXT: %[[#THIS:]] = cir.alloca !cir.ptr // CIR-NEXT: %[[#OTHER:]] = cir.alloca !cir.ptr // CIR-NEXT: cir.store %arg0, %[[#THIS]] @@ -80,7 +80,7 @@ struct ManyMembers { // CIR-NEXT: cir.return // CIR-NEXT: } -// CIR-LABEL: cir.func @_Z6doCopyR11ManyMembers( +// CIR-LABEL: cir.func dso_local @_Z6doCopyR11ManyMembers( // CIR: cir.call @_ZN11ManyMembersC1ERKS_( ManyMembers doCopy(ManyMembers &src) { return src; diff --git a/clang/test/CIR/CodeGen/coro-task.cpp b/clang/test/CIR/CodeGen/coro-task.cpp index 81ede133c6c8..07766b743a75 100644 --- a/clang/test/CIR/CodeGen/coro-task.cpp +++ b/clang/test/CIR/CodeGen/coro-task.cpp @@ -148,7 +148,7 @@ VoidTask silly_task() { co_await std::suspend_always(); } -// CHECK: cir.func coroutine @_Z10silly_taskv() -> ![[VoidTask]] extra{{.*}}{ +// CHECK: cir.func coroutine dso_local @_Z10silly_taskv() -> ![[VoidTask]] extra{{.*}}{ // Allocate promise. @@ -274,7 +274,7 @@ folly::coro::Task byRef(const std::string& s) { } // FIXME: this could be less redundant than two allocas + reloads -// CHECK: cir.func coroutine @_Z5byRefRKSt6string(%arg0: !cir.ptr {{.*}} ![[IntTask]] extra{{.*}}{ +// CHECK: cir.func coroutine dso_local @_Z5byRefRKSt6string(%arg0: !cir.ptr {{.*}} ![[IntTask]] extra{{.*}}{ // CHECK: %[[#AllocaParam:]] = cir.alloca !cir.ptr, {{.*}} ["s", init, const] // CHECK: %[[#AllocaFnUse:]] = cir.alloca !cir.ptr, {{.*}} ["s", init, const] @@ -291,7 +291,7 @@ folly::coro::Task silly_coro() { // Make sure we properly handle OnFallthrough coro body sub stmt and // check there are not multiple co_returns emitted. -// CHECK: cir.func coroutine @_Z10silly_corov() {{.*}} ![[VoidTask]] extra{{.*}}{ +// CHECK: cir.func coroutine dso_local @_Z10silly_corov() {{.*}} ![[VoidTask]] extra{{.*}}{ // CHECK: cir.await(init, ready : { // CHECK: cir.call @_ZN5folly4coro4TaskIvE12promise_type11return_voidEv // CHECK-NOT: cir.call @_ZN5folly4coro4TaskIvE12promise_type11return_voidEv @@ -303,7 +303,7 @@ folly::coro::Task go1() { co_return co_await task; } -// CHECK: cir.func coroutine @_Z3go1v() {{.*}} ![[IntTask]] extra{{.*}}{ +// CHECK: cir.func coroutine dso_local @_Z3go1v() {{.*}} ![[IntTask]] extra{{.*}}{ // CHECK: %[[#IntTaskAddr:]] = cir.alloca ![[IntTask]], !cir.ptr, ["task", init] // CHECK: cir.await(init, ready : { @@ -338,8 +338,8 @@ folly::coro::Task go1_lambda() { co_return co_await task; } -// CHECK: cir.func coroutine lambda internal private @_ZZ10go1_lambdavENK3$_0clEv{{.*}} ![[IntTask]] extra{{.*}}{ -// CHECK: cir.func coroutine @_Z10go1_lambdav() {{.*}} ![[IntTask]] extra{{.*}}{ +// CHECK: cir.func coroutine lambda internal private dso_local @_ZZ10go1_lambdavENK3$_0clEv{{.*}} ![[IntTask]] extra{{.*}}{ +// CHECK: cir.func coroutine dso_local @_Z10go1_lambdav() {{.*}} ![[IntTask]] extra{{.*}}{ folly::coro::Task go4() { auto* fn = +[](int const& i) -> folly::coro::Task { co_return i; }; @@ -347,7 +347,7 @@ folly::coro::Task go4() { co_return co_await std::move(task); } -// CHECK: cir.func coroutine @_Z3go4v() {{.*}} ![[IntTask]] extra{{.*}}{ +// CHECK: cir.func coroutine dso_local @_Z3go4v() {{.*}} ![[IntTask]] extra{{.*}}{ // CHECK: cir.await(init, ready : { // CHECK: }, suspend : { @@ -387,7 +387,7 @@ folly::coro::Task yield1() { co_yield t; } -// CHECK: cir.func coroutine @_Z6yield1v() -> !rec_folly3A3Acoro3A3ATask3Cvoid3E +// CHECK: cir.func coroutine dso_local @_Z6yield1v() -> !rec_folly3A3Acoro3A3ATask3Cvoid3E // CHECK: cir.await(init, ready : { // CHECK: }, suspend : { diff --git a/clang/test/CIR/CodeGen/ctor-alias.cpp b/clang/test/CIR/CodeGen/ctor-alias.cpp index 7f584c061c4a..4afbdc12b3c1 100644 --- a/clang/test/CIR/CodeGen/ctor-alias.cpp +++ b/clang/test/CIR/CodeGen/ctor-alias.cpp @@ -18,7 +18,7 @@ void t() { // CHECK-NOT: cir.fun @_ZN11DummyStringC1EPKc -// CHECK: cir.func @_Z1tv +// CHECK: cir.func dso_local @_Z1tv // CHECK-NEXT: %0 = cir.alloca !rec_DummyString, !cir.ptr, ["s4", init] {alignment = 1 : i64} // CHECK-NEXT: %1 = cir.get_global @".str" : !cir.ptr> // CHECK-NEXT: %2 = cir.cast(array_to_ptrdecay, %1 : !cir.ptr>), !cir.ptr @@ -31,10 +31,10 @@ struct B { B::B() { } -// CHECK: cir.func @_ZN1BC2Ev(%arg0: !cir.ptr +// CHECK: cir.func dso_local @_ZN1BC2Ev(%arg0: !cir.ptr // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK: %1 = cir.load %0 : !cir.ptr>, !cir.ptr // CHECK: cir.return // CHECK: } -// CHECK: cir.func private @_ZN1BC1Ev(!cir.ptr) alias(@_ZN1BC2Ev) +// CHECK: cir.func private dso_local @_ZN1BC1Ev(!cir.ptr) alias(@_ZN1BC2Ev) diff --git a/clang/test/CIR/CodeGen/ctor-member-lvalue-to-rvalue.cpp b/clang/test/CIR/CodeGen/ctor-member-lvalue-to-rvalue.cpp index efc5ed324da2..481fa11cc0ca 100644 --- a/clang/test/CIR/CodeGen/ctor-member-lvalue-to-rvalue.cpp +++ b/clang/test/CIR/CodeGen/ctor-member-lvalue-to-rvalue.cpp @@ -26,7 +26,7 @@ void foo() { String s; String s1{s}; } -// CHECK: cir.func @_Z3foov() {{.*}} { +// CHECK: cir.func dso_local @_Z3foov() {{.*}} { // CHECK: %0 = cir.alloca !rec_String, !cir.ptr, ["s", init] {alignment = 8 : i64} // CHECK: %1 = cir.alloca !rec_String, !cir.ptr, ["s1", init] {alignment = 8 : i64} // CHECK: cir.call @_ZN6StringC2Ev(%0) : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/ctor.cpp b/clang/test/CIR/CodeGen/ctor.cpp index 8272c286d37f..08c7903ca2c0 100644 --- a/clang/test/CIR/CodeGen/ctor.cpp +++ b/clang/test/CIR/CodeGen/ctor.cpp @@ -26,7 +26,7 @@ void baz() { // CHECK-NEXT: cir.call @_ZN5StrukC2Ev(%1) : (!cir.ptr) -> () // CHECK-NEXT: cir.return -// CHECK: cir.func @_Z3bazv() +// CHECK: cir.func dso_local @_Z3bazv() // CHECK-NEXT: %0 = cir.alloca !rec_Struk, !cir.ptr, ["s", init] {alignment = 4 : i64} // CHECK-NEXT: cir.call @_ZN5StrukC1Ev(%0) : (!cir.ptr) -> () // CHECK-NEXT: cir.return diff --git a/clang/test/CIR/CodeGen/cxx-default-arg.cpp b/clang/test/CIR/CodeGen/cxx-default-arg.cpp index c5665337608b..24d6d9c640f5 100644 --- a/clang/test/CIR/CodeGen/cxx-default-arg.cpp +++ b/clang/test/CIR/CodeGen/cxx-default-arg.cpp @@ -9,4 +9,4 @@ struct MyIntPointer { void foo() { MyIntPointer p; -} \ No newline at end of file +} diff --git a/clang/test/CIR/CodeGen/default-methods.cpp b/clang/test/CIR/CodeGen/default-methods.cpp index 73f7afb1b814..20cdfa6440b8 100644 --- a/clang/test/CIR/CodeGen/default-methods.cpp +++ b/clang/test/CIR/CodeGen/default-methods.cpp @@ -13,7 +13,7 @@ struct S { // CIR-LABEL: cir.func linkonce_odr @_ZN1S1TaSERKS0_({{.*}} { // CIR-LABEL: cir.func linkonce_odr @_ZN1SaSERKS_( // CIR: cir.call @_ZN1S1TaSERKS0_( -// CIR-LABEL: cir.func @_Z1fR1SS0_( +// CIR-LABEL: cir.func dso_local @_Z1fR1SS0_( // CIR: cir.call @_ZN1SaSERKS_( // LLVM-LABEL: define linkonce_odr ptr @_ZN1S1TaSERKS0_( diff --git a/clang/test/CIR/CodeGen/defined-pure-virtual-func.cpp b/clang/test/CIR/CodeGen/defined-pure-virtual-func.cpp index cdabba148e0a..966cc1ce0a33 100644 --- a/clang/test/CIR/CodeGen/defined-pure-virtual-func.cpp +++ b/clang/test/CIR/CodeGen/defined-pure-virtual-func.cpp @@ -26,7 +26,7 @@ void C::pure() {} // CHECK-SAME: #cir.global_view<@__cxa_pure_virtual> : !cir.ptr]> // The base object destructor should be emitted as normal. -// CHECK-LABEL: cir.func @_ZN1CD2Ev(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { +// CHECK-LABEL: cir.func dso_local @_ZN1CD2Ev(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { // CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr @@ -34,7 +34,7 @@ void C::pure() {} // CHECK-NEXT: } // The complete object destructor should trap. -// CHECK-LABEL: cir.func @_ZN1CD1Ev(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { +// CHECK-LABEL: cir.func dso_local @_ZN1CD1Ev(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { // CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr @@ -42,7 +42,7 @@ void C::pure() {} // CHECK-NEXT: } // The deleting destructor should trap. -// CHECK-LABEL: cir.func @_ZN1CD0Ev(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { +// CHECK-LABEL: cir.func dso_local @_ZN1CD0Ev(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { // CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr @@ -50,7 +50,7 @@ void C::pure() {} // CHECK-NEXT: } // C::pure should be emitted as normal. -// CHECK-LABEL: cir.func @_ZN1C4pureEv(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { +// CHECK-LABEL: cir.func dso_local @_ZN1C4pureEv(%arg0: !cir.ptr loc({{[^)]+}})) {{.*}} { // CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr diff --git a/clang/test/CIR/CodeGen/delegating-ctor.cpp b/clang/test/CIR/CodeGen/delegating-ctor.cpp index 446f6d07a86f..70fdabaaae75 100644 --- a/clang/test/CIR/CodeGen/delegating-ctor.cpp +++ b/clang/test/CIR/CodeGen/delegating-ctor.cpp @@ -10,7 +10,7 @@ struct Delegating { // arguments. Delegating::Delegating() : Delegating(0) {} -// CHECK-LABEL: cir.func @_ZN10DelegatingC2Ev(%arg0: !cir.ptr {{.*}}) {{.*}} { +// CHECK-LABEL: cir.func dso_local @_ZN10DelegatingC2Ev(%arg0: !cir.ptr {{.*}}) {{.*}} { // CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK-NEXT: cir.store{{.*}} %arg0, %0 : !cir.ptr, !cir.ptr> // CHECK-NEXT: %1 = cir.load %0 : !cir.ptr>, !cir.ptr @@ -30,7 +30,7 @@ struct DelegatingWithZeroing { // call to it in a lowering pass. DelegatingWithZeroing::DelegatingWithZeroing(int) : DelegatingWithZeroing() {} -// CHECK-LABEL: cir.func @_ZN21DelegatingWithZeroingC2Ei(%arg0: !cir.ptr {{.*}}, %arg1: !s32i {{.*}}) {{.*}} { +// CHECK-LABEL: cir.func dso_local @_ZN21DelegatingWithZeroingC2Ei(%arg0: !cir.ptr {{.*}}, %arg1: !s32i {{.*}}) {{.*}} { // CHECK-NEXT: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK-NEXT: %1 = cir.alloca !s32i, !cir.ptr, ["", init] {alignment = 4 : i64} // CHECK-NEXT: cir.store{{.*}} %arg0, %0 : !cir.ptr, !cir.ptr> diff --git a/clang/test/CIR/CodeGen/delete.cpp b/clang/test/CIR/CodeGen/delete.cpp index d45baa241adc..90ef925854fb 100644 --- a/clang/test/CIR/CodeGen/delete.cpp +++ b/clang/test/CIR/CodeGen/delete.cpp @@ -8,7 +8,7 @@ namespace test1 { void a(A *x) { delete x; } - // CHECK: cir.func @_ZN5test11aEPNS_1AE + // CHECK: cir.func dso_local @_ZN5test11aEPNS_1AE // CHECK: %[[CONST:.*]] = cir.const #cir.int<4> : !u64i // CHECK: cir.call @_ZN5test11AdlEPvm({{.*}}, %[[CONST]]) diff --git a/clang/test/CIR/CodeGen/derived-to-base.cpp b/clang/test/CIR/CodeGen/derived-to-base.cpp index 0cb21b069239..790b39baac21 100644 --- a/clang/test/CIR/CodeGen/derived-to-base.cpp +++ b/clang/test/CIR/CodeGen/derived-to-base.cpp @@ -81,7 +81,7 @@ void C3::Layer::Initialize() { // CHECK-DAG: !rec_A2Ebase = !cir.record nonnull) [0] -> !cir.ptr @@ -94,7 +94,7 @@ enumy C3::Initialize() { return C2::Initialize(); } -// CHECK: cir.func @_ZN2C310InitializeEv(%arg0: !cir.ptr +// CHECK: cir.func dso_local @_ZN2C310InitializeEv(%arg0: !cir.ptr // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK: cir.store %arg0, %0 : !cir.ptr, !cir.ptr> @@ -108,7 +108,7 @@ void vcall(C1 &c1) { c1.SetStuff(e, b); } -// CHECK: cir.func @_Z5vcallR2C1(%arg0: !cir.ptr +// CHECK: cir.func dso_local @_Z5vcallR2C1(%arg0: !cir.ptr // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["c1", init, const] {alignment = 8 : i64} // CHECK: %1 = cir.alloca !rec_buffy, !cir.ptr, ["b"] {alignment = 8 : i64} // CHECK: %2 = cir.alloca !s32i, !cir.ptr, ["e"] {alignment = 4 : i64} @@ -165,7 +165,7 @@ struct C : public A { C(int& x) : ref(x) {} }; -// CHECK: cir.func @_Z8test_refv() +// CHECK: cir.func dso_local @_Z8test_refv() // CHECK: cir.get_member %2[1] {name = "ref"} int test_ref() { int x = 42; diff --git a/clang/test/CIR/CodeGen/dtors-scopes.cpp b/clang/test/CIR/CodeGen/dtors-scopes.cpp index 3af3338ffc72..229fa9f9274b 100644 --- a/clang/test/CIR/CodeGen/dtors-scopes.cpp +++ b/clang/test/CIR/CodeGen/dtors-scopes.cpp @@ -15,7 +15,7 @@ void dtor1() { printf("Done\n"); } -// CHECK: cir.func @_Z5dtor1v() +// CHECK: cir.func dso_local @_Z5dtor1v() // CHECK: cir.scope { // CHECK: %4 = cir.alloca !rec_C, !cir.ptr, ["c", init] {alignment = 1 : i64} // CHECK: cir.call @_ZN1CC2Ev(%4) : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/dtors.cpp b/clang/test/CIR/CodeGen/dtors.cpp index c89caf32a7a6..4a001680aea3 100644 --- a/clang/test/CIR/CodeGen/dtors.cpp +++ b/clang/test/CIR/CodeGen/dtors.cpp @@ -41,7 +41,7 @@ class B : public A // Class B // CHECK: ![[ClassB:rec_.*]] = !cir.record -// CHECK: cir.func @_Z4bluev() +// CHECK: cir.func dso_local @_Z4bluev() // CHECK: %0 = cir.alloca !rec_PSEvent, !cir.ptr, ["p", init] {alignment = 8 : i64} // CHECK: %1 = cir.const #cir.int<1> : !s32i // CHECK: %2 = cir.get_global @".str" : !cir.ptr> @@ -59,7 +59,7 @@ struct X { bool foo(const X &) { return false; } bool bar() { return foo(1) || foo(2); } -// CHECK: cir.func @_Z3barv() +// CHECK: cir.func dso_local @_Z3barv() // CHECK: %[[V0:.*]] = cir.alloca !cir.bool, !cir.ptr, ["__retval"] {alignment = 1 : i64} // CHECK: cir.scope { // CHECK: %[[V2:.*]] = cir.alloca !rec_X, !cir.ptr, ["ref.tmp0"] {alignment = 4 : i64} @@ -93,7 +93,7 @@ bool bar() { return foo(1) || foo(2); } bool bar2() { return foo(1) && foo(2); } -// CHECK: cir.func @_Z4bar2v() +// CHECK: cir.func dso_local @_Z4bar2v() // CHECK: cir.alloca !rec_X, !cir.ptr // CHECK: {{.*}} = cir.ternary({{.*}}, true { // CHECK: cir.alloca !rec_X, !cir.ptr @@ -110,7 +110,7 @@ bool bar2() { return foo(1) && foo(2); } // CHECK: cir.call @_ZN1AD2Ev( // void foo() -// CHECK: cir.func @_Z3foov() +// CHECK: cir.func dso_local @_Z3foov() // CHECK: cir.scope { // CHECK: cir.call @_ZN1BC2Ev(%0) : (!cir.ptr) -> () // CHECK: cir.call @_ZN1BD2Ev(%0) : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/dynamic-cast-relative-layout.cpp b/clang/test/CIR/CodeGen/dynamic-cast-relative-layout.cpp index 24879c45c366..cbe5b3a41c20 100644 --- a/clang/test/CIR/CodeGen/dynamic-cast-relative-layout.cpp +++ b/clang/test/CIR/CodeGen/dynamic-cast-relative-layout.cpp @@ -11,11 +11,11 @@ void *ptr_cast_to_complete(Base *ptr) { return dynamic_cast(ptr); } -// BEFORE: cir.func @_Z20ptr_cast_to_completeP4Base +// BEFORE: cir.func dso_local @_Z20ptr_cast_to_completeP4Base // BEFORE: %{{.+}} = cir.dyn_cast(ptr, %{{.+}} : !cir.ptr relative_layout) -> !cir.ptr // BEFORE: } -// AFTER: cir.func @_Z20ptr_cast_to_completeP4Base +// AFTER: cir.func dso_local @_Z20ptr_cast_to_completeP4Base // AFTER: %[[#SRC:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr // AFTER-NEXT: %[[#SRC_IS_NOT_NULL:]] = cir.cast(ptr_to_bool, %[[#SRC]] : !cir.ptr), !cir.bool // AFTER-NEXT: %{{.+}} = cir.ternary(%[[#SRC_IS_NOT_NULL]], true { diff --git a/clang/test/CIR/CodeGen/dynamic-cast.cpp b/clang/test/CIR/CodeGen/dynamic-cast.cpp index 4bacf2281893..715a129d31df 100644 --- a/clang/test/CIR/CodeGen/dynamic-cast.cpp +++ b/clang/test/CIR/CodeGen/dynamic-cast.cpp @@ -15,11 +15,11 @@ Derived *ptr_cast(Base *b) { return dynamic_cast(b); } -// BEFORE: cir.func @_Z8ptr_castP4Base +// BEFORE: cir.func dso_local @_Z8ptr_castP4Base // BEFORE: %{{.+}} = cir.dyn_cast(ptr, %{{.+}} : !cir.ptr, #dyn_cast_info__ZTI4Base__ZTI7Derived) -> !cir.ptr // BEFORE: } -// AFTER: cir.func @_Z8ptr_castP4Base +// AFTER: cir.func dso_local @_Z8ptr_castP4Base // AFTER: %[[#SRC:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr // AFTER-NEXT: %[[#SRC_IS_NOT_NULL:]] = cir.cast(ptr_to_bool, %[[#SRC]] : !cir.ptr), !cir.bool // AFTER-NEXT: %{{.+}} = cir.ternary(%[[#SRC_IS_NOT_NULL]], true { @@ -40,11 +40,11 @@ Derived &ref_cast(Base &b) { return dynamic_cast(b); } -// BEFORE: cir.func @_Z8ref_castR4Base +// BEFORE: cir.func dso_local @_Z8ref_castR4Base // BEFORE: %{{.+}} = cir.dyn_cast(ref, %{{.+}} : !cir.ptr, #dyn_cast_info__ZTI4Base__ZTI7Derived) -> !cir.ptr // BEFORE: } -// AFTER: cir.func @_Z8ref_castR4Base +// AFTER: cir.func dso_local @_Z8ref_castR4Base // AFTER: %[[#SRC_VOID_PTR:]] = cir.cast(bitcast, %{{.+}} : !cir.ptr), !cir.ptr // AFTER-NEXT: %[[#SRC_RTTI:]] = cir.const #cir.global_view<@_ZTI4Base> : !cir.ptr // AFTER-NEXT: %[[#DEST_RTTI:]] = cir.const #cir.global_view<@_ZTI7Derived> : !cir.ptr @@ -63,11 +63,11 @@ void *ptr_cast_to_complete(Base *ptr) { return dynamic_cast(ptr); } -// BEFORE: cir.func @_Z20ptr_cast_to_completeP4Base +// BEFORE: cir.func dso_local @_Z20ptr_cast_to_completeP4Base // BEFORE: %{{.+}} = cir.dyn_cast(ptr, %{{.+}} : !cir.ptr) -> !cir.ptr // BEFORE: } -// AFTER: cir.func @_Z20ptr_cast_to_completeP4Base +// AFTER: cir.func dso_local @_Z20ptr_cast_to_completeP4Base // AFTER: %[[#SRC:]] = cir.load{{.*}} %{{.+}} : !cir.ptr>, !cir.ptr // AFTER-NEXT: %[[#SRC_IS_NOT_NULL:]] = cir.cast(ptr_to_bool, %[[#SRC]] : !cir.ptr), !cir.bool // AFTER-NEXT: %{{.+}} = cir.ternary(%[[#SRC_IS_NOT_NULL]], true { diff --git a/clang/test/CIR/CodeGen/evaluate-expr.c b/clang/test/CIR/CodeGen/evaluate-expr.c index 56b54e357778..d896fbe7d84b 100644 --- a/clang/test/CIR/CodeGen/evaluate-expr.c +++ b/clang/test/CIR/CodeGen/evaluate-expr.c @@ -8,7 +8,7 @@ void foo() { if ((g == 1) || (g == 1)) return; } -// CHECK: cir.func no_proto @foo() +// CHECK: cir.func no_proto dso_local @foo() // CHECK: cir.scope { // CHECK: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i // CHECK: [[FALSE:%.*]] = cir.cast(int_to_bool, [[ZERO:%.*]] : !s32i), !cir.bool @@ -23,10 +23,9 @@ static const S s = {0}; void bar() { int a = s.x; } -// CHECK: cir.func no_proto @bar() +// CHECK: cir.func no_proto dso_local @bar() // CHECK: [[ALLOC:%.*]] = cir.alloca !s32i, !cir.ptr, ["a", init] {alignment = 4 : i64} // CHECK: {{%.*}} = cir.get_global @s : !cir.ptr // CHECK: [[CONST:%.*]] = cir.const #cir.int<0> : !s32i // CHECK: cir.store{{.*}} [[CONST]], [[ALLOC]] : !s32i, !cir.ptr // CHECK: cir.return - diff --git a/clang/test/CIR/CodeGen/expressions.cpp b/clang/test/CIR/CodeGen/expressions.cpp index 923d77d5d180..7324c1357f8a 100644 --- a/clang/test/CIR/CodeGen/expressions.cpp +++ b/clang/test/CIR/CodeGen/expressions.cpp @@ -2,7 +2,7 @@ // RUN: FileCheck --input-file=%t.cir %s void test(int a) { -// CHECK: cir.func @{{.+}}test +// CHECK: cir.func dso_local @{{.+}}test // Should generate LValue parenthesis expression. (a) = 1; diff --git a/clang/test/CIR/CodeGen/fullexpr.cpp b/clang/test/CIR/CodeGen/fullexpr.cpp index a94603fdc8c0..8346369c5add 100644 --- a/clang/test/CIR/CodeGen/fullexpr.cpp +++ b/clang/test/CIR/CodeGen/fullexpr.cpp @@ -13,7 +13,7 @@ int go1() { return x; } -// CHECK: cir.func @_Z3go1v() -> !s32i +// CHECK: cir.func dso_local @_Z3go1v() -> !s32i // CHECK: %[[#XAddr:]] = cir.alloca !s32i, !cir.ptr, ["x", init] {alignment = 4 : i64} // CHECK: %[[#RVal:]] = cir.scope { // CHECK-NEXT: %[[#TmpAddr:]] = cir.alloca !s32i, !cir.ptr, ["ref.tmp0", init] {alignment = 4 : i64} @@ -24,7 +24,7 @@ int go1() { // CHECK-NEXT: } // CHECK-NEXT: cir.store{{.*}} %[[#RVal]], %[[#XAddr]] : !s32i, !cir.ptr -// FLAT: cir.func @_Z3go1v() -> !s32i +// FLAT: cir.func dso_local @_Z3go1v() -> !s32i // FLAT: %[[#TmpAddr:]] = cir.alloca !s32i, !cir.ptr, ["ref.tmp0", init] {alignment = 4 : i64} // FLAT: %[[#XAddr:]] = cir.alloca !s32i, !cir.ptr, ["x", init] {alignment = 4 : i64} // FLAT: cir.br ^[[before_body:.*]]{{ loc.*}} @@ -42,7 +42,7 @@ int go1() { // LLVM: [[before_body]]: // LLVM-NEXT: store i32 1, ptr %[[#TmpAddr]], align 4 // LLVM-NEXT: %[[#RValTmp:]] = call i32 @_Z2goRKi(ptr %[[#TmpAddr]]) -// LLVM-NEXT: br label %[[continue_block:[0-9]+]] +// LLVM-NEXT: br label %[[continue_block:[0-9]+]] // LLVM: [[continue_block]]: // LLVM-NEXT: [[PHI:%.*]] = phi i32 [ %[[#RValTmp]], %[[before_body]] ] diff --git a/clang/test/CIR/CodeGen/fun-ptr.c b/clang/test/CIR/CodeGen/fun-ptr.c index cc842226982d..d7f28525e846 100644 --- a/clang/test/CIR/CodeGen/fun-ptr.c +++ b/clang/test/CIR/CodeGen/fun-ptr.c @@ -24,7 +24,7 @@ int extract_a(Data* d) { return d->a; } -// CIR: cir.func {{@.*foo.*}}(%arg0: !cir.ptr +// CIR: cir.func dso_local {{@.*foo.*}}(%arg0: !cir.ptr // CIR: [[TMP0:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["d", init] // CIR: [[TMP1:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CIR: [[TMP2:%.*]] = cir.alloca !cir.ptr) -> !s32i>>, !cir.ptr) -> !s32i>>>, ["f", init] @@ -56,7 +56,7 @@ int foo(Data* d) { } // CIR: cir.func private {{@.*test.*}}() -> !cir.ptr> -// CIR: cir.func {{@.*bar.*}}() +// CIR: cir.func dso_local {{@.*bar.*}}() // CIR: [[RET:%.*]] = cir.call {{@.*test.*}}() : () -> !cir.ptr> // CIR: cir.call [[RET]]() : (!cir.ptr>) -> () // CIR: cir.return diff --git a/clang/test/CIR/CodeGen/func_dsolocal_pie.c b/clang/test/CIR/CodeGen/func_dsolocal_pie.c index fda5e5875fe5..f3e524ce2fdb 100644 --- a/clang/test/CIR/CodeGen/func_dsolocal_pie.c +++ b/clang/test/CIR/CodeGen/func_dsolocal_pie.c @@ -12,12 +12,12 @@ int main() { return 0; } -// CIR: cir.func @foo(%arg0: !s32i +// CIR: cir.func dso_local @foo(%arg0: !s32i // CIR-NEXT: [[TMP0:%.*]] = cir.alloca !s32i, !cir.ptr, ["i", init] {alignment = 4 : i64} // CIR-NEXT: cir.store %arg0, [[TMP0]] : !s32i, !cir.ptr // CIR-NEXT: cir.return -// CIR: cir.func no_proto @main() -> !s32i +// CIR: cir.func no_proto dso_local @main() -> !s32i // CIR: [[TMP1:%.*]] = cir.const #cir.int<2> : !s32i // CIR: cir.call @foo([[TMP1]]) : (!s32i) -> () diff --git a/clang/test/CIR/CodeGen/function-attrs.cpp b/clang/test/CIR/CodeGen/function-attrs.cpp index 8ded0a7d9730..e969113f4e96 100644 --- a/clang/test/CIR/CodeGen/function-attrs.cpp +++ b/clang/test/CIR/CodeGen/function-attrs.cpp @@ -29,9 +29,9 @@ int s3(int a, int b) { // CIR: #fn_attr2 = #cir, nothrow = #cir.nothrow})> // CIR: cir.func linkonce_odr @_Z2s0ii(%arg0:{{.*}}, %arg1:{{.*}} -> {{.*}} extra(#fn_attr) -// CIR: cir.func @_Z2s1ii(%arg0:{{.*}}, %arg1:{{.*}} -> {{.*}} extra(#fn_attr1) -// CIR: cir.func @_Z2s2ii(%arg0:{{.*}}, %arg1:{{.*}} -> {{.*}} extra(#fn_attr2) -// CIR: cir.func @_Z2s3ii(%arg0:{{.*}}, %arg1:{{.*}} -> {{.*}} { +// CIR: cir.func dso_local @_Z2s1ii(%arg0:{{.*}}, %arg1:{{.*}} -> {{.*}} extra(#fn_attr1) +// CIR: cir.func dso_local @_Z2s2ii(%arg0:{{.*}}, %arg1:{{.*}} -> {{.*}} extra(#fn_attr2) +// CIR: cir.func dso_local @_Z2s3ii(%arg0:{{.*}}, %arg1:{{.*}} -> {{.*}} { // LLVM: define dso_local i32 @_Z2s1ii(i32 %0, i32 %1) {{.*}} #[[#ATTR1:]] // LLVM: define dso_local i32 @_Z2s2ii(i32 %0, i32 %1) {{.*}} #[[#ATTR2:]] diff --git a/clang/test/CIR/CodeGen/global-ctor-dtor.cpp b/clang/test/CIR/CodeGen/global-ctor-dtor.cpp index 178da976324f..6f34f5cd2d26 100644 --- a/clang/test/CIR/CodeGen/global-ctor-dtor.cpp +++ b/clang/test/CIR/CodeGen/global-ctor-dtor.cpp @@ -11,28 +11,28 @@ void foo(void) { bar(); } -// BEFORE: cir.func @_Z3foov() global_ctor(65535) +// BEFORE: cir.func dso_local @_Z3foov() global_ctor(65535) void foo2(void) __attribute__((constructor(777))); void foo2(void) { bar(); } -// BEFORE: cir.func @_Z4foo2v() global_ctor(777) +// BEFORE: cir.func dso_local @_Z4foo2v() global_ctor(777) void foo3(void) __attribute__((destructor)); void foo3(void) { bar(); } -// BEFORE: cir.func @_Z4foo3v() global_dtor(65535) +// BEFORE: cir.func dso_local @_Z4foo3v() global_dtor(65535) void foo4(void) __attribute__((destructor(789))); void foo4(void) { bar(); } -// BEFORE: cir.func @_Z4foo4v() global_dtor(789) +// BEFORE: cir.func dso_local @_Z4foo4v() global_dtor(789) // AFTER: module @{{.*}} attributes {cir.global_ctors = [#cir.global_ctor<"_Z3foov", 65535>, #cir.global_ctor<"_Z4foo2v", 777>], cir.global_dtors = [#cir.global_dtor<"_Z4foo3v", 65535>, #cir.global_dtor<"_Z4foo4v", 789>] // LLVM: @llvm.global_ctors = appending constant [2 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_Z3foov, ptr null }, { i32, ptr, ptr } { i32 777, ptr @_Z4foo2v, ptr null }] diff --git a/clang/test/CIR/CodeGen/globals.cpp b/clang/test/CIR/CodeGen/globals.cpp index 987d3267fe97..9702c0062203 100644 --- a/clang/test/CIR/CodeGen/globals.cpp +++ b/clang/test/CIR/CodeGen/globals.cpp @@ -53,21 +53,21 @@ int use_func() { return func(); } // CHECK-NEXT: cir.global external @rgb = #cir.const_array<[#cir.int<0> : !u8i, #cir.int<233> : !u8i, #cir.int<33> : !u8i]> : !cir.array // CHECK-NEXT: cir.global external @alpha = #cir.const_array<"abc\00" : !cir.array> : !cir.array -// CHECK-NEXT: cir.global "private" constant cir_private dsolocal @".str" = #cir.const_array<"example\00" : !cir.array> : !cir.array {alignment = 1 : i64} +// CHECK-NEXT: cir.global "private" constant cir_private dso_local @".str" = #cir.const_array<"example\00" : !cir.array> : !cir.array {alignment = 1 : i64} // CHECK-NEXT: cir.global external @s = #cir.global_view<@".str"> : !cir.ptr -// CHECK-NEXT: cir.global "private" constant cir_private dsolocal @".str.1" = #cir.const_array<"example1\00" : !cir.array> : !cir.array {alignment = 1 : i64} +// CHECK-NEXT: cir.global "private" constant cir_private dso_local @".str.1" = #cir.const_array<"example1\00" : !cir.array> : !cir.array {alignment = 1 : i64} // CHECK-NEXT: cir.global external @s1 = #cir.global_view<@".str.1"> : !cir.ptr // CHECK-NEXT: cir.global external @s2 = #cir.global_view<@".str"> : !cir.ptr -// CHECK: cir.func @_Z10use_globalv() +// CHECK: cir.func dso_local @_Z10use_globalv() // CHECK-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["li", init] {alignment = 4 : i64} // CHECK-NEXT: %1 = cir.get_global @a : !cir.ptr // CHECK-NEXT: %2 = cir.load{{.*}} %1 : !cir.ptr, !s32i // CHECK-NEXT: cir.store{{.*}} %2, %0 : !s32i, !cir.ptr -// CHECK: cir.func @_Z17use_global_stringv() +// CHECK: cir.func dso_local @_Z17use_global_stringv() // CHECK-NEXT: %0 = cir.alloca !u8i, !cir.ptr, ["c", init] {alignment = 1 : i64} // CHECK-NEXT: %1 = cir.get_global @s2 : !cir.ptr> // CHECK-NEXT: %2 = cir.load{{.*}} %1 : !cir.ptr>, !cir.ptr @@ -85,7 +85,7 @@ int use_func() { return func(); } // CHECK-NEXT: %2 = cir.load{{.*}} %0 : !cir.ptr, !s32i // CHECK-NEXT: cir.return %2 : !s32i // CHECK-NEXT: } -// CHECK-NEXT: cir.func @_Z8use_funcv() -> !s32i +// CHECK-NEXT: cir.func dso_local @_Z8use_funcv() -> !s32i // CHECK-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CHECK-NEXT: %1 = cir.call @_Z4funcIiET_v() : () -> !s32i // CHECK-NEXT: cir.store{{.*}} %1, %0 : !s32i, !cir.ptr @@ -106,7 +106,7 @@ long long ll[] = {999999999, 0, 0, 0}; // CHECK: cir.global external @ll = #cir.const_array<[#cir.int<999999999> : !s64i, #cir.int<0> : !s64i, #cir.int<0> : !s64i, #cir.int<0> : !s64i]> : !cir.array void get_globals() { - // CHECK: cir.func @_Z11get_globalsv() + // CHECK: cir.func dso_local @_Z11get_globalsv() char *s = string; // CHECK: %[[RES:[0-9]+]] = cir.get_global @string : !cir.ptr> // CHECK: %{{[0-9]+}} = cir.cast(array_to_ptrdecay, %[[RES]] : !cir.ptr>), !cir.ptr @@ -128,7 +128,7 @@ void get_globals() { extern int externVar; int testExternVar(void) { return externVar; } // CHECK: cir.global "private" external @externVar : !s32i -// CHECK: cir.func @{{.+}}testExternVar +// CHECK: cir.func dso_local @{{.+}}testExternVar // CHECK: cir.get_global @externVar : !cir.ptr // Should constant initialize global with constant address. diff --git a/clang/test/CIR/CodeGen/gnu-extension.c b/clang/test/CIR/CodeGen/gnu-extension.c index 5a9f4b0b22b4..df5c8c5e695b 100644 --- a/clang/test/CIR/CodeGen/gnu-extension.c +++ b/clang/test/CIR/CodeGen/gnu-extension.c @@ -3,7 +3,7 @@ int foo(void) { return __extension__ 0b101010; } -//CHECK: cir.func @foo() +//CHECK: cir.func dso_local @foo() //CHECK-NEXT: [[ADDR:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} //CHECK-NEXT: [[VAL:%.*]] = cir.const #cir.int<42> : !s32i //CHECK-NEXT: cir.store [[VAL]], [[ADDR]] : !s32i, !cir.ptr @@ -14,6 +14,6 @@ void bar(void) { __extension__ bar; } -//CHECK: cir.func @bar() +//CHECK: cir.func dso_local @bar() //CHECK: {{.*}} = cir.get_global @bar : !cir.ptr> //CHECK: cir.return diff --git a/clang/test/CIR/CodeGen/goto.cpp b/clang/test/CIR/CodeGen/goto.cpp index 1bd3849b43df..af5db0adf778 100644 --- a/clang/test/CIR/CodeGen/goto.cpp +++ b/clang/test/CIR/CodeGen/goto.cpp @@ -12,7 +12,7 @@ void g0(int a) { b = b + 2; } -// CHECK: cir.func @_Z2g0i +// CHECK: cir.func dso_local @_Z2g0i // CHECK-NEXT %0 = cir.alloca !s32i, !cir.ptr, ["a", init] {alignment = 4 : i64} // CHECK-NEXT %1 = cir.alloca !s32i, !cir.ptr, ["b", init] {alignment = 4 : i64} // CHECK-NEXT cir.store %arg0, %0 : !s32i, !cir.ptr @@ -40,7 +40,7 @@ void g1(int a) { } // Make sure alloca for "y" shows up in the entry block -// CHECK: cir.func @_Z2g1i(%arg0: !s32i +// CHECK: cir.func dso_local @_Z2g1i(%arg0: !s32i // CHECK-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["a", init] {alignment = 4 : i64} // CHECK-NEXT: %1 = cir.alloca !s32i, !cir.ptr, ["x", init] {alignment = 4 : i64} // CHECK-NEXT: %2 = cir.alloca !s32i, !cir.ptr, ["y", init] {alignment = 4 : i64} @@ -58,7 +58,7 @@ int g2() { // Make sure (1) we don't get dangling unused cleanup blocks // (2) generated returns consider the function type -// CHECK: cir.func @_Z2g2v() -> !s32i +// CHECK: cir.func dso_local @_Z2g2v() -> !s32i // CHECK: cir.br ^bb2 // CHECK-NEXT: ^bb1: // no predecessors @@ -76,7 +76,7 @@ int shouldNotGenBranchRet(int x) { err: return -1; } -// NOFLAT: cir.func @_Z21shouldNotGenBranchReti +// NOFLAT: cir.func dso_local @_Z21shouldNotGenBranchReti // NOFLAT: cir.if %8 { // NOFLAT: cir.goto "err" // NOFLAT: } @@ -93,12 +93,12 @@ int shouldGenBranch(int x) { err: return -1; } -// NOFLAT: cir.func @_Z15shouldGenBranchi +// NOFLAT: cir.func dso_local @_Z15shouldGenBranchi // NOFLAT: cir.if %9 { // NOFLAT: cir.goto "err" // NOFLAT: } // NOFLAT: cir.br ^bb1 -// NOFLAT: ^bb1: +// NOFLAT: ^bb1: // NOFLAT: cir.label "err" void severalLabelsInARow(int a) { @@ -110,7 +110,7 @@ void severalLabelsInARow(int a) { end2: b = b + 2; } -// NOFLAT: cir.func @_Z19severalLabelsInARowi +// NOFLAT: cir.func dso_local @_Z19severalLabelsInARowi // NOFLAT: ^bb[[#BLK1:]]: // NOFLAT: cir.label "end1" // NOFLAT: cir.br ^bb[[#BLK2:]] @@ -124,7 +124,7 @@ void severalGotosInARow(int a) { end: b = b + 2; } -// NOFLAT: cir.func @_Z18severalGotosInARowi +// NOFLAT: cir.func dso_local @_Z18severalGotosInARowi // NOFLAT: cir.goto "end" // NOFLAT: ^bb[[#BLK1:]]: // NOFLAT: cir.goto "end" @@ -136,7 +136,7 @@ void labelWithoutMatch() { end: return; } -// NOFLAT: cir.func @_Z17labelWithoutMatchv() +// NOFLAT: cir.func dso_local @_Z17labelWithoutMatchv() // NOFLAT: cir.label "end" // NOFLAT: cir.return // NOFLAT: } @@ -147,7 +147,7 @@ int jumpIntoLoop(int* ar) { if (ar) goto label; return -1; - + while (ar) { label: ++ar; @@ -156,7 +156,7 @@ int jumpIntoLoop(int* ar) { return 0; } -// CHECK: cir.func @_Z12jumpIntoLoopPi +// CHECK: cir.func dso_local @_Z12jumpIntoLoopPi // CHECK: cir.brcond {{.*}} ^bb[[#BLK2:]], ^bb[[#BLK3:]] // CHECK: ^bb[[#BLK2]]: // CHECK: cir.br ^bb[[#BODY:]] @@ -174,7 +174,7 @@ int jumpIntoLoop(int* ar) { // CHECK: cir.brcond {{.*}} ^bb[[#BLK8:]], ^bb[[#EXIT:]] // CHECK: ^bb[[#BLK8]]: // CHECK: cir.br ^bb[[#BODY]] -// CHECK: ^bb[[#BODY]]: +// CHECK: ^bb[[#BODY]]: // CHECK: cir.br ^bb[[#COND]] // CHECK: ^bb[[#EXIT]]: // CHECK: cir.br ^bb[[#BLK7:]] @@ -196,10 +196,10 @@ int jumpFromLoop(int* ar) { goto err; ++ar; } - + return 0; } -// CHECK: cir.func @_Z12jumpFromLoopPi +// CHECK: cir.func dso_local @_Z12jumpFromLoopPi // CHECK: cir.brcond {{.*}} ^bb[[#RETURN1:]], ^bb[[#BLK3:]] // CHECK: ^bb[[#RETURN1]]: // CHECK: cir.return @@ -209,7 +209,7 @@ int jumpFromLoop(int* ar) { // CHECK: cir.br ^bb[[#BLK5:]] // CHECK: ^bb[[#BLK5]]: // CHECK: cir.br ^bb[[#COND:]] -// CHECK: ^bb[[#COND]]: +// CHECK: ^bb[[#COND]]: // CHECK: cir.brcond {{.*}} ^bb[[#BODY:]], ^bb[[#EXIT:]] // CHECK: ^bb[[#BODY]]: // CHECK: cir.br ^bb[[#IF42:]] @@ -224,12 +224,12 @@ int jumpFromLoop(int* ar) { // CHECK: ^bb[[#EXIT]]: // CHECK: cir.br ^bb[[#RETURN2:]] // CHECK: ^bb[[#RETURN2]]: -// CHECK: cir.return +// CHECK: cir.return // CHECK: } - + void flatLoopWithNoTerminatorInFront(int* ptr) { - + if (ptr) goto loop; @@ -244,17 +244,17 @@ void flatLoopWithNoTerminatorInFront(int* ptr) { ; } -// CHECK: cir.func @_Z31flatLoopWithNoTerminatorInFrontPi +// CHECK: cir.func dso_local @_Z31flatLoopWithNoTerminatorInFrontPi // CHECK: cir.brcond {{.*}} ^bb[[#BLK2:]], ^bb[[#BLK3:]] // CHECK: ^bb[[#BLK2]]: // CHECK: cir.br ^bb[[#LABEL_LOOP:]] // CHECK: ^bb[[#BLK3]]: -// CHECK: cir.br ^bb[[#BLK4:]] +// CHECK: cir.br ^bb[[#BLK4:]] // CHECK: ^bb[[#BLK4]]: // CHECK: cir.br ^bb[[#BLK5:]] // CHECK: ^bb[[#BLK5]]: // CHECK: cir.br ^bb[[#BODY:]] -// CHECK: ^bb[[#COND]]: +// CHECK: ^bb[[#COND]]: // CHECK: cir.brcond {{.*}} ^bb[[#BODY]], ^bb[[#EXIT:]] // CHECK: ^bb[[#BODY]]: // CHECK: cir.br ^bb[[#BLK8:]] @@ -282,13 +282,13 @@ struct S get(); void bar(struct S); void foo() { - { - label: + { + label: bar(get()); - } + } } -// NOFLAT: cir.func @_Z3foov() +// NOFLAT: cir.func dso_local @_Z3foov() // NOFLAT: cir.scope { // NOFLAT: cir.label "label" // NOFLAT: %0 = cir.alloca !rec_S, !cir.ptr, ["agg.tmp0"] @@ -305,7 +305,7 @@ extern "C" void multiple_non_case(int v) { } } -// NOFLAT: cir.func @multiple_non_case +// NOFLAT: cir.func dso_local @multiple_non_case // NOFLAT: cir.switch // NOFLAT: cir.case(default, []) { // NOFLAT: cir.call @action1() @@ -328,7 +328,7 @@ extern "C" void case_follow_label(int v) { } } -// NOFLAT: cir.func @case_follow_label +// NOFLAT: cir.func dso_local @case_follow_label // NOFLAT: cir.switch // NOFLAT: cir.case(equal, [#cir.int<1> : !s32i]) { // NOFLAT: cir.label "label" @@ -352,7 +352,7 @@ extern "C" void default_follow_label(int v) { } } -// NOFLAT: cir.func @default_follow_label +// NOFLAT: cir.func dso_local @default_follow_label // NOFLAT: cir.switch // NOFLAT: cir.case(anyof, [#cir.int<1> : !s32i, #cir.int<2> : !s32i]) { // NOFLAT: cir.call @action1() diff --git a/clang/test/CIR/CodeGen/hello.c b/clang/test/CIR/CodeGen/hello.c index 3454b40afeed..ab937901bad7 100644 --- a/clang/test/CIR/CodeGen/hello.c +++ b/clang/test/CIR/CodeGen/hello.c @@ -8,8 +8,8 @@ int main (void) { } // CHECK: cir.func private @printf(!cir.ptr, ...) -> !s32i -// CHECK: cir.global "private" constant cir_private dsolocal @".str" = #cir.const_array<"Hello, world!\0A\00" : !cir.array> : !cir.array {alignment = 1 : i64} -// CHECK: cir.func @main() -> !s32i +// CHECK: cir.global "private" constant cir_private dso_local @".str" = #cir.const_array<"Hello, world!\0A\00" : !cir.array> : !cir.array {alignment = 1 : i64} +// CHECK: cir.func dso_local @main() -> !s32i // CHECK: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CHECK: %1 = cir.get_global @printf : !cir.ptr, ...) -> !s32i>> // CHECK: %2 = cir.get_global @".str" : !cir.ptr> diff --git a/clang/test/CIR/CodeGen/if-constexpr.cpp b/clang/test/CIR/CodeGen/if-constexpr.cpp index a03ac6f42c4b..dd13591be17f 100644 --- a/clang/test/CIR/CodeGen/if-constexpr.cpp +++ b/clang/test/CIR/CodeGen/if-constexpr.cpp @@ -39,7 +39,7 @@ void if0() { } } -// CHECK: cir.func @_Z3if0v() {{.*}} +// CHECK: cir.func dso_local @_Z3if0v() {{.*}} // CHECK: cir.store{{.*}} %1, %0 : !s32i, !cir.ptr loc({{.*}}) // CHECK-NEXT: cir.scope { // CHECK-NEXT: %2 = cir.alloca !s32i, !cir.ptr, ["x", init] {{.*}} diff --git a/clang/test/CIR/CodeGen/implicit-return.cpp b/clang/test/CIR/CodeGen/implicit-return.cpp index fa64d244957d..d53568d522de 100644 --- a/clang/test/CIR/CodeGen/implicit-return.cpp +++ b/clang/test/CIR/CodeGen/implicit-return.cpp @@ -5,22 +5,22 @@ void ret_void() {} -// CHECK-O0: cir.func @_Z8ret_voidv() +// CHECK-O0: cir.func dso_local @_Z8ret_voidv() // CHECK-O0-NEXT: cir.return // CHECK-O0-NEXT: } -// CHECK-O2: cir.func @_Z8ret_voidv() +// CHECK-O2: cir.func dso_local @_Z8ret_voidv() // CHECK-O2-NEXT: cir.return // CHECK-O2-NEXT: } int ret_non_void() {} -// CHECK-O0: cir.func @_Z12ret_non_voidv() -> !s32i +// CHECK-O0: cir.func dso_local @_Z12ret_non_voidv() -> !s32i // CHECK-O0-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] // CHECK-O0-NEXT: cir.trap // CHECK-O0-NEXT: } -// CHECK-O2: cir.func @_Z12ret_non_voidv() -> !s32i +// CHECK-O2: cir.func dso_local @_Z12ret_non_voidv() -> !s32i // CHECK-O2-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] // CHECK-O2-NEXT: cir.unreachable // CHECK-O2-NEXT: } diff --git a/clang/test/CIR/CodeGen/inc-bool.cpp b/clang/test/CIR/CodeGen/inc-bool.cpp index 1c9b9dee920c..17557d338ce0 100644 --- a/clang/test/CIR/CodeGen/inc-bool.cpp +++ b/clang/test/CIR/CodeGen/inc-bool.cpp @@ -5,7 +5,7 @@ void foo(bool x) { x++; } -// CHECK: cir.func @_Z3foob(%arg0: !cir.bool loc({{.*}})) +// CHECK: cir.func dso_local @_Z3foob(%arg0: !cir.bool loc({{.*}})) // CHECK: [[ALLOC_X:%.*]] = cir.alloca !cir.bool, !cir.ptr, ["x", init] {alignment = 1 : i64} // CHECK: cir.store{{.*}} %arg0, [[ALLOC_X]] : !cir.bool, !cir.ptr // CHECK: {{.*}} = cir.load{{.*}} [[ALLOC_X]] : !cir.ptr, !cir.bool diff --git a/clang/test/CIR/CodeGen/inc-dec.cpp b/clang/test/CIR/CodeGen/inc-dec.cpp index 129b91c8e340..c8aa62198c81 100644 --- a/clang/test/CIR/CodeGen/inc-dec.cpp +++ b/clang/test/CIR/CodeGen/inc-dec.cpp @@ -6,7 +6,7 @@ unsigned id0() { return ++a; } -// CHECK: cir.func @_Z3id0v() -> !u32i +// CHECK: cir.func dso_local @_Z3id0v() -> !u32i // CHECK: %[[#RET:]] = cir.alloca !u32i, !cir.ptr, ["__retval"] // CHECK: %[[#A:]] = cir.alloca !u32i, !cir.ptr, ["a", init] // CHECK: %[[#BEFORE_A:]] = cir.load{{.*}} %[[#A]] @@ -20,7 +20,7 @@ unsigned id1() { return --a; } -// CHECK: cir.func @_Z3id1v() -> !u32i +// CHECK: cir.func dso_local @_Z3id1v() -> !u32i // CHECK: %[[#RET:]] = cir.alloca !u32i, !cir.ptr, ["__retval"] // CHECK: %[[#A:]] = cir.alloca !u32i, !cir.ptr, ["a", init] // CHECK: %[[#BEFORE_A:]] = cir.load{{.*}} %[[#A]] @@ -33,7 +33,7 @@ unsigned id2() { return a++; } -// CHECK: cir.func @_Z3id2v() -> !u32i +// CHECK: cir.func dso_local @_Z3id2v() -> !u32i // CHECK: %[[#RET:]] = cir.alloca !u32i, !cir.ptr, ["__retval"] // CHECK: %[[#A:]] = cir.alloca !u32i, !cir.ptr, ["a", init] // CHECK: %[[#BEFORE_A:]] = cir.load{{.*}} %[[#A]] @@ -46,7 +46,7 @@ unsigned id3() { return a--; } -// CHECK: cir.func @_Z3id3v() -> !u32i +// CHECK: cir.func dso_local @_Z3id3v() -> !u32i // CHECK: %[[#RET:]] = cir.alloca !u32i, !cir.ptr, ["__retval"] // CHECK: %[[#A:]] = cir.alloca !u32i, !cir.ptr, ["a", init] // CHECK: %[[#BEFORE_A:]] = cir.load{{.*}} %[[#A]] diff --git a/clang/test/CIR/CodeGen/initlist-ptr-ptr.cpp b/clang/test/CIR/CodeGen/initlist-ptr-ptr.cpp index 96a1fcb47f79..2319bb31e551 100644 --- a/clang/test/CIR/CodeGen/initlist-ptr-ptr.cpp +++ b/clang/test/CIR/CodeGen/initlist-ptr-ptr.cpp @@ -21,12 +21,12 @@ void test() { // CIR: cir.store{{.*}} %arg0, [[LOCAL]] : [[INITLIST_TYPE]], !cir.ptr<[[INITLIST_TYPE]]> // CIR: cir.return -// CIR: cir.global "private" constant cir_private dsolocal [[STR_XY:@.*]] = #cir.const_array<"xy\00" : !cir.array> : !cir.array -// CIR: cir.global "private" constant cir_private dsolocal [[STR_UV:@.*]] = #cir.const_array<"uv\00" : !cir.array> : !cir.array +// CIR: cir.global "private" constant cir_private dso_local [[STR_XY:@.*]] = #cir.const_array<"xy\00" : !cir.array> : !cir.array +// CIR: cir.global "private" constant cir_private dso_local [[STR_UV:@.*]] = #cir.const_array<"uv\00" : !cir.array> : !cir.array -// CIR: cir.func @_ZSt4testv() +// CIR: cir.func dso_local @_ZSt4testv() // CIR: cir.scope { -// CIR: [[INITLIST_LOCAL:%.*]] = cir.alloca [[INITLIST_TYPE]], !cir.ptr<[[INITLIST_TYPE]]>, +// CIR: [[INITLIST_LOCAL:%.*]] = cir.alloca [[INITLIST_TYPE]], !cir.ptr<[[INITLIST_TYPE]]>, // CIR: [[LOCAL_ELEM_ARRAY:%.*]] = cir.alloca !cir.array x 2>, !cir.ptr x 2>>, // CIR: [[FIRST_ELEM_PTR:%.*]] = cir.cast(array_to_ptrdecay, [[LOCAL_ELEM_ARRAY]] : !cir.ptr x 2>>), !cir.ptr> // CIR: [[XY_CHAR_ARRAY:%.*]] = cir.get_global [[STR_XY]] : !cir.ptr> diff --git a/clang/test/CIR/CodeGen/initlist-ptr-unsigned.cpp b/clang/test/CIR/CodeGen/initlist-ptr-unsigned.cpp index c70fb4ce6ac9..4b2ae721b42f 100644 --- a/clang/test/CIR/CodeGen/initlist-ptr-unsigned.cpp +++ b/clang/test/CIR/CodeGen/initlist-ptr-unsigned.cpp @@ -22,7 +22,7 @@ void test() { // CIR: cir.store{{.*}} %arg0, [[REG0]] : [[INITLIST_TYPE]], !cir.ptr<[[INITLIST_TYPE]]> // CIR: cir.return -// CIR: cir.func @_ZSt4testv() +// CIR: cir.func dso_local @_ZSt4testv() // CIR: cir.scope { // CIR: [[LIST_PTR:%.*]] = cir.alloca [[INITLIST_TYPE]], !cir.ptr<[[INITLIST_TYPE]]>, // CIR: [[ARRAY:%.*]] = cir.alloca !cir.array, !cir.ptr>, @@ -42,7 +42,7 @@ void test() { // CIR: } // LLVM: %"class.std::initializer_list" = type { ptr, i64 } -// LLVM: define linkonce_odr void @_ZSt1fIiEvSt16initializer_listIT_E(%"class.std::initializer_list" [[ARG:%.*]]) +// LLVM: define linkonce_odr void @_ZSt1fIiEvSt16initializer_listIT_E(%"class.std::initializer_list" [[ARG:%.*]]) // LLVM: [[LOCAL:%.*]] = alloca %"class.std::initializer_list", i64 1, align 8 // LLVM: store %"class.std::initializer_list" [[ARG]], ptr [[LOCAL]], align 8 diff --git a/clang/test/CIR/CodeGen/kr-func-promote.c b/clang/test/CIR/CodeGen/kr-func-promote.c index 2e9839b7e6dc..78d629c71381 100644 --- a/clang/test/CIR/CodeGen/kr-func-promote.c +++ b/clang/test/CIR/CodeGen/kr-func-promote.c @@ -6,7 +6,7 @@ // CHECK: cir.store %1, %0 : !s16i, !cir.ptr void foo(x) short x; {} -// CHECK: cir.func no_proto @bar(%arg0: !cir.double +// CHECK: cir.func no_proto dso_local @bar(%arg0: !cir.double // CHECK: %0 = cir.alloca !cir.float, !cir.ptr, ["f", init] // CHECK: %1 = cir.cast(floating, %arg0 : !cir.double), !cir.float // CHECK: cir.store %1, %0 : !cir.float, !cir.ptr diff --git a/clang/test/CIR/CodeGen/lambda.cpp b/clang/test/CIR/CodeGen/lambda.cpp index 7abc899f6f36..aca3692a8412 100644 --- a/clang/test/CIR/CodeGen/lambda.cpp +++ b/clang/test/CIR/CodeGen/lambda.cpp @@ -15,9 +15,9 @@ void fn() { // CHECK-DAG: !rec_anon2E8 = !cir.record}> // CHECK-DAG: module -// CHECK: cir.func lambda internal private @_ZZ2fnvENK3$_0clEv{{.*}}) extra +// CHECK: cir.func lambda internal private dso_local @_ZZ2fnvENK3$_0clEv{{.*}}) extra -// CHECK: cir.func @_Z2fnv() +// CHECK: cir.func dso_local @_Z2fnv() // CHECK-NEXT: %0 = cir.alloca !rec_anon2E0, !cir.ptr, ["a"] // CHECK: cir.call @_ZZ2fnvENK3$_0clEv @@ -41,7 +41,7 @@ void l0() { a(); } -// CHECK: cir.func lambda internal private @_ZZ2l0vENK3$_0clEv({{.*}}) extra +// CHECK: cir.func lambda internal private dso_local @_ZZ2l0vENK3$_0clEv({{.*}}) extra // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CHECK: cir.store{{.*}} %arg0, %0 : !cir.ptr, !cir.ptr> @@ -197,13 +197,13 @@ int g3() { } // lambda operator() -// CHECK: cir.func lambda internal private @_ZZ2g3vENK3$_0clERKi{{.*}}!s32i extra +// CHECK: cir.func lambda internal private dso_local @_ZZ2g3vENK3$_0clERKi{{.*}}!s32i extra // lambda __invoke() -// CHECK: cir.func internal private @_ZZ2g3vEN3$_08__invokeERKi +// CHECK: cir.func internal private dso_local @_ZZ2g3vEN3$_08__invokeERKi // lambda operator int (*)(int const&)() -// CHECK: cir.func internal private @_ZZ2g3vENK3$_0cvPFiRKiEEv +// CHECK: cir.func internal private dso_local @_ZZ2g3vENK3$_0cvPFiRKiEEv // CHECK-LABEL: @_Z2g3v() // CHECK: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} @@ -236,7 +236,7 @@ int g3() { // lambda operator() // LLVM-LABEL: _ZZ2g3vENK3$_0clERKi // FIXME: argument attributes should be emitted -// COM: LLVM-SAME: (ptr noundef nonnull align 1 dereferenceable(1) {{%.*}}, +// COM: LLVM-SAME: (ptr noundef nonnull align 1 dereferenceable(1) {{%.*}}, // COM: LLVM-SAME: ptr noundef nonnull align 4 dereferenceable(4){{%.*}}) #0 align 2 // lambda __invoke() diff --git a/clang/test/CIR/CodeGen/libcall.cpp b/clang/test/CIR/CodeGen/libcall.cpp index f03c310f07fe..daa902ec9e94 100644 --- a/clang/test/CIR/CodeGen/libcall.cpp +++ b/clang/test/CIR/CodeGen/libcall.cpp @@ -39,7 +39,7 @@ void t(const char* fmt, ...) { consume_message(message); } -// CHECK: cir.func @_Z15consume_messagePKc(%arg0: !cir.ptr +// CHECK: cir.func dso_local @_Z15consume_messagePKc(%arg0: !cir.ptr // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["m", init] {alignment = 8 : i64} // CHECK: %3 = cir.load{{.*}} %0 : !cir.ptr>, !cir.ptr @@ -47,7 +47,7 @@ void t(const char* fmt, ...) { // CHECK: %5 = cir.call @_ZL6strlenPKcU17pass_object_size0(%3, %4) : (!cir.ptr, !u64i) -> !u64i // CHECK: cir.func private @__vsnprintf_chk -// CHECK: cir.func internal private @_ZL9vsnprintfPcU17pass_object_size1iPKcP13__va_list_tag +// CHECK: cir.func internal private dso_local @_ZL9vsnprintfPcU17pass_object_size1iPKcP13__va_list_tag // Implicit size parameter in arg %1 // diff --git a/clang/test/CIR/CodeGen/linkage.c b/clang/test/CIR/CodeGen/linkage.c index 49fdb643b2cb..7f59a44b5731 100644 --- a/clang/test/CIR/CodeGen/linkage.c +++ b/clang/test/CIR/CodeGen/linkage.c @@ -14,14 +14,14 @@ int foo(void) { return bar(5); } -// CIR: cir.func internal private @bar( -// CIR: cir.func @foo( +// CIR: cir.func internal private dso_local @bar( +// CIR: cir.func dso_local @foo( // LLVM: define internal i32 @bar( // LLVM: define dso_local i32 @foo( static int var = 0; -// CIR: cir.global "private" internal dsolocal @var = #cir.int<0> : !s32i +// CIR: cir.global "private" internal dso_local @var = #cir.int<0> : !s32i int get_var(void) { return var; } diff --git a/clang/test/CIR/CodeGen/loop-scope.cpp b/clang/test/CIR/CodeGen/loop-scope.cpp index f12863f3a0cf..cd2cc76426c1 100644 --- a/clang/test/CIR/CodeGen/loop-scope.cpp +++ b/clang/test/CIR/CodeGen/loop-scope.cpp @@ -9,7 +9,7 @@ void l0(void) { } } -// CPPSCOPE: cir.func @_Z2l0v() +// CPPSCOPE: cir.func dso_local @_Z2l0v() // CPPSCOPE-NEXT: cir.scope { // CPPSCOPE-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["i", init] {alignment = 4 : i64} // CPPSCOPE-NEXT: %1 = cir.const #cir.int<0> : !s32i @@ -20,7 +20,7 @@ void l0(void) { // CPPSCOPE-NEXT: cir.scope { // CPPSCOPE-NEXT: %2 = cir.alloca !s32i, !cir.ptr, ["j", init] {alignment = 4 : i64} -// CSCOPE: cir.func @l0() +// CSCOPE: cir.func dso_local @l0() // CSCOPE-NEXT: cir.scope { // CSCOPE-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["i", init] {alignment = 4 : i64} // CSCOPE-NEXT: %1 = cir.const #cir.int<0> : !s32i diff --git a/clang/test/CIR/CodeGen/loop.cpp b/clang/test/CIR/CodeGen/loop.cpp index ef781c9e4dbf..7c87c4e5d1fe 100644 --- a/clang/test/CIR/CodeGen/loop.cpp +++ b/clang/test/CIR/CodeGen/loop.cpp @@ -6,7 +6,7 @@ void l0() { } } -// CHECK: cir.func @_Z2l0v +// CHECK: cir.func dso_local @_Z2l0v // CHECK: cir.for : cond { // CHECK: %[[#TRUE:]] = cir.const #true // CHECK: cir.condition(%[[#TRUE]]) @@ -18,7 +18,7 @@ void l1() { } } -// CHECK: cir.func @_Z2l1v +// CHECK: cir.func dso_local @_Z2l1v // CHECK: cir.for : cond { // CHECK-NEXT: %4 = cir.load{{.*}} %2 : !cir.ptr, !s32i // CHECK-NEXT: %5 = cir.const #cir.int<10> : !s32i @@ -53,7 +53,7 @@ void l2(bool cond) { } } -// CHECK: cir.func @_Z2l2b +// CHECK: cir.func dso_local @_Z2l2b // CHECK: cir.scope { // CHECK-NEXT: cir.while { // CHECK-NEXT: %3 = cir.load{{.*}} %0 : !cir.ptr, !cir.bool @@ -111,7 +111,7 @@ void l3(bool cond) { } while (1); } -// CHECK: cir.func @_Z2l3b +// CHECK: cir.func dso_local @_Z2l3b // CHECK: cir.scope { // CHECK-NEXT: cir.do { // CHECK-NEXT: cir.scope { @@ -166,7 +166,7 @@ void l4() { } } -// CHECK: cir.func @_Z2l4v +// CHECK: cir.func dso_local @_Z2l4v // CHECK: cir.while { // CHECK-NEXT: %[[#TRUE:]] = cir.const #true // CHECK-NEXT: cir.condition(%[[#TRUE]]) @@ -190,7 +190,7 @@ void l5() { } while (0); } -// CHECK: cir.func @_Z2l5v() +// CHECK: cir.func dso_local @_Z2l5v() // CHECK-NEXT: cir.scope { // CHECK-NEXT: cir.do { // CHECK-NEXT: cir.yield @@ -209,7 +209,7 @@ void l6() { } } -// CHECK: cir.func @_Z2l6v() +// CHECK: cir.func dso_local @_Z2l6v() // CHECK-NEXT: cir.scope { // CHECK-NEXT: cir.while { // CHECK-NEXT: %[[#TRUE:]] = cir.const #true @@ -231,7 +231,7 @@ void unreachable_after_break() { } } -// CHECK-NEXT: cir.func @_Z23unreachable_after_breakv() +// CHECK-NEXT: cir.func dso_local @_Z23unreachable_after_breakv() // CHECK-NEXT: cir.scope { // CHECK-NEXT: cir.for : cond { // CHECK-NEXT: %0 = cir.const #true @@ -260,7 +260,7 @@ void unreachable_after_continue() { } } -// CHECK-NEXT: cir.func @_Z26unreachable_after_continuev() +// CHECK-NEXT: cir.func dso_local @_Z26unreachable_after_continuev() // CHECK-NEXT: cir.scope { // CHECK-NEXT: cir.for : cond { // CHECK-NEXT: %0 = cir.const #true diff --git a/clang/test/CIR/CodeGen/lvalue-refs.cpp b/clang/test/CIR/CodeGen/lvalue-refs.cpp index 724b15c6d3e3..82799987aaca 100644 --- a/clang/test/CIR/CodeGen/lvalue-refs.cpp +++ b/clang/test/CIR/CodeGen/lvalue-refs.cpp @@ -6,7 +6,7 @@ struct String { void split(String &S) {} -// CHECK: cir.func @_Z5splitR6String(%arg0: !cir.ptr +// CHECK: cir.func dso_local @_Z5splitR6String(%arg0: !cir.ptr // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["S", init, const] void foo() { @@ -14,6 +14,6 @@ void foo() { split(s); } -// CHECK: cir.func @_Z3foov() +// CHECK: cir.func dso_local @_Z3foov() // CHECK: %0 = cir.alloca !rec_String, !cir.ptr, ["s"] // CHECK: cir.call @_Z5splitR6String(%0) : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/move.cpp b/clang/test/CIR/CodeGen/move.cpp index a5678eba4033..2b4ec096aa1b 100644 --- a/clang/test/CIR/CodeGen/move.cpp +++ b/clang/test/CIR/CodeGen/move.cpp @@ -28,7 +28,7 @@ void t() { // FIXME: we should explicitly model std::move here since it will // be useful at least for the lifetime checker. -// CHECK: cir.func @_Z1tv() +// CHECK: cir.func dso_local @_Z1tv() // CHECK: %[[#Addr:]] = cir.alloca ![[StdString]], {{.*}} ["ref.tmp0"] // CHECK: %[[#RValStr:]] = cir.call @_Z6getstrv() : () -> ![[StdString]] // CHECK: cir.store{{.*}} %[[#RValStr]], %[[#Addr]] diff --git a/clang/test/CIR/CodeGen/multi-vtable.cpp b/clang/test/CIR/CodeGen/multi-vtable.cpp index 02d0c6d97a8a..9b44d4607530 100644 --- a/clang/test/CIR/CodeGen/multi-vtable.cpp +++ b/clang/test/CIR/CodeGen/multi-vtable.cpp @@ -74,7 +74,7 @@ int main() { // LLVM-DAG: ret void // } -// CIR: cir.func @main() -> !s32i extra(#fn_attr) { +// CIR: cir.func dso_local @main() -> !s32i extra(#fn_attr) { // CIR: %{{[0-9]+}} = cir.vtable.address_point( %{{[0-9]+}} : !cir.ptr)>>>, address_point = ) : !cir.ptr)>>> diff --git a/clang/test/CIR/CodeGen/new-null.cpp b/clang/test/CIR/CodeGen/new-null.cpp index bd708ab266ce..a8a7630b7270 100644 --- a/clang/test/CIR/CodeGen/new-null.cpp +++ b/clang/test/CIR/CodeGen/new-null.cpp @@ -45,7 +45,7 @@ namespace test15 { new (p) A(); } - // CIR-LABEL: cir.func @_ZN6test156test0bEPv( + // CIR-LABEL: cir.func dso_local @_ZN6test156test0bEPv( // CIR-SAME: %[[VAL_0:.*]]: !cir.ptr // CIR: %[[VAL_1:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["p", init] {alignment = 8 : i64} // CIR: cir.store %[[VAL_0]], %[[VAL_1]] : !cir.ptr, !cir.ptr> @@ -82,7 +82,7 @@ namespace test15 { extern "C" void test_basic() { __builtin_operator_delete(__builtin_operator_new(4)); - // CIR-LABEL: cir.func @test_basic + // CIR-LABEL: cir.func dso_local @test_basic // CIR: [[P:%.*]] = cir.call @_Znwm({{%.*}}) : (!u64i) -> !cir.ptr // CIR: cir.call @_ZdlPv([[P]]) : (!cir.ptr) -> () // CIR: cir.return @@ -96,7 +96,7 @@ extern "C" void test_basic() { extern "C" void test_aligned_alloc() { __builtin_operator_delete(__builtin_operator_new(4, std::align_val_t(4)), std::align_val_t(4)); - // CIR-LABEL: cir.func @test_aligned_alloc + // CIR-LABEL: cir.func dso_local @test_aligned_alloc // CIR: [[P:%.*]] = cir.call @_ZnwmSt11align_val_t({{%.*}}, {{%.*}}) : (!u64i, !u64i) -> !cir.ptr // CIR: cir.call @_ZdlPvSt11align_val_t([[P]], {{%.*}}) : (!cir.ptr, !u64i) -> () // CIR: cir.return @@ -110,7 +110,7 @@ extern "C" void test_aligned_alloc() { extern "C" void test_sized_delete() { __builtin_operator_delete(__builtin_operator_new(4), 4); - // CIR-LABEL: cir.func @test_sized_delete + // CIR-LABEL: cir.func dso_local @test_sized_delete // CIR: [[P:%.*]] = cir.call @_Znwm({{%.*}}) : (!u64i) -> !cir.ptr // CIR: cir.call @_ZdlPvm([[P]], {{%.*}}) : (!cir.ptr, !u64i) -> () // CIR: cir.return diff --git a/clang/test/CIR/CodeGen/new.cpp b/clang/test/CIR/CodeGen/new.cpp index 3ee57f7dd75a..66941c2d6c47 100644 --- a/clang/test/CIR/CodeGen/new.cpp +++ b/clang/test/CIR/CodeGen/new.cpp @@ -65,7 +65,7 @@ void t_new_constant_size() { // In this test, NUM_ELEMENTS isn't used because no cookie is needed and there // are no constructor calls needed. -// CHECK: cir.func @_Z19t_new_constant_sizev() +// CHECK: cir.func dso_local @_Z19t_new_constant_sizev() // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["p", init] {alignment = 8 : i64} // CHECK: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<16> : !u64i // CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<128> : !u64i @@ -81,7 +81,7 @@ void t_new_multidim_constant_size() { // As above, NUM_ELEMENTS isn't used. -// CHECK: cir.func @_Z28t_new_multidim_constant_sizev() +// CHECK: cir.func dso_local @_Z28t_new_multidim_constant_sizev() // CHECK: %0 = cir.alloca !cir.ptr x 3>>, !cir.ptr x 3>>>, ["p", init] {alignment = 8 : i64} // CHECK: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<24> : !u64i // CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<192> : !u64i @@ -100,7 +100,7 @@ void t_constant_size_nontrivial() { auto p = new C[3]; } -// CHECK: cir.func @_Z26t_constant_size_nontrivialv() +// CHECK: cir.func dso_local @_Z26t_constant_size_nontrivialv() // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["p", init] {alignment = 8 : i64} // CHECK: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<3> : !u64i // CHECK: %[[SIZE_WITHOUT_COOKIE:.*]] = cir.const #cir.int<3> : !u64i @@ -129,7 +129,7 @@ void t_constant_size_nontrivial2() { // In this test SIZE_WITHOUT_COOKIE isn't used, but it would be if there were // an initializer. -// CHECK: cir.func @_Z27t_constant_size_nontrivial2v() +// CHECK: cir.func dso_local @_Z27t_constant_size_nontrivial2v() // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["p", init] {alignment = 8 : i64} // CHECK: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<3> : !u64i // CHECK: %[[SIZE_WITHOUT_COOKIE:.*]] = cir.const #cir.int<12> : !u64i @@ -152,7 +152,7 @@ void t_constant_size_memset_init() { // In this test, NUM_ELEMENTS isn't used because no cookie is needed and there // are no constructor calls needed. -// CHECK: cir.func @_Z27t_constant_size_memset_initv() +// CHECK: cir.func dso_local @_Z27t_constant_size_memset_initv() // CHECK: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<16> : !u64i // CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<64> : !u64i // CHECK: %[[ALLOC_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) : (!u64i) -> !cir.ptr @@ -166,7 +166,7 @@ void t_constant_size_partial_init() { auto p = new int[16] { 1, 2, 3 }; } -// CHECK: cir.func @_Z28t_constant_size_partial_initv() +// CHECK: cir.func dso_local @_Z28t_constant_size_partial_initv() // CHECK: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<16> : !u64i // CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<64> : !u64i // CHECK: %[[ALLOC_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) : (!u64i) -> !cir.ptr @@ -194,7 +194,7 @@ void t_new_var_size(size_t n) { auto p = new char[n]; } -// CHECK: cir.func @_Z14t_new_var_sizem +// CHECK: cir.func dso_local @_Z14t_new_var_sizem // CHECK: %[[N:.*]] = cir.load{{.*}} %[[ARG_ALLOCA:.*]] // CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[N]]) : (!u64i) @@ -202,7 +202,7 @@ void t_new_var_size2(int n) { auto p = new char[n]; } -// CHECK: cir.func @_Z15t_new_var_size2i +// CHECK: cir.func dso_local @_Z15t_new_var_size2i // CHECK: %[[N:.*]] = cir.load{{.*}} %[[ARG_ALLOCA:.*]] // CHECK: %[[N_SIZE_T:.*]] = cir.cast(integral, %[[N]] : !s32i), !u64i // CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[N_SIZE_T]]) : (!u64i) @@ -211,7 +211,7 @@ void t_new_var_size3(size_t n) { auto p = new double[n]; } -// CHECK: cir.func @_Z15t_new_var_size3m +// CHECK: cir.func dso_local @_Z15t_new_var_size3m // CHECK: %[[N:.*]] = cir.load{{.*}} %[[ARG_ALLOCA:.*]] // CHECK: %[[ELEMENT_SIZE:.*]] = cir.const #cir.int<8> : !u64i // CHECK: %[[RESULT:.*]], %[[OVERFLOW:.*]] = cir.binop.overflow(mul, %[[N]], %[[ELEMENT_SIZE]]) : !u64i, (!u64i, !cir.bool) @@ -223,7 +223,7 @@ void t_new_var_size4(int n) { auto p = new double[n]; } -// CHECK: cir.func @_Z15t_new_var_size4i +// CHECK: cir.func dso_local @_Z15t_new_var_size4i // CHECK: %[[N:.*]] = cir.load{{.*}} %[[ARG_ALLOCA:.*]] // CHECK: %[[N_SIZE_T:.*]] = cir.cast(integral, %[[N]] : !s32i), !u64i // CHECK: %[[ELEMENT_SIZE:.*]] = cir.const #cir.int<8> : !u64i @@ -238,7 +238,7 @@ void t_new_var_size5(int n) { // NUM_ELEMENTS isn't used in this case because there is no cookie. -// CHECK: cir.func @_Z15t_new_var_size5i +// CHECK: cir.func dso_local @_Z15t_new_var_size5i // CHECK: %[[N:.*]] = cir.load{{.*}} %[[ARG_ALLOCA:.*]] // CHECK: %[[N_SIZE_T:.*]] = cir.cast(integral, %[[N]] : !s32i), !u64i // CHECK: %[[ELEMENT_SIZE:.*]] = cir.const #cir.int<48> : !u64i @@ -253,7 +253,7 @@ void t_new_var_size6(int n) { auto p = new double[n] { 1, 2, 3 }; } -// CHECK: cir.func @_Z15t_new_var_size6i +// CHECK: cir.func dso_local @_Z15t_new_var_size6i // CHECK: %[[N:.*]] = cir.load{{.*}} %[[ARG_ALLOCA:.*]] // CHECK: %[[N_SIZE_T:.*]] = cir.cast(integral, %[[N]] : !s32i), !u64i // CHECK: %[[MIN_SIZE:.*]] = cir.const #cir.int<3> : !u64i @@ -269,7 +269,7 @@ void t_new_var_size7(__int128 n) { auto p = new double[n]; } -// CHECK: cir.func @_Z15t_new_var_size7n +// CHECK: cir.func dso_local @_Z15t_new_var_size7n // CHECK: %[[N:.*]] = cir.load{{.*}} %[[ARG_ALLOCA:.*]] // CHECK: %[[N_SIZE_T:.*]] = cir.cast(integral, %[[N]] : !s128i), !u64i // CHECK: %[[ELEMENT_SIZE:.*]] = cir.const #cir.int<8> : !u64i @@ -282,7 +282,7 @@ void t_new_var_size_nontrivial(size_t n) { auto p = new D[n]; } -// CHECK: cir.func @_Z25t_new_var_size_nontrivialm +// CHECK: cir.func dso_local @_Z25t_new_var_size_nontrivialm // CHECK: %[[N:.*]] = cir.load{{.*}} %[[ARG_ALLOCA:.*]] // CHECK: %[[ELEMENT_SIZE:.*]] = cir.const #cir.int<4> : !u64i // CHECK: %[[SIZE_WITHOUT_COOKIE:.*]], %[[OVERFLOW:.*]] = cir.binop.overflow(mul, %[[N]], %[[ELEMENT_SIZE]]) : !u64i, (!u64i, !cir.bool) @@ -297,7 +297,7 @@ void t_multidim_init() { auto *p = new int[2][3] { {1, 2, 3}, {4, 5, 6}}; } -// CHECK: cir.func @_Z15t_multidim_initv() +// CHECK: cir.func dso_local @_Z15t_multidim_initv() // CHECK: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<6> : !u64i // CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<24> : !u64i // CHECK: %[[NEW_PTR:.*]] = cir.call @_Znam(%2) : (!u64i) -> !cir.ptr diff --git a/clang/test/CIR/CodeGen/no-pie.c b/clang/test/CIR/CodeGen/no-pie.c index e8ab9c112466..0639fd34c363 100644 --- a/clang/test/CIR/CodeGen/no-pie.c +++ b/clang/test/CIR/CodeGen/no-pie.c @@ -7,5 +7,5 @@ extern int var; int get() { return var; } -// CIR: cir.global "private" external dsolocal @var : !s32i {alignment = 4 : i64} -// LLVM: @var = external dso_local global i32 \ No newline at end of file +// CIR: cir.global "private" external dso_local @var : !s32i {alignment = 4 : i64} +// LLVM: @var = external dso_local global i32 diff --git a/clang/test/CIR/CodeGen/no-proto-fun-ptr.c b/clang/test/CIR/CodeGen/no-proto-fun-ptr.c index 88127468399d..0dcf79f68c0f 100644 --- a/clang/test/CIR/CodeGen/no-proto-fun-ptr.c +++ b/clang/test/CIR/CodeGen/no-proto-fun-ptr.c @@ -6,7 +6,7 @@ void check_noproto_ptr() { void (*fun)(void) = empty; } -// CHECK: cir.func no_proto @check_noproto_ptr() +// CHECK: cir.func no_proto dso_local @check_noproto_ptr() // CHECK: [[ALLOC:%.*]] = cir.alloca !cir.ptr>, !cir.ptr>>, ["fun", init] {alignment = 8 : i64} // CHECK: [[GGO:%.*]] = cir.get_global @empty : !cir.ptr> // CHECK: cir.store{{.*}} [[GGO]], [[ALLOC]] : !cir.ptr>, !cir.ptr>> @@ -19,7 +19,7 @@ void buz() { (*func)(); } -// CHECK: cir.func no_proto @buz() +// CHECK: cir.func no_proto dso_local @buz() // CHECK: [[FNPTR_ALLOC:%.*]] = cir.alloca !cir.ptr>, !cir.ptr>>, ["func"] {alignment = 8 : i64} // CHECK: [[FNPTR:%.*]] = cir.load deref{{.*}} [[FNPTR_ALLOC]] : !cir.ptr>>, !cir.ptr> // CHECK: [[CAST:%.*]] = cir.cast(bitcast, %1 : !cir.ptr>), !cir.ptr> diff --git a/clang/test/CIR/CodeGen/no-proto-is-void.cpp b/clang/test/CIR/CodeGen/no-proto-is-void.cpp index 7ab958f8fd00..ca917b7f9088 100644 --- a/clang/test/CIR/CodeGen/no-proto-is-void.cpp +++ b/clang/test/CIR/CodeGen/no-proto-is-void.cpp @@ -5,7 +5,7 @@ // Both CXX and C2X don't support no-prototype functions. They default to void. int noProto(); -// CHECK: cir.func @{{.*}}noProto{{.*}}() -> !s32i +// CHECK: cir.func dso_local @{{.*}}noProto{{.*}}() -> !s32i int test(int x) { return noProto(); // CHECK {{.+}} = cir.call @{{.*}}noProto{{.*}}() : () -> !s32i diff --git a/clang/test/CIR/CodeGen/no-prototype.c b/clang/test/CIR/CodeGen/no-prototype.c index ad647de0f590..4be6a94c1212 100644 --- a/clang/test/CIR/CodeGen/no-prototype.c +++ b/clang/test/CIR/CodeGen/no-prototype.c @@ -7,9 +7,9 @@ // No-proto definition followed by a correct call. int noProto0(x) int x; { return x; } -// CHECK: cir.func no_proto @noProto0(%arg0: !s32i {{.+}}) -> !s32i +// CHECK: cir.func no_proto dso_local @noProto0(%arg0: !s32i {{.+}}) -> !s32i int test0(int x) { - // CHECK: cir.func @test0 + // CHECK: cir.func dso_local @test0 return noProto0(x); // We know the definition. Should be a direct call. // CHECK: %{{.+}} = cir.call @noProto0(%{{.+}}) } @@ -21,9 +21,9 @@ int test0(int x) { // definition is not marked as no-proto. int noProto1(); int noProto1(int x) { return x; } -// CHECK: cir.func @noProto1(%arg0: !s32i {{.+}}) -> !s32i +// CHECK: cir.func dso_local @noProto1(%arg0: !s32i {{.+}}) -> !s32i int test1(int x) { - // CHECK: cir.func @test1 + // CHECK: cir.func dso_local @test1 return noProto1(x); // CHECK: %{{.+}} = cir.call @noProto1(%{{[0-9]+}}) : (!s32i) -> !s32i } @@ -39,7 +39,7 @@ int test2(int x) { // CHECK: {{.*}} = cir.call [[GGO]](%{{[0-9]+}}) : (!cir.ptr !s32i>>, !s32i) -> !s32i } int noProto2(int x) { return x; } -// CHECK: cir.func no_proto @noProto2(%arg0: !s32i {{.+}}) -> !s32i +// CHECK: cir.func no_proto dso_local @noProto2(%arg0: !s32i {{.+}}) -> !s32i // No-proto declaration without definition (any call here is "correct"). // @@ -48,7 +48,7 @@ int noProto2(int x) { return x; } int noProto3(); // cir.func private no_proto @noProto3(...) -> !s32i int test3(int x) { -// CHECK: cir.func @test3 +// CHECK: cir.func dso_local @test3 return noProto3(x); // CHECK: [[GGO:%.*]] = cir.get_global @noProto3 : !cir.ptr !s32i>> // CHECK: [[CAST:%.*]] = cir.cast(bitcast, [[GGO]] : !cir.ptr !s32i>>), !cir.ptr !s32i>> @@ -81,4 +81,4 @@ int test5(int x) { // CHECK: {{%.*}} = cir.call [[CAST]]() : (!cir.ptr !s32i>>) -> !s32i } int noProto5(int x) { return x; } -// CHECK: cir.func no_proto @noProto5(%arg0: !s32i {{.+}}) -> !s32i +// CHECK: cir.func no_proto dso_local @noProto5(%arg0: !s32i {{.+}}) -> !s32i diff --git a/clang/test/CIR/CodeGen/nrvo.cpp b/clang/test/CIR/CodeGen/nrvo.cpp index 6eec9ca11f46..af9e178e2d13 100644 --- a/clang/test/CIR/CodeGen/nrvo.cpp +++ b/clang/test/CIR/CodeGen/nrvo.cpp @@ -11,7 +11,7 @@ std::vector test_nrvo() { // CHECK: ![[VEC:.*]] = !cir.record" {!cir.ptr>, !cir.ptr>, !cir.ptr>}> -// CHECK: cir.func @_Z9test_nrvov() -> ![[VEC]] +// CHECK: cir.func dso_local @_Z9test_nrvov() -> ![[VEC]] // CHECK: %0 = cir.alloca ![[VEC]], !cir.ptr, ["__retval", init] {alignment = 8 : i64} // CHECK: %1 = cir.alloca !cir.bool, !cir.ptr, ["nrvo"] {alignment = 1 : i64} // CHECK: %2 = cir.const #false diff --git a/clang/test/CIR/CodeGen/null-arithmatic-expression.c b/clang/test/CIR/CodeGen/null-arithmatic-expression.c index 62cde494fb58..a59a89e151f7 100644 --- a/clang/test/CIR/CodeGen/null-arithmatic-expression.c +++ b/clang/test/CIR/CodeGen/null-arithmatic-expression.c @@ -6,7 +6,7 @@ char *foo() { return (char*)NULL + 1; } -// CHECK: cir.func no_proto @foo() +// CHECK: cir.func no_proto dso_local @foo() // CHECK: [[CONST_1:%[0-9]+]] = cir.const #cir.int<1> : !s32i // CHECK: {{.*}} = cir.cast(int_to_ptr, [[CONST_1]] : !s32i) // CHECK: cir.return diff --git a/clang/test/CIR/CodeGen/nullptr-init.cpp b/clang/test/CIR/CodeGen/nullptr-init.cpp index 05602aef1a43..b4de1ee9b917 100644 --- a/clang/test/CIR/CodeGen/nullptr-init.cpp +++ b/clang/test/CIR/CodeGen/nullptr-init.cpp @@ -9,7 +9,7 @@ void t1() { int *p3 = (int*)0; } -// CIR: cir.func @_Z2t1v() +// CIR: cir.func dso_local @_Z2t1v() // CIR-NEXT: %[[P1:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["p1", init] {alignment = 8 : i64} // CIR-NEXT: %[[P2:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["p2", init] {alignment = 8 : i64} // CIR-NEXT: %[[P3:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["p3", init] {alignment = 8 : i64} @@ -45,7 +45,7 @@ int t2() { // casting it to the required type, but a redundant constant seems less // intrusive than a redundant bitcast. -// CIR: cir.func @_Z2t2v() +// CIR: cir.func dso_local @_Z2t2v() // CIR-NEXT: %[[RETVAL_ADDR:.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CIR-NEXT: %[[X:.*]] = cir.alloca !s32i, !cir.ptr, ["x", init] {alignment = 4 : i64} // CIR-NEXT: %[[P:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["p", init] {alignment = 8 : i64} diff --git a/clang/test/CIR/CodeGen/offsetof.c b/clang/test/CIR/CodeGen/offsetof.c index 5cd0d76ff46c..a549b0fcbc3a 100644 --- a/clang/test/CIR/CodeGen/offsetof.c +++ b/clang/test/CIR/CodeGen/offsetof.c @@ -12,8 +12,7 @@ void foo() { offsetof(A, b); } -// CHECK: cir.func no_proto @foo() +// CHECK: cir.func no_proto dso_local @foo() // CHECK: {{.*}} = cir.const #cir.int<0> : !u64i // CHECK: {{.*}} = cir.const #cir.int<4> : !u64i // CHECK: cir.return - diff --git a/clang/test/CIR/CodeGen/ofstream.cpp b/clang/test/CIR/CodeGen/ofstream.cpp index 286c3ef2a766..491334770157 100644 --- a/clang/test/CIR/CodeGen/ofstream.cpp +++ b/clang/test/CIR/CodeGen/ofstream.cpp @@ -25,7 +25,7 @@ void foo(const char *path) { fout2 << path; } -// CIR: cir.func @_Z3fooPKc +// CIR: cir.func dso_local @_Z3fooPKc // CIR: %[[V1:.*]] = cir.alloca !rec_std3A3Abasic_ofstream3Cchar3E, !cir.ptr, ["fout1", init] {alignment = 1 : i64} // CIR: %[[V2:.*]] = cir.alloca !rec_std3A3Abasic_ofstream3Cchar3E, !cir.ptr, ["fout2", init] {alignment = 1 : i64} // CIR: cir.try synthetic cleanup { diff --git a/clang/test/CIR/CodeGen/opaque.c b/clang/test/CIR/CodeGen/opaque.c index 00c11d7c65d1..e4dabafe51bd 100644 --- a/clang/test/CIR/CodeGen/opaque.c +++ b/clang/test/CIR/CodeGen/opaque.c @@ -5,8 +5,8 @@ int foo(int x, short y) { return x ?: y; } -// CHECK: cir.func @foo +// CHECK: cir.func dso_local @foo // CHECK: %[[Load:.*]] = cir.load // CHECK: %[[Bool:.*]] = cir.cast(int_to_bool, %[[Load]] : !s32i), !cir.bool loc(#loc8) // CHECK: = cir.ternary(%[[Bool]], true { -// CHECK: cir.yield %[[Load]] \ No newline at end of file +// CHECK: cir.yield %[[Load]] diff --git a/clang/test/CIR/CodeGen/optnone.cpp b/clang/test/CIR/CodeGen/optnone.cpp index 1dbb7892a5ad..0dcf6497f4d1 100644 --- a/clang/test/CIR/CodeGen/optnone.cpp +++ b/clang/test/CIR/CodeGen/optnone.cpp @@ -18,7 +18,7 @@ int s0(int a, int b) { } // CIR-O0: #fn_attr = #cir, nothrow = #cir.nothrow, optnone = #cir.optnone})> -// CIR-O0: cir.func @_Z2s0ii(%arg0:{{.*}}, %arg1:{{.*}} -> {{.*}} extra(#fn_attr) +// CIR-O0: cir.func dso_local @_Z2s0ii(%arg0:{{.*}}, %arg1:{{.*}} -> {{.*}} extra(#fn_attr) // CIR-O2-NOT: #fn_attr ={{.*}} optnone diff --git a/clang/test/CIR/CodeGen/pass-object-size.c b/clang/test/CIR/CodeGen/pass-object-size.c index 798912c32b00..d0031555c202 100644 --- a/clang/test/CIR/CodeGen/pass-object-size.c +++ b/clang/test/CIR/CodeGen/pass-object-size.c @@ -12,7 +12,7 @@ void c() { e(d); } -// CIR: cir.func no_proto @c() +// CIR: cir.func no_proto dso_local @c() // CIR: [[TMP0:%.*]] = cir.alloca !s32i, !cir.ptr, %{{[0-9]+}} : !u64i, ["vla"] {alignment = 16 : i64} // CIR: [[TMP1:%.*]] = cir.cast(bitcast, [[TMP0]] : !cir.ptr), !cir.ptr // CIR-NEXT: [[TMP2:%.*]] = cir.objsize([[TMP1]] : , max) -> !u64i diff --git a/clang/test/CIR/CodeGen/pointer-to-data-member.cpp b/clang/test/CIR/CodeGen/pointer-to-data-member.cpp index 72cf4015fcf7..b753ccfb4160 100644 --- a/clang/test/CIR/CodeGen/pointer-to-data-member.cpp +++ b/clang/test/CIR/CodeGen/pointer-to-data-member.cpp @@ -17,46 +17,46 @@ int Point::*pt_member = &Point::x; auto test1() -> int Point::* { return &Point::y; } -// CHECK: cir.func @_Z5test1v() -> !cir.data_member +// CHECK: cir.func dso_local @_Z5test1v() -> !cir.data_member // CHECK: %{{.+}} = cir.const #cir.data_member<1> : !cir.data_member // CHECK: } int test2(const Point &pt, int Point::*member) { return pt.*member; } -// CHECK: cir.func @_Z5test2RK5PointMS_i +// CHECK: cir.func dso_local @_Z5test2RK5PointMS_i // CHECK: %{{.+}} = cir.get_runtime_member %{{.+}}[%{{.+}} : !cir.data_member] : !cir.ptr -> !cir.ptr // CHECK: } int test3(const Point *pt, int Point::*member) { return pt->*member; } -// CHECK: cir.func @_Z5test3PK5PointMS_i +// CHECK: cir.func dso_local @_Z5test3PK5PointMS_i // CHECK: %{{.+}} = cir.get_runtime_member %{{.+}}[%{{.+}} : !cir.data_member] : !cir.ptr -> !cir.ptr // CHECK: } auto test4(int Incomplete::*member) -> int Incomplete::* { return member; } -// CHECK: cir.func @_Z5test4M10Incompletei(%arg0: !cir.data_member loc({{.+}})) -> !cir.data_member +// CHECK: cir.func dso_local @_Z5test4M10Incompletei(%arg0: !cir.data_member loc({{.+}})) -> !cir.data_member int test5(Incomplete *ic, int Incomplete::*member) { return ic->*member; } -// CHECK: cir.func @_Z5test5P10IncompleteMS_i +// CHECK: cir.func dso_local @_Z5test5P10IncompleteMS_i // CHECK: %{{.+}} = cir.get_runtime_member %{{.+}}[%{{.+}} : !cir.data_member] : !cir.ptr -> !cir.ptr // CHECK: } auto test_null() -> int Point::* { return nullptr; } -// CHECK: cir.func @_Z9test_nullv +// CHECK: cir.func dso_local @_Z9test_nullv // CHECK: %{{.+}} = cir.const #cir.data_member : !cir.data_member // CHECK: } auto test_null_incomplete() -> int Incomplete::* { return nullptr; } -// CHECK: cir.func @_Z20test_null_incompletev +// CHECK: cir.func dso_local @_Z20test_null_incompletev // CHECK: %{{.+}} = cir.const #cir.data_member : !cir.data_member // CHECK: } diff --git a/clang/test/CIR/CodeGen/pointer-to-member-func.cpp b/clang/test/CIR/CodeGen/pointer-to-member-func.cpp index 80105aa5c227..458b850285a6 100644 --- a/clang/test/CIR/CodeGen/pointer-to-member-func.cpp +++ b/clang/test/CIR/CodeGen/pointer-to-member-func.cpp @@ -13,7 +13,7 @@ auto make_non_virtual() -> void (Foo::*)(int) { return &Foo::m1; } -// CHECK-LABEL: cir.func @_Z16make_non_virtualv() -> !cir.method in !rec_Foo> +// CHECK-LABEL: cir.func dso_local @_Z16make_non_virtualv() -> !cir.method in !rec_Foo> // CHECK: %{{.+}} = cir.const #cir.method<@_ZN3Foo2m1Ei> : !cir.method in !rec_Foo> // CHECK: } @@ -25,7 +25,7 @@ auto make_virtual() -> void (Foo::*)(int) { return &Foo::m3; } -// CHECK-LABEL: cir.func @_Z12make_virtualv() -> !cir.method in !rec_Foo> +// CHECK-LABEL: cir.func dso_local @_Z12make_virtualv() -> !cir.method in !rec_Foo> // CHECK: %{{.+}} = cir.const #cir.method : !cir.method in !rec_Foo> // CHECK: } @@ -37,7 +37,7 @@ auto make_null() -> void (Foo::*)(int) { return nullptr; } -// CHECK-LABEL: cir.func @_Z9make_nullv() -> !cir.method in !rec_Foo> +// CHECK-LABEL: cir.func dso_local @_Z9make_nullv() -> !cir.method in !rec_Foo> // CHECK: %{{.+}} = cir.const #cir.method : !cir.method in !rec_Foo> // CHECK: } @@ -49,7 +49,7 @@ void call(Foo *obj, void (Foo::*func)(int), int arg) { (obj->*func)(arg); } -// CHECK-LABEL: cir.func @_Z4callP3FooMS_FviEi +// CHECK-LABEL: cir.func dso_local @_Z4callP3FooMS_FviEi // CHECK: %[[CALLEE:.+]], %[[THIS:.+]] = cir.get_method %{{.+}}, %{{.+}} : (!cir.method in !rec_Foo>, !cir.ptr) -> (!cir.ptr, !s32i)>>, !cir.ptr) // CHECK-NEXT: %[[#ARG:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !s32i // CHECK-NEXT: cir.call %[[CALLEE]](%[[THIS]], %[[#ARG]]) : (!cir.ptr, !s32i)>>, !cir.ptr, !s32i) -> () diff --git a/clang/test/CIR/CodeGen/pred-info-builtins.c b/clang/test/CIR/CodeGen/pred-info-builtins.c index 263274890e34..ccc203764cef 100644 --- a/clang/test/CIR/CodeGen/pred-info-builtins.c +++ b/clang/test/CIR/CodeGen/pred-info-builtins.c @@ -7,11 +7,11 @@ void expect(int x) { if (__builtin_expect(x, 0)) bar(); } -// CIR-O0: cir.func @expect +// CIR-O0: cir.func dso_local @expect // CIR-O0: cir.if {{%.*}} { // CIR-O0: cir.call @bar() : () -> () -// CIR-O2: cir.func @expect +// CIR-O2: cir.func dso_local @expect // CIR-O2: [[EXPECT:%.*]] = cir.expect({{.*}}, {{.*}}) : !s64i // CIR-O2: [[EXPECT_BOOL:%.*]] = cir.cast(int_to_bool, [[EXPECT]] : !s64i), !cir.bool // CIR-O2: cir.if [[EXPECT_BOOL]] @@ -21,11 +21,11 @@ void expect_with_probability(int x) { if (__builtin_expect_with_probability(x, 1, 0.8)) bar(); } -// CIR-O0: cir.func @expect_with_probability +// CIR-O0: cir.func dso_local @expect_with_probability // CIR-O0: cir.if {{%.*}} { // CIR-O0: cir.call @bar() : () -> () -// CIR-O2: cir.func @expect_with_probability +// CIR-O2: cir.func dso_local @expect_with_probability // CIR-O2: [[EXPECT:%.*]] = cir.expect({{.*}}, {{.*}}, 8.000000e-01) : !s64i // CIR-O2: [[EXPECT_BOOL:%.*]] = cir.cast(int_to_bool, [[EXPECT]] : !s64i), !cir.bool // CIR-O2: cir.if [[EXPECT_BOOL]] @@ -34,7 +34,7 @@ void expect_with_probability(int x) { void unpredictable(int x) { if (__builtin_unpredictable(x > 1)) bar(); -// CIR-O0: cir.func @unpredictable +// CIR-O0: cir.func dso_local @unpredictable // CIR-O0: cir.if {{%.*}} { // CIR-O0: cir.call @bar() : () -> () } diff --git a/clang/test/CIR/CodeGen/predefined.cpp b/clang/test/CIR/CodeGen/predefined.cpp index 08cafd4cbb29..f02e99aed3a5 100644 --- a/clang/test/CIR/CodeGen/predefined.cpp +++ b/clang/test/CIR/CodeGen/predefined.cpp @@ -9,7 +9,7 @@ void m() { __assert2("yo.cpp", 79, __PRETTY_FUNCTION__, "doom"); } -// CHECK: cir.func @_Z1mv() +// CHECK: cir.func dso_local @_Z1mv() // CHECK: %0 = cir.get_global @".str" : !cir.ptr> // CHECK: %1 = cir.cast(array_to_ptrdecay, %0 : !cir.ptr>), !cir.ptr // CHECK: %2 = cir.const #cir.int<79> : !s32i diff --git a/clang/test/CIR/CodeGen/ptrdiff.cpp b/clang/test/CIR/CodeGen/ptrdiff.cpp index 6c30fb01660d..bb058c822323 100644 --- a/clang/test/CIR/CodeGen/ptrdiff.cpp +++ b/clang/test/CIR/CodeGen/ptrdiff.cpp @@ -6,7 +6,7 @@ size_type size(unsigned long *_start, unsigned long *_finish) { return static_cast(_finish - _start); } -// CHECK: cir.func @_Z4sizePmS_(%arg0: !cir.ptr +// CHECK: cir.func dso_local @_Z4sizePmS_(%arg0: !cir.ptr // CHECK: %3 = cir.load{{.*}} %1 : !cir.ptr>, !cir.ptr // CHECK: %4 = cir.load{{.*}} %0 : !cir.ptr>, !cir.ptr // CHECK: %5 = cir.ptr_diff(%3, %4) : !cir.ptr -> !s64i @@ -16,9 +16,8 @@ long add(char *a, char *b) { return a - b + 1; } -// CHECK: cir.func @_Z3addPcS_(%arg0: !cir.ptr +// CHECK: cir.func dso_local @_Z3addPcS_(%arg0: !cir.ptr // %5 = cir.ptr_diff(%3, %4) : !cir.ptr -> !s64i // %6 = cir.const #cir.int<1> : !s32i // %7 = cir.cast(integral, %6 : !s32i), !s64i // %8 = cir.binop(add, %5, %7) : !s64i - diff --git a/clang/test/CIR/CodeGen/rangefor.cpp b/clang/test/CIR/CodeGen/rangefor.cpp index 5bd92c00f413..4875bd798455 100644 --- a/clang/test/CIR/CodeGen/rangefor.cpp +++ b/clang/test/CIR/CodeGen/rangefor.cpp @@ -25,7 +25,7 @@ void init(unsigned numImages) { // CHECK-DAG: ![[VEC:.*]] = !cir.record" {!cir.ptr, !cir.ptr, !cir.ptr}> // CHECK-DAG: ![[VEC_IT:.*]] = !cir.record" {!cir.ptr}> -// CHECK: cir.func @_Z4initj(%arg0: !u32i +// CHECK: cir.func dso_local @_Z4initj(%arg0: !u32i // CHECK: %0 = cir.alloca !u32i, !cir.ptr, ["numImages", init] {alignment = 4 : i64} // CHECK: %1 = cir.alloca ![[VEC]], !cir.ptr, ["images", init] {alignment = 8 : i64} // CHECK: cir.store{{.*}} %arg0, %0 : !u32i, !cir.ptr diff --git a/clang/test/CIR/CodeGen/return.cpp b/clang/test/CIR/CodeGen/return.cpp index 0fa36c3a95ac..e77dd5e1ac04 100644 --- a/clang/test/CIR/CodeGen/return.cpp +++ b/clang/test/CIR/CodeGen/return.cpp @@ -1,10 +1,10 @@ // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - | FileCheck %s -int &ret0(int &x) { +int &ret0(int &x) { return x; } -// CHECK: cir.func @_Z4ret0Ri +// CHECK: cir.func dso_local @_Z4ret0Ri // CHECK: %0 = cir.alloca !cir.ptr, !cir.ptr>, ["x", init, const] {alignment = 8 : i64} // CHECK: %1 = cir.alloca !cir.ptr, !cir.ptr>, ["__retval"] {alignment = 8 : i64} // CHECK: cir.store{{.*}} %arg0, %0 : !cir.ptr, !cir.ptr> @@ -18,7 +18,7 @@ int unreachable_after_return() { return 1; } -// CHECK: cir.func @_Z24unreachable_after_returnv +// CHECK: cir.func dso_local @_Z24unreachable_after_returnv // CHECK-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CHECK-NEXT: %1 = cir.const #cir.int<0> : !s32i // CHECK-NEXT: cir.store{{.*}} %1, %0 : !s32i, !cir.ptr diff --git a/clang/test/CIR/CodeGen/same-mangled-name.cpp b/clang/test/CIR/CodeGen/same-mangled-name.cpp index fe6255cd3640..f79d5bb4c321 100644 --- a/clang/test/CIR/CodeGen/same-mangled-name.cpp +++ b/clang/test/CIR/CodeGen/same-mangled-name.cpp @@ -9,7 +9,7 @@ struct S { void foo() {} }; -// CHECK: cir.func @_ZN1N1fEv() {{.*}} { +// CHECK: cir.func dso_local @_ZN1N1fEv() {{.*}} { // CHECK: cir.call @_ZN1N1S3fooEv( void f() { S().foo(); } } // namespace N diff --git a/clang/test/CIR/CodeGen/skip-functions-from-system-headers.cpp b/clang/test/CIR/CodeGen/skip-functions-from-system-headers.cpp index fc2a7433fb0c..94c65654a410 100644 --- a/clang/test/CIR/CodeGen/skip-functions-from-system-headers.cpp +++ b/clang/test/CIR/CodeGen/skip-functions-from-system-headers.cpp @@ -14,5 +14,5 @@ void test() { // CHECK-NOT: cir.func linkonce_odr @_ZN6StringC2EPKc // CHECK-NOT: cir.func linkonce_odr @_ZN6StringC1EPKc -// CHECK: cir.func @_Z4testv() +// CHECK: cir.func dso_local @_Z4testv() // CHECK: cir.call @_ZN6StringC1Ev(%0) : (!cir.ptr) -> () diff --git a/clang/test/CIR/CodeGen/sourcelocation.cpp b/clang/test/CIR/CodeGen/sourcelocation.cpp index 879d59255dea..ef8487967e06 100644 --- a/clang/test/CIR/CodeGen/sourcelocation.cpp +++ b/clang/test/CIR/CodeGen/sourcelocation.cpp @@ -19,7 +19,7 @@ int s0(int a, int b) { // CIR: #loc21 = loc(fused[#loc3, #loc4]) // CIR: #loc22 = loc(fused[#loc5, #loc6]) // CIR: module @"{{.*}}sourcelocation.cpp" attributes {{{.*}}cir.lang = #cir.lang, {{.*}}cir.sob = #cir.signed_overflow_behavior -// CIR: cir.func @_Z2s0ii(%arg0: !s32i loc(fused[#loc3, #loc4]), %arg1: !s32i loc(fused[#loc5, #loc6])) -> !s32i +// CIR: cir.func dso_local @_Z2s0ii(%arg0: !s32i loc(fused[#loc3, #loc4]), %arg1: !s32i loc(fused[#loc5, #loc6])) -> !s32i // CIR: %0 = cir.alloca !s32i, !cir.ptr, ["a", init] {alignment = 4 : i64} loc(#loc21) // CIR: %1 = cir.alloca !s32i, !cir.ptr, ["b", init] {alignment = 4 : i64} loc(#loc22) // CIR: %2 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} loc(#loc2) diff --git a/clang/test/CIR/CodeGen/static-vars.c b/clang/test/CIR/CodeGen/static-vars.c index 71a65839375d..edd168810af5 100644 --- a/clang/test/CIR/CodeGen/static-vars.c +++ b/clang/test/CIR/CodeGen/static-vars.c @@ -4,20 +4,20 @@ void func1(void) { // Should lower default-initialized static vars. static int i; - // CHECK-DAG: cir.global "private" internal dsolocal @func1.i = #cir.int<0> : !s32i + // CHECK-DAG: cir.global "private" internal dso_local @func1.i = #cir.int<0> : !s32i // Should lower constant-initialized static vars. static int j = 1; - // CHECK-DAG: cir.global "private" internal dsolocal @func1.j = #cir.int<1> : !s32i + // CHECK-DAG: cir.global "private" internal dso_local @func1.j = #cir.int<1> : !s32i // Should properly shadow static vars in nested scopes. { static int j = 2; - // CHECK-DAG: cir.global "private" internal dsolocal @func1.j.1 = #cir.int<2> : !s32i + // CHECK-DAG: cir.global "private" internal dso_local @func1.j.1 = #cir.int<2> : !s32i } { static int j = 3; - // CHECK-DAG: cir.global "private" internal dsolocal @func1.j.2 = #cir.int<3> : !s32i + // CHECK-DAG: cir.global "private" internal dso_local @func1.j.2 = #cir.int<3> : !s32i } // Should lower basic static vars arithmetics. @@ -31,20 +31,20 @@ void func1(void) { // Should shadow static vars on different functions. void func2(void) { static char i; - // CHECK-DAG: cir.global "private" internal dsolocal @func2.i = #cir.int<0> : !s8i + // CHECK-DAG: cir.global "private" internal dso_local @func2.i = #cir.int<0> : !s8i static float j; - // CHECK-DAG: cir.global "private" internal dsolocal @func2.j = #cir.fp<0.000000e+00> : !cir.float + // CHECK-DAG: cir.global "private" internal dso_local @func2.j = #cir.fp<0.000000e+00> : !cir.float } // Should const initialize static vars with constant addresses. void func3(void) { static int var; static int *constAddr = &var; - // CHECK-DAG: cir.global "private" internal dsolocal @func3.constAddr = #cir.global_view<@func3.var> : !cir.ptr + // CHECK-DAG: cir.global "private" internal dso_local @func3.constAddr = #cir.global_view<@func3.var> : !cir.ptr } // Should match type size in bytes between var and initializer. void func4(void) { static char string[] = "Hello"; - // CHECK-DAG: cir.global "private" internal dsolocal @func4.string = #cir.const_array<"Hello\00" : !cir.array> : !cir.array + // CHECK-DAG: cir.global "private" internal dso_local @func4.string = #cir.const_array<"Hello\00" : !cir.array> : !cir.array } diff --git a/clang/test/CIR/CodeGen/static-vars.cpp b/clang/test/CIR/CodeGen/static-vars.cpp index 2edaef716596..d949936f6bff 100644 --- a/clang/test/CIR/CodeGen/static-vars.cpp +++ b/clang/test/CIR/CodeGen/static-vars.cpp @@ -1,25 +1,25 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir // RUN: FileCheck --input-file=%t.cir %s // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t1.ll -// RUN: FileCheck --check-prefix=LLVM --input-file=%t1.ll %s +// RUN: FileCheck --check-prefix=LLVM --input-file=%t1.ll %s void func1(void) { // Should lower default-initialized static vars. static int i; - // CHECK-DAG: cir.global "private" internal dsolocal @_ZZ5func1vE1i = #cir.int<0> : !s32i + // CHECK-DAG: cir.global "private" internal dso_local @_ZZ5func1vE1i = #cir.int<0> : !s32i // Should lower constant-initialized static vars. static int j = 1; - // CHECK-DAG: cir.global "private" internal dsolocal @_ZZ5func1vE1j = #cir.int<1> : !s32i + // CHECK-DAG: cir.global "private" internal dso_local @_ZZ5func1vE1j = #cir.int<1> : !s32i // Should properly shadow static vars in nested scopes. { static int j = 2; - // CHECK-DAG: cir.global "private" internal dsolocal @_ZZ5func1vE1j_0 = #cir.int<2> : !s32i + // CHECK-DAG: cir.global "private" internal dso_local @_ZZ5func1vE1j_0 = #cir.int<2> : !s32i } { static int j = 3; - // CHECK-DAG: cir.global "private" internal dsolocal @_ZZ5func1vE1j_1 = #cir.int<3> : !s32i + // CHECK-DAG: cir.global "private" internal dso_local @_ZZ5func1vE1j_1 = #cir.int<3> : !s32i } // Should lower basic static vars arithmetics. @@ -33,9 +33,9 @@ void func1(void) { // Should shadow static vars on different functions. void func2(void) { static char i; - // CHECK-DAG: cir.global "private" internal dsolocal @_ZZ5func2vE1i = #cir.int<0> : !s8i + // CHECK-DAG: cir.global "private" internal dso_local @_ZZ5func2vE1i = #cir.int<0> : !s8i static float j; - // CHECK-DAG: cir.global "private" internal dsolocal @_ZZ5func2vE1j = #cir.fp<0.000000e+00> : !cir.float + // CHECK-DAG: cir.global "private" internal dso_local @_ZZ5func2vE1j = #cir.fp<0.000000e+00> : !cir.float } // CHECK-DAG: cir.global linkonce_odr comdat @_ZZ4testvE1c = #cir.int<0> : !s32i diff --git a/clang/test/CIR/CodeGen/static.cpp b/clang/test/CIR/CodeGen/static.cpp index 1dc07df2c1ea..1f9e839dee8c 100644 --- a/clang/test/CIR/CodeGen/static.cpp +++ b/clang/test/CIR/CodeGen/static.cpp @@ -19,7 +19,7 @@ static Init __ioinit2(false); // BEFORE: module {{.*}} { // BEFORE-NEXT: cir.func private @_ZN4InitC1Eb(!cir.ptr, !cir.bool) // BEFORE-NEXT: cir.func private @_ZN4InitD1Ev(!cir.ptr) -// BEFORE-NEXT: cir.global "private" internal dsolocal @_ZL8__ioinit = ctor : !rec_Init { +// BEFORE-NEXT: cir.global "private" internal dso_local @_ZL8__ioinit = ctor : !rec_Init { // BEFORE-NEXT: %0 = cir.get_global @_ZL8__ioinit : !cir.ptr // BEFORE-NEXT: %1 = cir.const #true // BEFORE-NEXT: cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !cir.bool) -> () @@ -27,7 +27,7 @@ static Init __ioinit2(false); // BEFORE-NEXT: %0 = cir.get_global @_ZL8__ioinit : !cir.ptr // BEFORE-NEXT: cir.call @_ZN4InitD1Ev(%0) : (!cir.ptr) -> () // BEFORE-NEXT: } {alignment = 1 : i64, ast = #cir.var.decl.ast} -// BEFORE: cir.global "private" internal dsolocal @_ZL9__ioinit2 = ctor : !rec_Init { +// BEFORE: cir.global "private" internal dso_local @_ZL9__ioinit2 = ctor : !rec_Init { // BEFORE-NEXT: %0 = cir.get_global @_ZL9__ioinit2 : !cir.ptr // BEFORE-NEXT: %1 = cir.const #false // BEFORE-NEXT: cir.call @_ZN4InitC1Eb(%0, %1) : (!cir.ptr, !cir.bool) -> () @@ -43,7 +43,7 @@ static Init __ioinit2(false); // AFTER-NEXT: cir.func private @__cxa_atexit(!cir.ptr)>>, !cir.ptr, !cir.ptr) // AFTER-NEXT: cir.func private @_ZN4InitC1Eb(!cir.ptr, !cir.bool) // AFTER-NEXT: cir.func private @_ZN4InitD1Ev(!cir.ptr) -// AFTER-NEXT: cir.global "private" internal dsolocal @_ZL8__ioinit = #cir.zero : !rec_Init {alignment = 1 : i64, ast = #cir.var.decl.ast} +// AFTER-NEXT: cir.global "private" internal dso_local @_ZL8__ioinit = #cir.zero : !rec_Init {alignment = 1 : i64, ast = #cir.var.decl.ast} // AFTER-NEXT: cir.func internal private @__cxx_global_var_init() // AFTER-NEXT: %0 = cir.get_global @_ZL8__ioinit : !cir.ptr // AFTER-NEXT: %1 = cir.const #true @@ -55,7 +55,7 @@ static Init __ioinit2(false); // AFTER-NEXT: %6 = cir.get_global @__dso_handle : !cir.ptr // AFTER-NEXT: cir.call @__cxa_atexit(%4, %5, %6) : (!cir.ptr)>>, !cir.ptr, !cir.ptr) -> () // AFTER-NEXT: cir.return -// AFTER: cir.global "private" internal dsolocal @_ZL9__ioinit2 = #cir.zero : !rec_Init {alignment = 1 : i64, ast = #cir.var.decl.ast} +// AFTER: cir.global "private" internal dso_local @_ZL9__ioinit2 = #cir.zero : !rec_Init {alignment = 1 : i64, ast = #cir.var.decl.ast} // AFTER-NEXT: cir.func internal private @__cxx_global_var_init.1() // AFTER-NEXT: %0 = cir.get_global @_ZL9__ioinit2 : !cir.ptr // AFTER-NEXT: %1 = cir.const #false diff --git a/clang/test/CIR/CodeGen/std-find.cpp b/clang/test/CIR/CodeGen/std-find.cpp index b6a56158fbe4..58731d6bcb0f 100644 --- a/clang/test/CIR/CodeGen/std-find.cpp +++ b/clang/test/CIR/CodeGen/std-find.cpp @@ -7,7 +7,7 @@ int test_find(unsigned char n = 3) { - // CHECK: cir.func @_Z9test_findh(%arg0: !u8i + // CHECK: cir.func dso_local @_Z9test_findh(%arg0: !u8i unsigned num_found = 0; std::array v = {1, 2, 3, 4, 5, 6, 7, 8, 9}; // CHECK: %[[array_addr:.*]] = cir.alloca ![[array]], !cir.ptr, ["v"] diff --git a/clang/test/CIR/CodeGen/stmtexpr-init.c b/clang/test/CIR/CodeGen/stmtexpr-init.c index 2b469eb12b49..ede776daadd6 100644 --- a/clang/test/CIR/CodeGen/stmtexpr-init.c +++ b/clang/test/CIR/CodeGen/stmtexpr-init.c @@ -8,7 +8,7 @@ void escape(const void *); -// CIR-DAG: cir.global "private" internal dsolocal @T1._x = #cir.int<99> : !s8i +// CIR-DAG: cir.global "private" internal dso_local @T1._x = #cir.int<99> : !s8i // LLVM-DAG: internal global i8 99 void T1(void) { @@ -33,11 +33,11 @@ struct outer { }; void T2(void) { - // CIR-DAG: cir.global "private" constant internal dsolocal @T2._a = #cir.const_record<{#cir.int<2> : !s32i, #cir.const_array<[#cir.int<50> : !s32i, #cir.int<60> : !s32i]> : !cir.array}> + // CIR-DAG: cir.global "private" constant internal dso_local @T2._a = #cir.const_record<{#cir.int<2> : !s32i, #cir.const_array<[#cir.int<50> : !s32i, #cir.int<60> : !s32i]> : !cir.array}> // LLVM-DAG: internal constant { i32, [2 x i32] } { i32 2, [2 x i32] [i32 50, i32 60] } const struct sized_array *A = ARRAY_PTR(50, 60); - // CIR-DAG: cir.global "private" constant internal dsolocal @T2._a.1 = #cir.const_record<{#cir.int<3> : !s32i, #cir.const_array<[#cir.int<10> : !s32i, #cir.int<20> : !s32i, #cir.int<30> : !s32i]> : !cir.array}> + // CIR-DAG: cir.global "private" constant internal dso_local @T2._a.1 = #cir.const_record<{#cir.int<3> : !s32i, #cir.const_array<[#cir.int<10> : !s32i, #cir.int<20> : !s32i, #cir.int<30> : !s32i]> : !cir.array}> // LLVM-DAG: internal constant { i32, [3 x i32] } { i32 3, [3 x i32] [i32 10, i32 20, i32 30] } struct outer X = {ARRAY_PTR(10, 20, 30)}; diff --git a/clang/test/CIR/CodeGen/store.c b/clang/test/CIR/CodeGen/store.c index 3eb7ce66a388..7bf64773396f 100644 --- a/clang/test/CIR/CodeGen/store.c +++ b/clang/test/CIR/CodeGen/store.c @@ -6,7 +6,7 @@ void foo(void) { a = 1; } -// CHECK: cir.func @foo() +// CHECK: cir.func dso_local @foo() // CHECK-NEXT: %0 = cir.alloca !s32i, !cir.ptr, ["a", init] {alignment = 4 : i64} // CHECK-NEXT: %1 = cir.const #cir.int<0> : !s32i // CHECK-NEXT: cir.store{{.*}} %1, %0 : !s32i, !cir.ptr @@ -27,4 +27,3 @@ void storeNoArgsFn() { // CHECK: %1 = cir.get_global @get42 : !cir.ptr !s32i>> // CHECK: %2 = cir.cast(bitcast, %1 : !cir.ptr !s32i>>), !cir.ptr !s32i>> // CHECK: cir.store{{.*}} %2, %0 : !cir.ptr !s32i>>, !cir.ptr !s32i>>> - diff --git a/clang/test/CIR/CodeGen/struct.c b/clang/test/CIR/CodeGen/struct.c index 16013b640fea..fd223abb2e27 100644 --- a/clang/test/CIR/CodeGen/struct.c +++ b/clang/test/CIR/CodeGen/struct.c @@ -28,14 +28,14 @@ void baz(void) { // CHECK-DAG: !rec_SLocal = !cir.record // CHECK-DAG: !rec_SLocal2E0 = !cir.record // CHECK-DAG: module {{.*}} { - // CHECK: cir.func @baz() + // CHECK: cir.func dso_local @baz() // CHECK-NEXT: %0 = cir.alloca !rec_Bar, !cir.ptr, ["b"] {alignment = 4 : i64} // CHECK-NEXT: %1 = cir.alloca !rec_Foo, !cir.ptr, ["f"] {alignment = 4 : i64} // CHECK-NEXT: cir.return // CHECK-NEXT: } void shouldConstInitStructs(void) { -// CHECK: cir.func @shouldConstInitStructs +// CHECK: cir.func dso_local @shouldConstInitStructs struct Foo f = {1, 2, {3, 4}}; // CHECK: %[[#V0:]] = cir.alloca !rec_Foo, !cir.ptr, ["f"] {alignment = 4 : i64} // CHECK: %[[#V1:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr), !cir.ptr @@ -76,7 +76,7 @@ struct S3 { // CHECK-DAG: cir.global external @s3 = #cir.const_array<[#cir.const_record<{#cir.int<1> : !s32i}> : !rec_S3, #cir.const_record<{#cir.int<2> : !s32i}> : !rec_S3, #cir.const_record<{#cir.int<3> : !s32i}> : !rec_S3]> : !cir.array void shouldCopyStructAsCallArg(struct S1 s) { -// CHECK-DAG: cir.func @shouldCopyStructAsCallArg +// CHECK-DAG: cir.func dso_local @shouldCopyStructAsCallArg shouldCopyStructAsCallArg(s); // CHECK-DAG: %[[#LV:]] = cir.load{{.*}} %{{.+}} : !cir.ptr, !rec_S1 // CHECK-DAG: cir.call @shouldCopyStructAsCallArg(%[[#LV]]) : (!rec_S1) -> () @@ -86,13 +86,13 @@ struct Bar shouldGenerateAndAccessStructArrays(void) { struct Bar s[1] = {{3, 4}}; return s[0]; } -// CHECK-DAG: cir.func @shouldGenerateAndAccessStructArrays +// CHECK-DAG: cir.func dso_local @shouldGenerateAndAccessStructArrays // CHECK-DAG: %[[#STRIDE:]] = cir.const #cir.int<0> : !s32i // CHECK-DAG: %[[#DARR:]] = cir.cast(array_to_ptrdecay, %{{.+}} : !cir.ptr>), !cir.ptr // CHECK-DAG: %[[#ELT:]] = cir.ptr_stride(%[[#DARR]] : !cir.ptr, %[[#STRIDE]] : !s32i), !cir.ptr // CHECK-DAG: cir.copy %[[#ELT]] to %{{.+}} : !cir.ptr -// CHECK-DAG: cir.func @local_decl +// CHECK-DAG: cir.func dso_local @local_decl // CHECK-DAG: {{%.}} = cir.alloca !rec_Local, !cir.ptr, ["a"] void local_decl(void) { struct Local { @@ -101,7 +101,7 @@ void local_decl(void) { struct Local a; } -// CHECK-DAG: cir.func @useRecursiveType +// CHECK-DAG: cir.func dso_local @useRecursiveType // CHECK-DAG: cir.get_member {{%.}}[0] {name = "next"} : !cir.ptr -> !cir.ptr> void useRecursiveType(NodeStru* a) { a->next = 0; @@ -116,5 +116,5 @@ void local_structs(int a, float b) { { struct SLocal { float y; }; struct SLocal loc = {b}; - } + } } diff --git a/clang/test/CIR/CodeGen/struct.cpp b/clang/test/CIR/CodeGen/struct.cpp index f150eb1c1e82..3173ed009298 100644 --- a/clang/test/CIR/CodeGen/struct.cpp +++ b/clang/test/CIR/CodeGen/struct.cpp @@ -63,7 +63,7 @@ void yoyo(incomplete *i) {} // CHECK-NEXT: cir.return %5 // CHECK-NEXT: } -// CHECK: cir.func @_Z3bazv() +// CHECK: cir.func dso_local @_Z3bazv() // CHECK-NEXT: %0 = cir.alloca !rec_Bar, !cir.ptr, ["b"] {alignment = 4 : i64} // CHECK-NEXT: %1 = cir.alloca !s32i, !cir.ptr, ["result", init] {alignment = 4 : i64} // CHECK-NEXT: %2 = cir.alloca !rec_Foo, !cir.ptr, ["f"] {alignment = 4 : i64} @@ -148,7 +148,7 @@ struct S { void h() { S s; } -// CHECK: cir.func @_Z1hv() +// CHECK: cir.func dso_local @_Z1hv() // CHECK: %0 = cir.alloca !rec_S, !cir.ptr, ["s", init] {alignment = 1 : i64} // CHECK: %1 = cir.alloca !rec_A, !cir.ptr, ["agg.tmp0"] {alignment = 4 : i64} // CHECK: %2 = cir.call @_Z11get_defaultv() : () -> !rec_A diff --git a/clang/test/CIR/CodeGen/switch-gnurange.cpp b/clang/test/CIR/CodeGen/switch-gnurange.cpp index b6f03cb6d4b0..d453361e873a 100644 --- a/clang/test/CIR/CodeGen/switch-gnurange.cpp +++ b/clang/test/CIR/CodeGen/switch-gnurange.cpp @@ -8,18 +8,18 @@ enum letter { }; int sw1(enum letter c) { - switch (c) { + switch (c) { case A ... C: case D: case E ... F: case G ... L: return 1; - default: + default: return 0; } } -// CIR: cir.func @_Z3sw16letter +// CIR: cir.func dso_local @_Z3sw16letter // CIR: cir.scope { // CIR: cir.switch // CIR-NEXT: cir.case(range, [#cir.int<0> : !s32i, #cir.int<2> : !s32i]) { @@ -27,7 +27,7 @@ int sw1(enum letter c) { // CIR-NEXT: cir.case(range, [#cir.int<4> : !s32i, #cir.int<5> : !s32i]) { // CIR-NEXT: cir.case(range, [#cir.int<6> : !s32i, #cir.int<10> : !s32i]) { // CIR: cir.int<1> -// CIR: cir.return +// CIR: cir.return // CIR: cir.yield // CIR: cir.yield // CIR: cir.yield @@ -64,16 +64,16 @@ int sw1(enum letter c) { int sw2(enum letter c) { - switch (c) { + switch (c) { case A ... C: case L ... A: return 1; - default: + default: return 0; } } -// CIR: cir.func @_Z3sw26letter +// CIR: cir.func dso_local @_Z3sw26letter // CIR: cir.scope { // CIR: cir.switch // CIR-NEXT: cir.case(range, [#cir.int<0> : !s32i, #cir.int<2> : !s32i]) { @@ -101,7 +101,7 @@ int sw2(enum letter c) { void sw3(enum letter c) { int x = 0; - switch (c) { + switch (c) { case A ... C: x = 1; break; @@ -117,7 +117,7 @@ void sw3(enum letter c) { } } -// CIR: cir.func @_Z3sw36letter +// CIR: cir.func dso_local @_Z3sw36letter // CIR: cir.scope { // CIR: cir.switch // CIR-NEXT: cir.case(range, [#cir.int<0> : !s32i, #cir.int<2> : !s32i]) { @@ -177,7 +177,7 @@ void sw4(int x) { } } -// CIR: cir.func @_Z3sw4i +// CIR: cir.func dso_local @_Z3sw4i // CIR: cir.scope { // CIR: cir.switch // CIR-NEXT: cir.case(range, [#cir.int<66> : !s32i, #cir.int<233> : !s32i]) { @@ -218,7 +218,7 @@ void sw5(int x) { } } -// CIR: cir.func @_Z3sw5i +// CIR: cir.func dso_local @_Z3sw5i // CIR: cir.scope { // CIR: cir.switch // CIR-NEXT: cir.case(range, [#cir.int<100> : !s32i, #cir.int<-100> : !s32i]) { @@ -249,7 +249,7 @@ void sw6(int x) { } } -// CIR: cir.func @_Z3sw6i +// CIR: cir.func dso_local @_Z3sw6i // CIR: cir.scope { // CIR: cir.switch // CIR-NEXT: cir.case(range, [#cir.int<-2147483648> : !s32i, #cir.int<2147483647> : !s32i]) { @@ -291,7 +291,7 @@ void sw7(int x) { } } -// CIR: cir.func @_Z3sw7i +// CIR: cir.func dso_local @_Z3sw7i // CIR: cir.scope { // CIR: cir.switch // CIR-NEXT: cir.case(equal, [#cir.int<0> : !s32i]) { @@ -346,4 +346,3 @@ void sw7(int x) { // LLVM-NEXT: br label %[[EPILOG_END:[0-9]+]] // LLVM: [[EPILOG_END]]: // LLVM-NEXT: ret void - diff --git a/clang/test/CIR/CodeGen/switch.cpp b/clang/test/CIR/CodeGen/switch.cpp index 97d0f69d7a35..46f2f19ff78f 100644 --- a/clang/test/CIR/CodeGen/switch.cpp +++ b/clang/test/CIR/CodeGen/switch.cpp @@ -15,7 +15,7 @@ void sw1(int a) { } } } -// CHECK: cir.func @_Z3sw1i +// CHECK: cir.func dso_local @_Z3sw1i // CHECK: cir.switch (%3 : !s32i) { // CHECK-NEXT: cir.case(equal, [#cir.int<0> : !s32i]) { // CHECK: cir.break @@ -36,7 +36,7 @@ void sw2(int a) { } } -// CHECK: cir.func @_Z3sw2i +// CHECK: cir.func dso_local @_Z3sw2i // CHECK: cir.scope { // CHECK-NEXT: %1 = cir.alloca !s32i, !cir.ptr, ["yolo", init] // CHECK-NEXT: %2 = cir.alloca !s32i, !cir.ptr, ["fomo", init] @@ -52,7 +52,7 @@ void sw3(int a) { } } -// CHECK: cir.func @_Z3sw3i +// CHECK: cir.func dso_local @_Z3sw3i // CHECK: cir.scope { // CHECK-NEXT: %1 = cir.load{{.*}} %0 : !cir.ptr, !s32i // CHECK-NEXT: cir.switch (%1 : !s32i) { @@ -73,7 +73,7 @@ int sw4(int a) { return 0; } -// CHECK: cir.func @_Z3sw4i +// CHECK: cir.func dso_local @_Z3sw4i // CHECK: cir.switch (%4 : !s32i) { // CHECK-NEXT: cir.case(equal, [#cir.int<42> : !s32i]) { // CHECK-NEXT: cir.scope { @@ -99,7 +99,7 @@ void sw5(int a) { } } -// CHECK: cir.func @_Z3sw5i +// CHECK: cir.func dso_local @_Z3sw5i // CHECK: cir.switch (%1 : !s32i) { // CHECK-NEXT: cir.case(equal, [#cir.int<1> : !s32i]) { // CHECK-NEXT: cir.yield @@ -120,7 +120,7 @@ void sw6(int a) { } } -// CHECK: cir.func @_Z3sw6i +// CHECK: cir.func dso_local @_Z3sw6i // CHECK: cir.switch (%1 : !s32i) { // CHECK-NEXT: cir.case(anyof, [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i]) { // CHECK-NEXT: cir.break @@ -142,7 +142,7 @@ void sw7(int a) { } } -// CHECK: cir.func @_Z3sw7i +// CHECK: cir.func dso_local @_Z3sw7i // CHECK: cir.case(anyof, [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i]) { // CHECK-NEXT: cir.yield // CHECK-NEXT: } @@ -161,7 +161,7 @@ void sw8(int a) { } } -//CHECK: cir.func @_Z3sw8i +//CHECK: cir.func dso_local @_Z3sw8i //CHECK: cir.case(equal, [#cir.int<3> : !s32i]) { //CHECK-NEXT: cir.break //CHECK-NEXT: } @@ -183,7 +183,7 @@ void sw9(int a) { } } -//CHECK: cir.func @_Z3sw9i +//CHECK: cir.func dso_local @_Z3sw9i //CHECK: cir.case(equal, [#cir.int<3> : !s32i]) { //CHECK-NEXT: cir.break //CHECK-NEXT: } @@ -206,7 +206,7 @@ void sw10(int a) { } } -//CHECK: cir.func @_Z4sw10i +//CHECK: cir.func dso_local @_Z4sw10i //CHECK: cir.case(equal, [#cir.int<3> : !s32i]) { //CHECK-NEXT: cir.break //CHECK-NEXT: } @@ -234,7 +234,7 @@ void sw11(int a) { } } -//CHECK: cir.func @_Z4sw11i +//CHECK: cir.func dso_local @_Z4sw11i //CHECK: cir.case(equal, [#cir.int<3> : !s32i]) { //CHECK-NEXT: cir.break //CHECK-NEXT: } @@ -257,7 +257,7 @@ void sw12(int a) { } } -// CHECK: cir.func @_Z4sw12i +// CHECK: cir.func dso_local @_Z4sw12i // CHECK: cir.scope { // CHECK: cir.switch // CHECK-NEXT: cir.case(equal, [#cir.int<3> : !s32i]) { @@ -276,7 +276,7 @@ void sw13(int a, int b) { } } -// CHECK: cir.func @_Z4sw13ii +// CHECK: cir.func dso_local @_Z4sw13ii // CHECK: cir.scope { // CHECK: cir.switch // CHECK-NEXT: cir.case(equal, [#cir.int<1> : !s32i]) { @@ -303,7 +303,7 @@ void fallthrough(int x) { } } -// CHECK: cir.func @_Z11fallthroughi +// CHECK: cir.func dso_local @_Z11fallthroughi // CHECK: cir.scope { // CHECK: cir.switch (%1 : !s32i) { // CHECK-NEXT: cir.case(equal, [#cir.int<1> : !s32i]) { @@ -332,7 +332,7 @@ int unreachable_after_break_1(int a) { return -1; } -// CHECK: cir.func @_Z25unreachable_after_break_1i +// CHECK: cir.func dso_local @_Z25unreachable_after_break_1i // CHECK: cir.case(equal, [#cir.int<42> : !s32i]) { // CHECK: cir.break // CHECK: ^bb1: // no predecessors diff --git a/clang/test/CIR/CodeGen/tbaa-enum.c b/clang/test/CIR/CodeGen/tbaa-enum.c index 61f0044ec545..e2315451d4a2 100644 --- a/clang/test/CIR/CodeGen/tbaa-enum.c +++ b/clang/test/CIR/CodeGen/tbaa-enum.c @@ -46,7 +46,7 @@ typedef enum : uint8_t { } Enum8; uint32_t g0(EnumAuto32 *E, uint32_t *val) { - // CIR-LABEL: cir.func @g0 + // CIR-LABEL: cir.func dso_local @g0 // CIR: %[[C5:.*]] = cir.const #cir.int<5> : !s32i // CIR: %[[U_C5:.*]] = cir.cast(integral, %[[C5]] : !s32i), !u32i // CIR: %[[VAL_PTR:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr @@ -69,7 +69,7 @@ uint32_t g0(EnumAuto32 *E, uint32_t *val) { } uint64_t g1(EnumAuto64 *E, uint64_t *val) { - // CIR-LABEL: cir.func @g1 + // CIR-LABEL: cir.func dso_local @g1 // CIR: %[[C5:.*]] = cir.const #cir.int<5> : !s32i // CIR: %[[U_C5:.*]] = cir.cast(integral, %[[C5]] : !s32i), !u64i // CIR: %[[VAL_PTR:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr @@ -91,7 +91,7 @@ uint64_t g1(EnumAuto64 *E, uint64_t *val) { } uint16_t g2(Enum16 *E, uint16_t *val) { - // CIR-LABEL: cir.func @g2 + // CIR-LABEL: cir.func dso_local @g2 // CIR: %[[C5:.*]] = cir.const #cir.int<5> : !s32i // CIR: %[[U_C5:.*]] = cir.cast(integral, %[[C5]] : !s32i), !u16i // CIR: %[[VAL_PTR:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr @@ -113,7 +113,7 @@ uint16_t g2(Enum16 *E, uint16_t *val) { } uint8_t g3(Enum8 *E, uint8_t *val) { - // CIR-LABEL: cir.func @g3 + // CIR-LABEL: cir.func dso_local @g3 // CIR: %[[C5:.*]] = cir.const #cir.int<5> : !s32i // CIR: %[[U_C5:.*]] = cir.cast(integral, %[[C5]] : !s32i), !u8i // CIR: %[[VAL_PTR:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr @@ -124,7 +124,7 @@ uint8_t g3(Enum8 *E, uint8_t *val) { // CIR: %[[RET_PTR:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr // CIR: %[[RET:.*]] = cir.load{{.*}} %[[RET_PTR]] : !cir.ptr, !u8i tbaa(#tbaa[[CHAR]]) // CIR: cir.store{{.*}} %[[RET]], %{{.*}} : !u8i, !cir.ptr - + // LLVM-LABEL: define{{.*}} i8 @g3( // LLVM: store i8 5, ptr %{{.*}}, align 1, !tbaa [[TAG_i8:!.*]] diff --git a/clang/test/CIR/CodeGen/tbaa-enum.cpp b/clang/test/CIR/CodeGen/tbaa-enum.cpp index 5d8650c4ef6d..c6fe2f99bb58 100644 --- a/clang/test/CIR/CodeGen/tbaa-enum.cpp +++ b/clang/test/CIR/CodeGen/tbaa-enum.cpp @@ -50,7 +50,7 @@ typedef enum : uint8_t { } Enum8; uint32_t g0(EnumAuto32 *E, uint32_t *val) { - // CIR-LABEL: cir.func @_Z2g0 + // CIR-LABEL: cir.func dso_local @_Z2g0 // CIR: %[[C5:.*]] = cir.const #cir.int<5> : !s32i // CIR: %[[U_C5:.*]] = cir.cast(integral, %[[C5]] : !s32i), !u32i // CIR: %[[VAL_PTR:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr @@ -72,7 +72,7 @@ uint32_t g0(EnumAuto32 *E, uint32_t *val) { } uint64_t g1(EnumAuto64 *E, uint64_t *val) { - // CIR-LABEL: cir.func @_Z2g1 + // CIR-LABEL: cir.func dso_local @_Z2g1 // CIR: %[[C5:.*]] = cir.const #cir.int<5> : !s32i // CIR: %[[U_C5:.*]] = cir.cast(integral, %[[C5]] : !s32i), !u64i // CIR: %[[VAL_PTR:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr @@ -94,7 +94,7 @@ uint64_t g1(EnumAuto64 *E, uint64_t *val) { } uint16_t g2(Enum16 *E, uint16_t *val) { - // CIR-LABEL: cir.func @_Z2g2 + // CIR-LABEL: cir.func dso_local @_Z2g2 // CIR: %[[C5:.*]] = cir.const #cir.int<5> : !s32i // CIR: %[[U_C5:.*]] = cir.cast(integral, %[[C5]] : !s32i), !u16i // CIR: %[[VAL_PTR:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr @@ -116,7 +116,7 @@ uint16_t g2(Enum16 *E, uint16_t *val) { } uint8_t g3(Enum8 *E, uint8_t *val) { - // CIR-LABEL: cir.func @_Z2g3 + // CIR-LABEL: cir.func dso_local @_Z2g3 // CIR: %[[C5:.*]] = cir.const #cir.int<5> : !s32i // CIR: %[[U_C5:.*]] = cir.cast(integral, %[[C5]] : !s32i), !u8i // CIR: %[[VAL_PTR:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr @@ -127,7 +127,7 @@ uint8_t g3(Enum8 *E, uint8_t *val) { // CIR: %[[RET_PTR:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr // CIR: %[[RET:.*]] = cir.load{{.*}} %[[RET_PTR]] : !cir.ptr, !u8i tbaa(#tbaa[[CHAR]]) // CIR: cir.store{{.*}} %[[RET]], %{{.*}} : !u8i, !cir.ptr - + // LLVM-LABEL: define{{.*}} i8 @_Z2g3 // LLVM: store i8 5, ptr %{{.*}}, align 1, !tbaa [[TAG_i8:!.*]] diff --git a/clang/test/CIR/CodeGen/tbaa-scalar.c b/clang/test/CIR/CodeGen/tbaa-scalar.c index 235293d03b09..1ee9623010e4 100644 --- a/clang/test/CIR/CodeGen/tbaa-scalar.c +++ b/clang/test/CIR/CodeGen/tbaa-scalar.c @@ -18,7 +18,7 @@ // CIR: #tbaa[[LONG_LONG:.*]] = #cir.tbaa_scalar void test_int_and_float(int *a, float *b) { - // CIR-LABEL: cir.func @test_int_and_float + // CIR-LABEL: cir.func dso_local @test_int_and_float // CIR: cir.scope // CIR: %[[TMP1:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr // CIR: %[[TMP2:.*]] = cir.load{{.*}} %[[TMP1]] : !cir.ptr, !s32i tbaa(#tbaa[[INT]]) @@ -45,7 +45,7 @@ void test_int_and_float(int *a, float *b) { } void test_long_and_double(long *a, double *b) { - // CIR-LABEL: cir.func @test_long_and_double + // CIR-LABEL: cir.func dso_local @test_long_and_double // CIR: cir.scope // CIR: %[[TMP1:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr // CIR: %[[TMP2:.*]] = cir.load{{.*}} %[[TMP1]] : !cir.ptr, !s64i tbaa(#tbaa[[LONG]]) @@ -71,7 +71,7 @@ void test_long_and_double(long *a, double *b) { } } void test_long_long_and_long_double(long long *a, long double *b) { - // CIR-LABEL: cir.func @test_long_long_and_long_double + // CIR-LABEL: cir.func dso_local @test_long_long_and_long_double // CIR: cir.scope // CIR: %[[TMP1:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr // CIR: %[[TMP2:.*]] = cir.load{{.*}} %[[TMP1]] : !cir.ptr, !s64i tbaa(#tbaa[[LONG_LONG]]) @@ -98,7 +98,7 @@ void test_long_long_and_long_double(long long *a, long double *b) { } void test_char(char *a, char* b) { - // CIR-LABEL: cir.func @test_char + // CIR-LABEL: cir.func dso_local @test_char // CIR: cir.scope // CIR: %[[TMP1:.*]] = cir.load deref{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr // CIR: %[[TMP2:.*]] = cir.load{{.*}} %[[TMP1]] : !cir.ptr, !s8i tbaa(#tbaa[[CHAR]]) diff --git a/clang/test/CIR/CodeGen/tbaa-struct.cpp b/clang/test/CIR/CodeGen/tbaa-struct.cpp index e594f4c1b362..455076698899 100644 --- a/clang/test/CIR/CodeGen/tbaa-struct.cpp +++ b/clang/test/CIR/CodeGen/tbaa-struct.cpp @@ -82,7 +82,7 @@ typedef struct } StructS2; uint32_t g(uint32_t *s, StructA *A, uint64_t count) { - // CIR-LABEL: cir.func @_Z1g + // CIR-LABEL: cir.func dso_local @_Z1g // CIR: %[[INT_1:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[UINT_1:.*]] = cir.cast(integral, %[[INT_1]] : !s32i), !u32i // CIR: cir.store{{.*}} %[[UINT_1]], %{{.*}} : !u32i, !cir.ptr tbaa(#tbaa[[INT]]) @@ -103,7 +103,7 @@ uint32_t g(uint32_t *s, StructA *A, uint64_t count) { } uint32_t g2(uint32_t *s, StructA *A, uint64_t count) { - // CIR-LABEL: cir.func @_Z2g2 + // CIR-LABEL: cir.func dso_local @_Z2g2 // CIR: %[[INT_1:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[UINT_1:.*]] = cir.cast(integral, %[[INT_1]] : !s32i), !u32i // CIR: cir.store{{.*}} %[[UINT_1]], %{{.*}} : !u32i, !cir.ptr tbaa(#tbaa[[INT]]) @@ -123,7 +123,7 @@ uint32_t g2(uint32_t *s, StructA *A, uint64_t count) { } uint32_t g3(StructA *A, StructB *B, uint64_t count) { - // CIR-LABEL: cir.func @_Z2g3 + // CIR-LABEL: cir.func dso_local @_Z2g3 // CIR: %[[INT_1:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[UINT_1:.*]] = cir.cast(integral, %[[INT_1]] : !s32i), !u32i // CIR: cir.store{{.*}} %[[UINT_1]], %{{.*}} : !u32i, !cir.ptr tbaa(#tbaa[[TAG_StructA_f32]]) @@ -143,7 +143,7 @@ uint32_t g3(StructA *A, StructB *B, uint64_t count) { } uint32_t g4(StructA *A, StructB *B, uint64_t count) { - // CIR-LABEL: cir.func @_Z2g4 + // CIR-LABEL: cir.func dso_local @_Z2g4 // CIR: %[[INT_1:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[UINT_1:.*]] = cir.cast(integral, %[[INT_1]] : !s32i), !u32i // CIR: cir.store{{.*}} %[[UINT_1]], %{{.*}} : !u32i, !cir.ptr tbaa(#tbaa[[TAG_StructA_f32]]) @@ -163,7 +163,7 @@ uint32_t g4(StructA *A, StructB *B, uint64_t count) { } uint32_t g5(StructA *A, StructB *B, uint64_t count) { - // CIR-LABEL: cir.func @_Z2g5 + // CIR-LABEL: cir.func dso_local @_Z2g5 // CIR: %[[INT_1:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[UINT_1:.*]] = cir.cast(integral, %[[INT_1]] : !s32i), !u32i // CIR: cir.store{{.*}} %[[UINT_1]], %{{.*}} : !u32i, !cir.ptr tbaa(#tbaa[[TAG_StructA_f32]]) @@ -183,7 +183,7 @@ uint32_t g5(StructA *A, StructB *B, uint64_t count) { } uint32_t g6(StructA *A, StructB *B, uint64_t count) { - // CIR-LABEL: cir.func @_Z2g6 + // CIR-LABEL: cir.func dso_local @_Z2g6 // CIR: %[[INT_1:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[UINT_1:.*]] = cir.cast(integral, %[[INT_1]] : !s32i), !u32i // CIR: cir.store{{.*}} %[[UINT_1]], %{{.*}} : !u32i, !cir.ptr tbaa(#tbaa[[TAG_StructA_f32]]) @@ -203,7 +203,7 @@ uint32_t g6(StructA *A, StructB *B, uint64_t count) { } uint32_t g7(StructA *A, StructS *S, uint64_t count) { - // CIR-LABEL: cir.func @_Z2g7 + // CIR-LABEL: cir.func dso_local @_Z2g7 // CIR: %[[INT_1:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[UINT_1:.*]] = cir.cast(integral, %[[INT_1]] : !s32i), !u32i // CIR: cir.store{{.*}} %[[UINT_1]], %{{.*}} : !u32i, !cir.ptr tbaa(#tbaa[[TAG_StructA_f32]]) @@ -223,7 +223,7 @@ uint32_t g7(StructA *A, StructS *S, uint64_t count) { } uint32_t g8(StructA *A, StructS *S, uint64_t count) { - // CIR-LABEL: cir.func @_Z2g8 + // CIR-LABEL: cir.func dso_local @_Z2g8 // CIR: %[[INT_1:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[UINT_1:.*]] = cir.cast(integral, %[[INT_1]] : !s32i), !u32i // CIR: cir.store{{.*}} %[[UINT_1]], %{{.*}} : !u32i, !cir.ptr tbaa(#tbaa[[TAG_StructA_f32]]) @@ -243,7 +243,7 @@ uint32_t g8(StructA *A, StructS *S, uint64_t count) { } uint32_t g9(StructS *S, StructS2 *S2, uint64_t count) { - // CIR-LABEL: cir.func @_Z2g9 + // CIR-LABEL: cir.func dso_local @_Z2g9 // CIR: %[[INT_1:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[UINT_1:.*]] = cir.cast(integral, %[[INT_1]] : !s32i), !u32i // CIR: cir.store{{.*}} %[[UINT_1]], %{{.*}} : !u32i, !cir.ptr tbaa(#tbaa[[TAG_StructS_f32]]) @@ -263,7 +263,7 @@ uint32_t g9(StructS *S, StructS2 *S2, uint64_t count) { } uint32_t g10(StructS *S, StructS2 *S2, uint64_t count) { - // CIR-LABEL: cir.func @_Z3g10 + // CIR-LABEL: cir.func dso_local @_Z3g10 // CIR: %[[INT_1:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[UINT_1:.*]] = cir.cast(integral, %[[INT_1]] : !s32i), !u32i // CIR: cir.store{{.*}} %[[UINT_1]], %{{.*}} : !u32i, !cir.ptr tbaa(#tbaa[[TAG_StructS_f32]]) @@ -283,7 +283,7 @@ uint32_t g10(StructS *S, StructS2 *S2, uint64_t count) { } uint32_t g11(StructC *C, StructD *D, uint64_t count) { - // CIR-LABEL: cir.func @_Z3g11 + // CIR-LABEL: cir.func dso_local @_Z3g11 // CIR: %[[INT_1:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[UINT_1:.*]] = cir.cast(integral, %[[INT_1]] : !s32i), !u32i // CIR: cir.store{{.*}} %[[UINT_1]], %{{.*}} : !u32i, !cir.ptr tbaa(#tbaa[[TAG_StructC_b_a_f32]]) @@ -303,7 +303,7 @@ uint32_t g11(StructC *C, StructD *D, uint64_t count) { } uint32_t g12(StructC *C, StructD *D, uint64_t count) { - // CIR-LABEL: cir.func @_Z3g12 + // CIR-LABEL: cir.func dso_local @_Z3g12 // CIR: %[[INT_1:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[UINT_1:.*]] = cir.cast(integral, %[[INT_1]] : !s32i), !u32i // CIR: cir.store{{.*}} %[[UINT_1]], %{{.*}} : !u32i, !cir.ptr tbaa(#tbaa[[TAG_StructB_a_f32]]) @@ -333,7 +333,7 @@ struct six { char c; }; char g14(struct six *a, struct six *b) { - // CIR-LABEL: cir.func @_Z3g14 + // CIR-LABEL: cir.func dso_local @_Z3g14 // CIR: %[[TMP1:.*]] = cir.load{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr // CIR: %[[TMP2:.*]] = cir.get_member %[[TMP1]][2] {name = "b"} : !cir.ptr -> !cir.ptr // CIR: %[[TMP3:.*]] = cir.load{{.*}} %[[TMP2]] : !cir.ptr, !s8i tbaa(#tbaa[[TAG_six_b]]) @@ -348,7 +348,7 @@ char g14(struct six *a, struct six *b) { // Types that differ only by name may alias. typedef StructS StructS3; uint32_t g15(StructS *S, StructS3 *S3, uint64_t count) { - // CIR-LABEL: cir.func @_Z3g15 + // CIR-LABEL: cir.func dso_local @_Z3g15 // CIR: %[[INT_1:.*]] = cir.const #cir.int<1> : !s32i // CIR: %[[UINT_1:.*]] = cir.cast(integral, %[[INT_1]] : !s32i), !u32i // CIR: cir.store{{.*}} %[[UINT_1]], %{{.*}} : !u32i, !cir.ptr tbaa(#tbaa[[TAG_StructS_f32]]) diff --git a/clang/test/CIR/CodeGen/tbaa-union.c b/clang/test/CIR/CodeGen/tbaa-union.c index d2a5c3abf785..2027168f42b2 100644 --- a/clang/test/CIR/CodeGen/tbaa-union.c +++ b/clang/test/CIR/CodeGen/tbaa-union.c @@ -17,7 +17,7 @@ typedef struct { } S; void foo(S *s) { - // CIR-LABEL: cir.func @foo + // CIR-LABEL: cir.func dso_local @foo // CIR: %[[C1:.*]] = cir.const #cir.int<1> : !s32i loc(#loc6) // CIR: %{{.*}} = cir.load{{.*}} %{{.*}} : !cir.ptr>, !cir.ptr // CIR: cir.store{{.*}} %[[C1]], %{{.*}} : !s32i, !cir.ptr tbaa(#tbaa[[CHAR]]) diff --git a/clang/test/CIR/CodeGen/temporaries.cpp b/clang/test/CIR/CodeGen/temporaries.cpp index 6fa5002e4670..1ac0b9a35014 100644 --- a/clang/test/CIR/CodeGen/temporaries.cpp +++ b/clang/test/CIR/CodeGen/temporaries.cpp @@ -17,7 +17,7 @@ void f() { // CIR: cir.func private @_ZN1EC1Ev(!cir.ptr) extra(#fn_attr) // CIR-NEXT: cir.func private @_ZN1EntEv(!cir.ptr) -> !rec_E // CIR-NEXT: cir.func private @_ZN1ED1Ev(!cir.ptr) extra(#fn_attr) -// CIR-NEXT: cir.func @_Z1fv() extra(#fn_attr1) { +// CIR-NEXT: cir.func dso_local @_Z1fv() extra(#fn_attr1) { // CIR-NEXT: cir.scope { // CIR-NEXT: %[[ONE:[0-9]+]] = cir.alloca !rec_E, !cir.ptr, ["agg.tmp.ensured"] {alignment = 1 : i64} // CIR-NEXT: %[[TWO:[0-9]+]] = cir.alloca !rec_E, !cir.ptr, ["ref.tmp0"] {alignment = 1 : i64} @@ -49,4 +49,3 @@ const int &r = (const int&)n; // LLVM: @_ZGR1r_ = internal constant i32 1234, align 4 // LLVM-NEXT: @r = constant ptr @_ZGR1r_, align 8 - diff --git a/clang/test/CIR/CodeGen/temporary-materialization.cpp b/clang/test/CIR/CodeGen/temporary-materialization.cpp index 2ea7b92673ed..ec65f958763b 100644 --- a/clang/test/CIR/CodeGen/temporary-materialization.cpp +++ b/clang/test/CIR/CodeGen/temporary-materialization.cpp @@ -8,7 +8,7 @@ int test() { return x; } -// CHECK: cir.func @_Z4testv() +// CHECK: cir.func dso_local @_Z4testv() // CHECK-NEXT: %{{.+}} = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CHECK-NEXT: %[[#TEMP_SLOT:]] = cir.alloca !s32i, !cir.ptr, ["ref.tmp0", init] {alignment = 4 : i64} // CHECK-NEXT: %[[#x:]] = cir.alloca !cir.ptr, !cir.ptr>, ["x", init, const] {alignment = 8 : i64} @@ -28,7 +28,7 @@ int test_scoped() { return x; } -// CHECK: cir.func @_Z11test_scopedv() +// CHECK: cir.func dso_local @_Z11test_scopedv() // CHECK-NEXT: %{{.+}} = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CHECK-NEXT: %{{.+}} = cir.alloca !s32i, !cir.ptr, ["x", init] {alignment = 4 : i64} // CHECK: cir.scope { diff --git a/clang/test/CIR/CodeGen/ternary.cpp b/clang/test/CIR/CodeGen/ternary.cpp index a19b42cabeb1..9a0f1e573f19 100644 --- a/clang/test/CIR/CodeGen/ternary.cpp +++ b/clang/test/CIR/CodeGen/ternary.cpp @@ -5,7 +5,7 @@ int x(int y) { return y > 0 ? 3 : 5; } -// CHECK: cir.func @_Z1xi +// CHECK: cir.func dso_local @_Z1xi // CHECK: %0 = cir.alloca !s32i, !cir.ptr, ["y", init] {alignment = 4 : i64} // CHECK: %1 = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} // CHECK: cir.store %arg0, %0 : !s32i, !cir.ptr @@ -31,7 +31,7 @@ void m(APIType api) { ((api == API_A) ? (static_cast(0)) : oba("yo.cpp")); } -// CHECK: cir.func @_Z1m7APIType +// CHECK: cir.func dso_local @_Z1m7APIType // CHECK: %0 = cir.alloca !u32i, !cir.ptr, ["api", init] {alignment = 4 : i64} // CHECK: cir.store %arg0, %0 : !u32i, !cir.ptr // CHECK: %1 = cir.load{{.*}} %0 : !cir.ptr, !u32i @@ -57,7 +57,7 @@ int foo(int a, int b) { return 0; } -// CHECK: cir.func @_Z3fooii +// CHECK: cir.func dso_local @_Z3fooii // CHECK: [[A0:%.*]] = cir.load{{.*}} {{.*}} : !cir.ptr, !s32i // CHECK: [[B0:%.*]] = cir.load{{.*}} {{.*}} : !cir.ptr, !s32i // CHECK: [[CMP:%.*]] = cir.cmp(lt, [[A0]], [[B0]]) : !s32i, !cir.bool @@ -77,7 +77,7 @@ bool func(bool a, bool b) { return (maybe_has_side_effects(), a) ?: b; } -// CHECK: cir.func @_Z4funcbb([[ARG_A:%.*]]: !cir.bool {{.*}}, [[ARG_B:%.*]]: !cir.bool {{.*}} +// CHECK: cir.func dso_local @_Z4funcbb([[ARG_A:%.*]]: !cir.bool {{.*}}, [[ARG_B:%.*]]: !cir.bool {{.*}} // CHECK: [[ALLOC_A:%.*]] = cir.alloca !cir.bool, !cir.ptr, ["a", init] // CHECK: [[ALLOC_B:%.*]] = cir.alloca !cir.bool, !cir.ptr, ["b", init] // CHECK: [[ALLOC_RET:%.*]] = cir.alloca !cir.bool, !cir.ptr, ["__retval"] diff --git a/clang/test/CIR/CodeGen/three-way-comparison.cpp b/clang/test/CIR/CodeGen/three-way-comparison.cpp index 1d62fd58ab17..2ac317fc4675 100644 --- a/clang/test/CIR/CodeGen/three-way-comparison.cpp +++ b/clang/test/CIR/CodeGen/three-way-comparison.cpp @@ -14,21 +14,21 @@ auto three_way_strong(int x, int y) { return x <=> y; } -// BEFORE: cir.func @_Z16three_way_strongii +// BEFORE: cir.func dso_local @_Z16three_way_strongii // BEFORE: %{{.+}} = cir.cmp3way(%{{.+}} : !s32i, %{{.+}}, #cmp3way_info_strong_ltn1eq0gt1) : !s8i // BEFORE: } -// AFTER: cir.func @_Z16three_way_strongii +// AFTER: cir.func dso_local @_Z16three_way_strongii // AFTER: %{{.+}} = cir.cmp3way(%{{.+}} : !s32i, %{{.+}}, #cmp3way_info_strong_ltn1eq0gt1) : !s8i // AFTER: } // NONCANONICAL-BEFORE: #cmp3way_info_strong_lt1eq2gt3 = #cir.cmp3way_info -// NONCANONICAL-BEFORE: cir.func @_Z16three_way_strongii +// NONCANONICAL-BEFORE: cir.func dso_local @_Z16three_way_strongii // NONCANONICAL-BEFORE: %{{.+}} = cir.cmp3way(%{{.+}} : !s32i, %{{.+}}, #cmp3way_info_strong_lt1eq2gt3) : !s8i // NONCANONICAL-BEFORE: } // NONCANONICAL-AFTER: #cmp3way_info_strong_ltn1eq0gt1 = #cir.cmp3way_info -// NONCANONICAL-AFTER: cir.func @_Z16three_way_strongii +// NONCANONICAL-AFTER: cir.func dso_local @_Z16three_way_strongii // NONCANONICAL-AFTER: %[[#CMP3WAY_RESULT:]] = cir.cmp3way(%{{.+}} : !s32i, %{{.+}}, #cmp3way_info_strong_ltn1eq0gt1) : !s8i // NONCANONICAL-AFTER-NEXT: %[[#NEGONE:]] = cir.const #cir.int<-1> : !s8i // NONCANONICAL-AFTER-NEXT: %[[#ONE:]] = cir.const #cir.int<1> : !s8i @@ -48,11 +48,11 @@ auto three_way_weak(float x, float y) { return x <=> y; } -// BEFORE: cir.func @_Z14three_way_weakff +// BEFORE: cir.func dso_local @_Z14three_way_weakff // BEFORE: %{{.+}} = cir.cmp3way(%{{.+}} : !cir.float, %{{.+}}, #cmp3way_info_partial_ltn1eq0gt1unn127) : !s8i // BEFORE: } -// AFTER: cir.func @_Z14three_way_weakff +// AFTER: cir.func dso_local @_Z14three_way_weakff // AFTER: %[[#LHS:]] = cir.load{{.*}} %0 : !cir.ptr, !cir.float // AFTER-NEXT: %[[#RHS:]] = cir.load{{.*}} %1 : !cir.ptr, !cir.float // AFTER-NEXT: %[[#LT:]] = cir.const #cir.int<-1> : !s8i diff --git a/clang/test/CIR/CodeGen/throw.cpp b/clang/test/CIR/CodeGen/throw.cpp index 01717e4149b0..7359f4c94aa8 100644 --- a/clang/test/CIR/CodeGen/throw.cpp +++ b/clang/test/CIR/CodeGen/throw.cpp @@ -301,7 +301,7 @@ void statements() { 123 + 456; } -// CIR: cir.func @_Z10statementsv() +// CIR: cir.func dso_local @_Z10statementsv() // CIR-NEXT: %[[V0:.*]] = cir.alloc.exception 4 -> !cir.ptr // CIR-NEXT: %[[V1:.*]] = cir.const #cir.int<0> : !s32i // CIR-NEXT: cir.store align(16) %[[V1]], %[[V0]] : !s32i, !cir.ptr @@ -319,7 +319,7 @@ void statements() { void paren_expr() { (throw 0, 123 + 456); } -// CIR: cir.func @_Z10paren_exprv() +// CIR: cir.func dso_local @_Z10paren_exprv() // CIR-NEXT: %[[V0:.*]] = cir.alloc.exception 4 -> !cir.ptr // CIR-NEXT: %[[V1:.*]] = cir.const #cir.int<0> : !s32i // CIR-NEXT: cir.store align(16) %[[V1]], %[[V0]] : !s32i, !cir.ptr @@ -339,7 +339,7 @@ int ternary_throw1(bool condition, int x) { return condition ? throw x : x; } -// CIR: cir.func @_Z14ternary_throw1bi(%arg0: !cir.bool +// CIR: cir.func dso_local @_Z14ternary_throw1bi(%arg0: !cir.bool // CIR-NEXT: %[[V0:.*]] = cir.alloca !cir.bool, !cir.ptr, ["condition", init] {alignment = 1 : i64} // CIR-NEXT: %[[V1:.*]] = cir.alloca !s32i, !cir.ptr, ["x", init] {alignment = 4 : i64} // CIR-NEXT: %[[V2:.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] {alignment = 4 : i64} diff --git a/clang/test/CIR/CodeGen/tls.c b/clang/test/CIR/CodeGen/tls.c index 499afad56ee2..46f6b0c0806c 100644 --- a/clang/test/CIR/CodeGen/tls.c +++ b/clang/test/CIR/CodeGen/tls.c @@ -6,7 +6,7 @@ extern __thread int b; int c(void) { return *&b; } // CIR: cir.global "private" external tls_dyn @b : !s32i -// CIR: cir.func @c() -> !s32i +// CIR: cir.func dso_local @c() -> !s32i // CIR: %[[TLS_ADDR:.*]] = cir.get_global thread_local @b : !cir.ptr __thread int a; @@ -16,4 +16,4 @@ __thread int a; // LLVM: @a = thread_local global i32 0 // LLVM-LABEL: @c -// LLVM: = call ptr @llvm.threadlocal.address.p0(ptr @b) \ No newline at end of file +// LLVM: = call ptr @llvm.threadlocal.address.p0(ptr @b) diff --git a/clang/test/CIR/CodeGen/trap.cpp b/clang/test/CIR/CodeGen/trap.cpp index 2d1089421876..83e9be7230d2 100644 --- a/clang/test/CIR/CodeGen/trap.cpp +++ b/clang/test/CIR/CodeGen/trap.cpp @@ -8,7 +8,7 @@ void basic() { __builtin_trap(); } -// CHECK: cir.func @_Z5basicv() +// CHECK: cir.func dso_local @_Z5basicv() // CHECK-NEXT: cir.call @_Z3foov() : () -> () // CHECK-NEXT: cir.trap // CHECK-NEXT: } @@ -19,7 +19,7 @@ void code_after_unreachable() { foo(); } -// CHECK: cir.func @_Z22code_after_unreachablev() +// CHECK: cir.func dso_local @_Z22code_after_unreachablev() // CHECK-NEXT: cir.call @_Z3foov() : () -> () // CHECK-NEXT: cir.trap // CHECK-NEXT: ^bb1: diff --git a/clang/test/CIR/CodeGen/try-catch.cpp b/clang/test/CIR/CodeGen/try-catch.cpp index 908e899174d8..aa35c467730d 100644 --- a/clang/test/CIR/CodeGen/try-catch.cpp +++ b/clang/test/CIR/CodeGen/try-catch.cpp @@ -5,7 +5,7 @@ double division(int a, int b); -// CHECK: cir.func @_Z2tcv() +// CHECK: cir.func dso_local @_Z2tcv() unsigned long long tc() { int x = 50, y = 3; unsigned long long z; @@ -42,7 +42,7 @@ unsigned long long tc() { return z; } -// CHECK: cir.func @_Z3tc2v +// CHECK: cir.func dso_local @_Z3tc2v unsigned long long tc2() { int x = 50, y = 3; unsigned long long z; @@ -67,7 +67,7 @@ unsigned long long tc2() { return z; } -// CHECK: cir.func @_Z3tc3v +// CHECK: cir.func dso_local @_Z3tc3v unsigned long long tc3() { int x = 50, y = 3; unsigned long long z; @@ -84,7 +84,7 @@ unsigned long long tc3() { return z; } -// CHECK: cir.func @_Z3tc4v() +// CHECK: cir.func dso_local @_Z3tc4v() unsigned long long tc4() { int x = 50, y = 3; unsigned long long z; @@ -113,7 +113,7 @@ struct S { int a; }; -// CHECK: cir.func @_Z3tc5v() +// CHECK: cir.func dso_local @_Z3tc5v() void tc5() { try { S s; @@ -131,7 +131,7 @@ void tc5() { // CHECK: cir.yield // CHECK: }] -// CHECK: cir.func @_Z3tc6v() +// CHECK: cir.func dso_local @_Z3tc6v() void tc6() { int r = 1; try { @@ -152,7 +152,7 @@ void tc6() { // CHECK: } // CHECK: } -// CHECK: cir.func @_Z3tc7v() +// CHECK: cir.func dso_local @_Z3tc7v() void tc7() { int r = 1; try { @@ -191,7 +191,7 @@ void tc8() { // CHECK: } // CHECK: } -// FLAT: cir.func @_Z3tc8v() +// FLAT: cir.func dso_local @_Z3tc8v() // FLAT: %[[V0:.*]] = cir.alloca !rec_S2, !cir.ptr, ["s"] {alignment = 4 : i64} // FLAT: cir.br ^bb[[#B1:]] // FLAT: ^bb[[#B1]]: diff --git a/clang/test/CIR/CodeGen/typedef.c b/clang/test/CIR/CodeGen/typedef.c index 24eb8606fad9..0d6c5cd31bd4 100644 --- a/clang/test/CIR/CodeGen/typedef.c +++ b/clang/test/CIR/CodeGen/typedef.c @@ -5,6 +5,6 @@ void local_typedef() { Struct s; } -//CHECK: cir.func no_proto @local_typedef() +//CHECK: cir.func no_proto dso_local @local_typedef() //CHECK: {{.*}} = cir.alloca !rec_Struct, !cir.ptr, ["s"] {alignment = 4 : i64} //CHECK: cir.return diff --git a/clang/test/CIR/CodeGen/types-IEEE-quad.c b/clang/test/CIR/CodeGen/types-IEEE-quad.c index 9279a3584ecd..c56b3e7ca6d2 100644 --- a/clang/test/CIR/CodeGen/types-IEEE-quad.c +++ b/clang/test/CIR/CodeGen/types-IEEE-quad.c @@ -5,11 +5,11 @@ long double i = 0; long double t2(long double i2) { - return i2 + i ; + return i2 + i ; } // CIR: cir.global external @i = #cir.fp<0.000000e+00> : !cir.long_double {alignment = 16 : i64} loc({{.*}}) -// CIR-LABEL: cir.func @t2(%arg0: !cir.long_double loc({{.*}})) -> !cir.long_double +// CIR-LABEL: cir.func dso_local @t2(%arg0: !cir.long_double loc({{.*}})) -> !cir.long_double // CIR-NEXT: %[[#I2:]] = cir.alloca !cir.long_double, !cir.ptr>, ["i2", init] {alignment = 16 : i64} // CIR-NEXT: %[[#RETVAL:]] = cir.alloca !cir.long_double, !cir.ptr>, ["__retval"] {alignment = 16 : i64} // CIR-NEXT: cir.store %arg0, %[[#I2]] : !cir.long_double, !cir.ptr> diff --git a/clang/test/CIR/CodeGen/types.c b/clang/test/CIR/CodeGen/types.c index 18db058b67e5..d409514a81d5 100644 --- a/clang/test/CIR/CodeGen/types.c +++ b/clang/test/CIR/CodeGen/types.c @@ -22,25 +22,25 @@ void t8(void) {} bool t9(bool b) { return b; } #endif -// CHECK: cir.func @t0(%arg0: !s32i loc({{.*}})) -> !s32i -// CHECK: cir.func @t1(%arg0: !u32i loc({{.*}})) -> !u32i -// CHECK: cir.func @t2(%arg0: !s8i loc({{.*}})) -> !s8i -// CHECK: cir.func @t3(%arg0: !u8i loc({{.*}})) -> !u8i -// CHECK: cir.func @t4(%arg0: !s16i loc({{.*}})) -> !s16i -// CHECK: cir.func @t5(%arg0: !u16i loc({{.*}})) -> !u16i -// CHECK: cir.func @t6(%arg0: !cir.float loc({{.*}})) -> !cir.float -// CHECK: cir.func @t7(%arg0: !cir.double loc({{.*}})) -> !cir.double -// CHECK: cir.func @t10(%arg0: !cir.long_double loc({{.*}})) -> !cir.long_double -// CHECK: cir.func @t8() - -// CHECK-CPP: cir.func @_Z2t0i(%arg0: !s32i loc({{.*}})) -> !s32i -// CHECK-CPP: cir.func @_Z2t1j(%arg0: !u32i loc({{.*}})) -> !u32i -// CHECK-CPP: cir.func @_Z2t2c(%arg0: !s8i loc({{.*}})) -> !s8i -// CHECK-CPP: cir.func @_Z2t3h(%arg0: !u8i loc({{.*}})) -> !u8i -// CHECK-CPP: cir.func @_Z2t4s(%arg0: !s16i loc({{.*}})) -> !s16i -// CHECK-CPP: cir.func @_Z2t5t(%arg0: !u16i loc({{.*}})) -> !u16i -// CHECK-CPP: cir.func @_Z2t6f(%arg0: !cir.float loc({{.*}})) -> !cir.float -// CHECK-CPP: cir.func @_Z2t7d(%arg0: !cir.double loc({{.*}})) -> !cir.double -// CHECK-CPP: cir.func @{{.+}}t10{{.+}}(%arg0: !cir.long_double loc({{.*}})) -> !cir.long_double -// CHECK-CPP: cir.func @_Z2t8v() -// CHECK-CPP: cir.func @_Z2t9b(%arg0: !cir.bool loc({{.*}})) -> !cir.bool +// CHECK: cir.func dso_local @t0(%arg0: !s32i loc({{.*}})) -> !s32i +// CHECK: cir.func dso_local @t1(%arg0: !u32i loc({{.*}})) -> !u32i +// CHECK: cir.func dso_local @t2(%arg0: !s8i loc({{.*}})) -> !s8i +// CHECK: cir.func dso_local @t3(%arg0: !u8i loc({{.*}})) -> !u8i +// CHECK: cir.func dso_local @t4(%arg0: !s16i loc({{.*}})) -> !s16i +// CHECK: cir.func dso_local @t5(%arg0: !u16i loc({{.*}})) -> !u16i +// CHECK: cir.func dso_local @t6(%arg0: !cir.float loc({{.*}})) -> !cir.float +// CHECK: cir.func dso_local @t7(%arg0: !cir.double loc({{.*}})) -> !cir.double +// CHECK: cir.func dso_local @t10(%arg0: !cir.long_double loc({{.*}})) -> !cir.long_double +// CHECK: cir.func dso_local @t8() + +// CHECK-CPP: cir.func dso_local @_Z2t0i(%arg0: !s32i loc({{.*}})) -> !s32i +// CHECK-CPP: cir.func dso_local @_Z2t1j(%arg0: !u32i loc({{.*}})) -> !u32i +// CHECK-CPP: cir.func dso_local @_Z2t2c(%arg0: !s8i loc({{.*}})) -> !s8i +// CHECK-CPP: cir.func dso_local @_Z2t3h(%arg0: !u8i loc({{.*}})) -> !u8i +// CHECK-CPP: cir.func dso_local @_Z2t4s(%arg0: !s16i loc({{.*}})) -> !s16i +// CHECK-CPP: cir.func dso_local @_Z2t5t(%arg0: !u16i loc({{.*}})) -> !u16i +// CHECK-CPP: cir.func dso_local @_Z2t6f(%arg0: !cir.float loc({{.*}})) -> !cir.float +// CHECK-CPP: cir.func dso_local @_Z2t7d(%arg0: !cir.double loc({{.*}})) -> !cir.double +// CHECK-CPP: cir.func dso_local @{{.+}}t10{{.+}}(%arg0: !cir.long_double loc({{.*}})) -> !cir.long_double +// CHECK-CPP: cir.func dso_local @_Z2t8v() +// CHECK-CPP: cir.func dso_local @_Z2t9b(%arg0: !cir.bool loc({{.*}})) -> !cir.bool diff --git a/clang/test/CIR/CodeGen/unary.c b/clang/test/CIR/CodeGen/unary.c index 6c6c4bce7106..ebcae89e2bdb 100644 --- a/clang/test/CIR/CodeGen/unary.c +++ b/clang/test/CIR/CodeGen/unary.c @@ -2,7 +2,7 @@ // RUN: FileCheck --input-file=%t.cir %s int valueNegationInt(int i) { -// CHECK: cir.func @valueNegationInt( +// CHECK: cir.func dso_local @valueNegationInt( return !i; // CHECK: %[[#INT:]] = cir.load{{.*}} %{{[0-9]+}} : !cir.ptr, !s32i // CHECK: %[[#INT_TO_BOOL:]] = cir.cast(int_to_bool, %[[#INT]] : !s32i), !cir.bool @@ -10,7 +10,7 @@ int valueNegationInt(int i) { } short valueNegationShort(short s) { -// CHECK: cir.func @valueNegationShort( +// CHECK: cir.func dso_local @valueNegationShort( return !s; // CHECK: %[[#SHORT:]] = cir.load{{.*}} %{{[0-9]+}} : !cir.ptr, !s16i // CHECK: %[[#SHORT_TO_BOOL:]] = cir.cast(int_to_bool, %[[#SHORT]] : !s16i), !cir.bool @@ -18,7 +18,7 @@ short valueNegationShort(short s) { } long valueNegationLong(long l) { -// CHECK: cir.func @valueNegationLong( +// CHECK: cir.func dso_local @valueNegationLong( return !l; // CHECK: %[[#LONG:]] = cir.load{{.*}} %{{[0-9]+}} : !cir.ptr, !s64i // CHECK: %[[#LONG_TO_BOOL:]] = cir.cast(int_to_bool, %[[#LONG]] : !s64i), !cir.bool @@ -26,7 +26,7 @@ long valueNegationLong(long l) { } float valueNegationFloat(float f) { -// CHECK: cir.func @valueNegationFloat( +// CHECK: cir.func dso_local @valueNegationFloat( return !f; // CHECK: %[[#FLOAT:]] = cir.load{{.*}} %{{[0-9]+}} : !cir.ptr, !cir.float // CHECK: %[[#FLOAT_TO_BOOL:]] = cir.cast(float_to_bool, %[[#FLOAT]] : !cir.float), !cir.bool @@ -35,7 +35,7 @@ float valueNegationFloat(float f) { } double valueNegationDouble(double d) { -// CHECK: cir.func @valueNegationDouble( +// CHECK: cir.func dso_local @valueNegationDouble( return !d; // CHECK: %[[#DOUBLE:]] = cir.load{{.*}} %{{[0-9]+}} : !cir.ptr, !cir.double // CHECK: %[[#DOUBLE_TO_BOOL:]] = cir.cast(float_to_bool, %[[#DOUBLE]] : !cir.double), !cir.bool diff --git a/clang/test/CIR/CodeGen/unary.cpp b/clang/test/CIR/CodeGen/unary.cpp index 643e220a1041..7077f7aa8625 100644 --- a/clang/test/CIR/CodeGen/unary.cpp +++ b/clang/test/CIR/CodeGen/unary.cpp @@ -6,7 +6,7 @@ unsigned up0() { return +a; } -// CHECK: cir.func @_Z3up0v() -> !u32i +// CHECK: cir.func dso_local @_Z3up0v() -> !u32i // CHECK: %[[#RET:]] = cir.alloca !u32i, !cir.ptr, ["__retval"] // CHECK: %[[#A:]] = cir.alloca !u32i, !cir.ptr, ["a", init] // CHECK: %[[#INPUT:]] = cir.load{{.*}} %[[#A]] @@ -18,7 +18,7 @@ unsigned um0() { return -a; } -// CHECK: cir.func @_Z3um0v() -> !u32i +// CHECK: cir.func dso_local @_Z3um0v() -> !u32i // CHECK: %[[#RET:]] = cir.alloca !u32i, !cir.ptr, ["__retval"] // CHECK: %[[#A:]] = cir.alloca !u32i, !cir.ptr, ["a", init] // CHECK: %[[#INPUT:]] = cir.load{{.*}} %[[#A]] @@ -30,7 +30,7 @@ unsigned un0() { return ~a; // a ^ -1 , not } -// CHECK: cir.func @_Z3un0v() -> !u32i +// CHECK: cir.func dso_local @_Z3un0v() -> !u32i // CHECK: %[[#RET:]] = cir.alloca !u32i, !cir.ptr, ["__retval"] // CHECK: %[[#A:]] = cir.alloca !u32i, !cir.ptr, ["a", init] // CHECK: %[[#INPUT:]] = cir.load{{.*}} %[[#A]] @@ -43,7 +43,7 @@ int inc0() { return a; } -// CHECK: cir.func @_Z4inc0v() -> !s32i +// CHECK: cir.func dso_local @_Z4inc0v() -> !s32i // CHECK: %[[#RET:]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CHECK: %[[#A:]] = cir.alloca !s32i, !cir.ptr, ["a", init] // CHECK: %[[#ATMP:]] = cir.const #cir.int<1> : !s32i @@ -62,7 +62,7 @@ int dec0() { return a; } -// CHECK: cir.func @_Z4dec0v() -> !s32i +// CHECK: cir.func dso_local @_Z4dec0v() -> !s32i // CHECK: %[[#RET:]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CHECK: %[[#A:]] = cir.alloca !s32i, !cir.ptr, ["a", init] // CHECK: %[[#ATMP:]] = cir.const #cir.int<1> : !s32i @@ -82,7 +82,7 @@ int inc1() { return a; } -// CHECK: cir.func @_Z4inc1v() -> !s32i +// CHECK: cir.func dso_local @_Z4inc1v() -> !s32i // CHECK: %[[#RET:]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CHECK: %[[#A:]] = cir.alloca !s32i, !cir.ptr, ["a", init] // CHECK: %[[#ATMP:]] = cir.const #cir.int<1> : !s32i @@ -101,7 +101,7 @@ int dec1() { return a; } -// CHECK: cir.func @_Z4dec1v() -> !s32i +// CHECK: cir.func dso_local @_Z4dec1v() -> !s32i // CHECK: %[[#RET:]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CHECK: %[[#A:]] = cir.alloca !s32i, !cir.ptr, ["a", init] // CHECK: %[[#ATMP:]] = cir.const #cir.int<1> : !s32i @@ -121,7 +121,7 @@ int inc2() { return b; } -// CHECK: cir.func @_Z4inc2v() -> !s32i +// CHECK: cir.func dso_local @_Z4inc2v() -> !s32i // CHECK: %[[#RET:]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // CHECK: %[[#A:]] = cir.alloca !s32i, !cir.ptr, ["a", init] // CHECK: %[[#B:]] = cir.alloca !s32i, !cir.ptr, ["b", init] @@ -142,7 +142,7 @@ int *inc_p(int *i) { return i; } -// CHECK: cir.func @_Z5inc_pPi(%arg0: !cir.ptr +// CHECK: cir.func dso_local @_Z5inc_pPi(%arg0: !cir.ptr // CHECK: %[[#i_addr:]] = cir.alloca !cir.ptr, !cir.ptr>, ["i", init] {alignment = 8 : i64} // CHECK: %[[#i_dec:]] = cir.load{{.*}} %[[#i_addr]] : !cir.ptr>, !cir.ptr @@ -154,7 +154,7 @@ int *inc_p(int *i) { // CHECK: = cir.ptr_stride(%[[#i_inc]] : !cir.ptr, %[[#inc_const]] : !s32i), !cir.ptr void floats(float f) { -// CHECK: cir.func @{{.+}}floats{{.+}} +// CHECK: cir.func dso_local @{{.+}}floats{{.+}} f = +f; // CHECK: %{{[0-9]+}} = cir.unary(plus, %{{[0-9]+}}) : !cir.float, !cir.float f = -f; // CHECK: %{{[0-9]+}} = cir.unary(minus, %{{[0-9]+}}) : !cir.float, !cir.float ++f; // CHECK: = cir.unary(inc, %{{[0-9]+}}) : !cir.float, !cir.float @@ -168,7 +168,7 @@ void floats(float f) { } void doubles(double d) { -// CHECK: cir.func @{{.+}}doubles{{.+}} +// CHECK: cir.func dso_local @{{.+}}doubles{{.+}} d = +d; // CHECK: %{{[0-9]+}} = cir.unary(plus, %{{[0-9]+}}) : !cir.double, !cir.double d = -d; // CHECK: %{{[0-9]+}} = cir.unary(minus, %{{[0-9]+}}) : !cir.double, !cir.double ++d; // CHECK: = cir.unary(inc, %{{[0-9]+}}) : !cir.double, !cir.double @@ -182,7 +182,7 @@ void doubles(double d) { } void pointers(int *p) { -// CHECK: cir.func @{{[^ ]+}}pointers +// CHECK: cir.func dso_local @{{[^ ]+}}pointers // CHECK: %[[#P:]] = cir.alloca !cir.ptr, !cir.ptr> p = +p; @@ -211,7 +211,7 @@ void pointers(int *p) { } void chars(char c) { -// CHECK: cir.func @{{.+}}chars{{.+}} +// CHECK: cir.func dso_local @{{.+}}chars{{.+}} int c1 = +c; // CHECK: %[[#PROMO:]] = cir.cast(integral, %{{.+}} : !s8i), !s32i diff --git a/clang/test/CIR/CodeGen/union-array.c b/clang/test/CIR/CodeGen/union-array.c index 27b6392bce2a..0976809e96af 100644 --- a/clang/test/CIR/CodeGen/union-array.c +++ b/clang/test/CIR/CodeGen/union-array.c @@ -36,7 +36,7 @@ void foo() { U arr[2] = {{.b = {1, 2}}, {.a = {1}}}; } void bar(void) { int *x[2] = { &g.f0, &g.f0 }; } -// CIR: cir.global "private" internal dsolocal @g = #cir.const_record<{#cir.int<5> : !s32i}> : !rec_anon_struct +// CIR: cir.global "private" internal dso_local @g = #cir.const_record<{#cir.int<5> : !s32i}> : !rec_anon_struct // CIR: cir.const #cir.const_array<[#cir.global_view<@g> : !cir.ptr, #cir.global_view<@g> : !cir.ptr]> : !cir.array x 2> typedef struct { diff --git a/clang/test/CIR/CodeGen/union-init.c b/clang/test/CIR/CodeGen/union-init.c index 55380e063109..874e2a5b24af 100644 --- a/clang/test/CIR/CodeGen/union-init.c +++ b/clang/test/CIR/CodeGen/union-init.c @@ -18,7 +18,7 @@ void foo(int x) { // CHECK-DAG: #[[bfi_y:.*]] = #cir.bitfield_info // CHECK-DAG: ![[anon1:.*]] = !cir.record} -// CHECK-LABEL: cir.func @foo( +// CHECK-LABEL: cir.func dso_local @foo( // CHECK: %[[VAL_1:.*]] = cir.alloca !s32i, !cir.ptr, ["x", init] {alignment = 4 : i64} // CHECK: %[[VAL_2:.*]] = cir.alloca !rec_A, !cir.ptr, ["a", init] {alignment = 4 : i64} // CHECK: cir.store{{.*}} {{.*}}, %[[VAL_1]] : !s32i, !cir.ptr @@ -42,7 +42,7 @@ unsigned is_little(void) { return one.c[0]; } -// CHECK: cir.func @is_little +// CHECK: cir.func dso_local @is_little // CHECK: %[[VAL_1:.*]] = cir.get_global @is_little.one : !cir.ptr // CHECK: %[[VAL_2:.*]] = cir.cast(bitcast, %[[VAL_1]] : !cir.ptr), !cir.ptr // CHECK: %[[VAL_3:.*]] = cir.get_member %[[VAL_2]][1] {name = "c"} : !cir.ptr -> !cir.ptr> diff --git a/clang/test/CIR/CodeGen/union.cpp b/clang/test/CIR/CodeGen/union.cpp index fb2072e58435..96fe3e4be852 100644 --- a/clang/test/CIR/CodeGen/union.cpp +++ b/clang/test/CIR/CodeGen/union.cpp @@ -49,7 +49,7 @@ void m() { yolm3 q3; } -// CHECK: cir.func @_Z1mv() +// CHECK: cir.func dso_local @_Z1mv() // CHECK: cir.alloca !rec_yolm, !cir.ptr, ["q"] {alignment = 4 : i64} // CHECK: cir.alloca !rec_yolm2, !cir.ptr, ["q2"] {alignment = 8 : i64} // CHECK: cir.alloca !rec_yolm3, !cir.ptr, ["q3"] {alignment = 4 : i64} diff --git a/clang/test/CIR/CodeGen/unreachable.cpp b/clang/test/CIR/CodeGen/unreachable.cpp index c617fe8c6212..07c4fc434e4e 100644 --- a/clang/test/CIR/CodeGen/unreachable.cpp +++ b/clang/test/CIR/CodeGen/unreachable.cpp @@ -8,7 +8,7 @@ void basic() { __builtin_unreachable(); } -// CHECK: cir.func @_Z5basicv() +// CHECK: cir.func dso_local @_Z5basicv() // CHECK-NEXT: cir.call @_Z3foov() : () -> () // CHECK-NEXT: cir.unreachable // CHECK-NEXT: } @@ -19,7 +19,7 @@ void code_after_unreachable() { foo(); } -// CHECK: cir.func @_Z22code_after_unreachablev() +// CHECK: cir.func dso_local @_Z22code_after_unreachablev() // CHECK: cir.call @_Z3foov() : () -> () // CHECK: cir.unreachable // CHECK: ^{{.+}}: diff --git a/clang/test/CIR/CodeGen/uwtable.cpp b/clang/test/CIR/CodeGen/uwtable.cpp index ff9d9873f9b6..e3ca5b2bb87b 100644 --- a/clang/test/CIR/CodeGen/uwtable.cpp +++ b/clang/test/CIR/CodeGen/uwtable.cpp @@ -19,15 +19,15 @@ // CIR-NONE-NOT: #cir.uwtable // CIR-SYNC-DAG: module {{.*}} attributes {{{.*}}cir.uwtable = #cir.uwtable -// CIR-SYNC-DAG: cir.func @_Z1fv() extra(#[[f_attr:.*]]) -// CIR-SYNC-DAG: cir.func @_Z1gv() extra(#[[g_attr:.*]]) +// CIR-SYNC-DAG: cir.func dso_local @_Z1fv() extra(#[[f_attr:.*]]) +// CIR-SYNC-DAG: cir.func dso_local @_Z1gv() extra(#[[g_attr:.*]]) // CIR-SYNC-DAG: #[[f_attr]] = #cir // CIR-SYNC-DAG: #[[g_attr]] = // CIR-SYNC-NOT: #cir.uwtable // CIR-ASYNC-DAG: module {{.*}} attributes {{{.*}}cir.uwtable = #cir.uwtable -// CIR-ASYNC-DAG: cir.func @_Z1fv() extra(#[[f_attr:.*]]) -// CIR-ASYNC-DAG: cir.func @_Z1gv() extra(#[[g_attr:.*]]) +// CIR-ASYNC-DAG: cir.func dso_local @_Z1fv() extra(#[[f_attr:.*]]) +// CIR-ASYNC-DAG: cir.func dso_local @_Z1gv() extra(#[[g_attr:.*]]) // CIR-ASYNC-DAG: #[[f_attr]] = #cir // CIR-ASYNC-DAG: #[[g_attr]] = // CIR-ASYNC-NOT: #cir.uwtable diff --git a/clang/test/CIR/CodeGen/var-arg-float.c b/clang/test/CIR/CodeGen/var-arg-float.c index 8132416a257a..040e025f19f9 100644 --- a/clang/test/CIR/CodeGen/var-arg-float.c +++ b/clang/test/CIR/CodeGen/var-arg-float.c @@ -14,7 +14,7 @@ double f1(int n, ...) { } // BEFORE: !rec___va_list = !cir.record, !cir.ptr, !cir.ptr, !s32i, !s32i} -// BEFORE: cir.func @f1(%arg0: !s32i, ...) -> !cir.double +// BEFORE: cir.func dso_local @f1(%arg0: !s32i, ...) -> !cir.double // BEFORE: [[RETP:%.*]] = cir.alloca !cir.double, !cir.ptr, ["__retval"] // BEFORE: [[RESP:%.*]] = cir.alloca !cir.double, !cir.ptr, ["res", init] // BEFORE: cir.va.start [[VARLIST:%.*]] : !cir.ptr @@ -28,7 +28,7 @@ double f1(int n, ...) { // beginning block cir code // AFTER: !rec___va_list = !cir.record, !cir.ptr, !cir.ptr, !s32i, !s32i} -// AFTER: cir.func @f1(%arg0: !s32i, ...) -> !cir.double +// AFTER: cir.func dso_local @f1(%arg0: !s32i, ...) -> !cir.double // AFTER: [[RETP:%.*]] = cir.alloca !cir.double, !cir.ptr, ["__retval"] // AFTER: [[RESP:%.*]] = cir.alloca !cir.double, !cir.ptr, ["res", init] // AFTER: cir.va.start [[VARLIST:%.*]] : !cir.ptr diff --git a/clang/test/CIR/CodeGen/var-arg-scope.c b/clang/test/CIR/CodeGen/var-arg-scope.c index 8f2650634d32..0eb62ceac23d 100644 --- a/clang/test/CIR/CodeGen/var-arg-scope.c +++ b/clang/test/CIR/CodeGen/var-arg-scope.c @@ -7,7 +7,7 @@ void f1(__builtin_va_list c) { { __builtin_va_arg(c, void *); } } -// BEFORE: cir.func @f1(%arg0: !rec___va_list) attributes +// BEFORE: cir.func dso_local @f1(%arg0: !rec___va_list) attributes // BEFORE: [[VAR_LIST:%.*]] = cir.alloca !rec___va_list, !cir.ptr, ["c", init] {alignment = 8 : i64} // BEFORE: cir.store %arg0, [[VAR_LIST]] : !rec___va_list, !cir.ptr // BEFORE: cir.scope { @@ -15,7 +15,7 @@ void f1(__builtin_va_list c) { // BEFORE-NEXT: } // BEFORE-NEXT: cir.return -// AFTER: cir.func @f1(%arg0: !rec___va_list) attributes +// AFTER: cir.func dso_local @f1(%arg0: !rec___va_list) attributes // AFTER: [[VARLIST:%.*]] = cir.alloca !rec___va_list, !cir.ptr, ["c", init] {alignment = 8 : i64} // AFTER: cir.store %arg0, [[VARLIST]] : !rec___va_list, !cir.ptr // AFTER: cir.scope { diff --git a/clang/test/CIR/CodeGen/var-arg.c b/clang/test/CIR/CodeGen/var-arg.c index 163e2ed111ac..e144a4c11db8 100644 --- a/clang/test/CIR/CodeGen/var-arg.c +++ b/clang/test/CIR/CodeGen/var-arg.c @@ -14,7 +14,7 @@ int f1(int n, ...) { } // BEFORE: !rec___va_list = !cir.record, !cir.ptr, !cir.ptr, !s32i, !s32i} -// BEFORE: cir.func @f1(%arg0: !s32i, ...) -> !s32i +// BEFORE: cir.func dso_local @f1(%arg0: !s32i, ...) -> !s32i // BEFORE: [[RETP:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // BEFORE: [[RESP:%.*]] = cir.alloca !s32i, !cir.ptr, ["res", init] // BEFORE: cir.va.start [[VARLIST:%.*]] : !cir.ptr @@ -27,7 +27,7 @@ int f1(int n, ...) { // BEFORE: cir.return [[RETV]] : !s32i // AFTER: !rec___va_list = !cir.record, !cir.ptr, !cir.ptr, !s32i, !s32i} -// AFTER: cir.func @f1(%arg0: !s32i, ...) -> !s32i +// AFTER: cir.func dso_local @f1(%arg0: !s32i, ...) -> !s32i // AFTER: [[RETP:%.*]] = cir.alloca !s32i, !cir.ptr, ["__retval"] // AFTER: [[RESP:%.*]] = cir.alloca !s32i, !cir.ptr, ["res", init] // AFTER: cir.va.start [[VARLIST:%.*]] : !cir.ptr diff --git a/clang/test/CIR/CodeGen/variadics.c b/clang/test/CIR/CodeGen/variadics.c index 6cfc71aa5fc4..caa8a73b5446 100644 --- a/clang/test/CIR/CodeGen/variadics.c +++ b/clang/test/CIR/CodeGen/variadics.c @@ -11,8 +11,8 @@ typedef __builtin_va_list va_list; // CHECK: [[VALISTTYPE:!.+va_list.*]] = !cir.record !s32i -// AMR64_CHECK: cir.func @{{.*}}average{{.*}}(%arg0: !s32i loc({{.+}}), ...) -> !s32i +// CHECK: cir.func dso_local @{{.*}}average{{.*}}(%arg0: !s32i, ...) -> !s32i +// AMR64_CHECK: cir.func dso_local @{{.*}}average{{.*}}(%arg0: !s32i loc({{.+}}), ...) -> !s32i va_list args, args_copy; va_start(args, count); // CHECK: cir.va.start %{{[0-9]+}} : !cir.ptr<[[VALISTTYPE]]> diff --git a/clang/test/CIR/CodeGen/vectype-ext.cpp b/clang/test/CIR/CodeGen/vectype-ext.cpp index 82823f0e8b19..ec177aaeac66 100644 --- a/clang/test/CIR/CodeGen/vectype-ext.cpp +++ b/clang/test/CIR/CodeGen/vectype-ext.cpp @@ -40,7 +40,7 @@ vi4 vec_e = { 1, 2, 3, 4 }; // LLVM: @[[VEC_E:.*]] = global <4 x i32> -// CIR: cir.func {{@.*vector_int_test.*}} +// CIR: cir.func dso_local {{@.*vector_int_test.*}} // LLVM: define dso_local void {{@.*vector_int_test.*}} void vector_int_test(int x) { @@ -225,7 +225,7 @@ void vector_int_test(int x) { // LLVM-NEXT: store <4 x i32> %[[#INS4]], ptr %{{[0-9]+}}, align 16 } -// CIR: cir.func {{@.*vector_double_test.*}} +// CIR: cir.func dso_local {{@.*vector_double_test.*}} // LLVM: define dso_local void {{@.*vector_double_test.*}} void vector_double_test(int x, double y) { // Vector constant. @@ -339,7 +339,7 @@ void vector_double_test(int x, double y) { // LLVM: %{{[0-9]+}} = fptoui <2 x double> %{{[0-9]+}} to <2 x i16> } -// CIR: cir.func {{@.*test_load.*}} +// CIR: cir.func dso_local {{@.*test_load.*}} // LLVM: define dso_local void {{@.*test_load.*}} void test_load() { vi4 a = { 1, 2, 3, 4 }; @@ -367,7 +367,7 @@ void test_load() { } -// CIR: cir.func {{@.*test_store.*}} +// CIR: cir.func dso_local {{@.*test_store.*}} // LLVM: define dso_local void {{@.*test_store.*}} void test_store() { vi4 a; @@ -452,7 +452,7 @@ void test_store() { } -// CIR: cir.func {{@.*test_build_lvalue.*}} +// CIR: cir.func dso_local {{@.*test_build_lvalue.*}} // LLVM: define dso_local void {{@.*test_build_lvalue.*}} void test_build_lvalue() { // special cases only @@ -515,7 +515,7 @@ void test_build_lvalue() { } -// CIR: cir.func {{@.*test_vec3.*}} +// CIR: cir.func dso_local {{@.*test_vec3.*}} // LLVM: define dso_local void {{@.*test_vec3.*}} void test_vec3() { vi3 v = {}; diff --git a/clang/test/CIR/CodeGen/virtual-destructor-calls.cpp b/clang/test/CIR/CodeGen/virtual-destructor-calls.cpp index 5c453b7fd84f..874a0b75ca96 100644 --- a/clang/test/CIR/CodeGen/virtual-destructor-calls.cpp +++ b/clang/test/CIR/CodeGen/virtual-destructor-calls.cpp @@ -24,7 +24,7 @@ struct B : A { }; // Base dtor: actually calls A's base dtor. -// CIR: cir.func @_ZN1BD2Ev +// CIR: cir.func dso_local @_ZN1BD2Ev // CIR: cir.call @_ZN6MemberD1Ev // CIR: cir.call @_ZN1AD2Ev // LLVM: define{{.*}} void @_ZN1BD2Ev(ptr @@ -32,7 +32,7 @@ struct B : A { // LLVM: call void @_ZN1AD2Ev // Complete dtor: just an alias because there are no virtual bases. -// CIR: cir.func private @_ZN1BD1Ev(!cir.ptr) alias(@_ZN1BD2Ev) +// CIR: cir.func private dso_local @_ZN1BD1Ev(!cir.ptr) alias(@_ZN1BD2Ev) // FIXME: LLVM output should be: @_ZN1BD1Ev ={{.*}} unnamed_addr alias {{.*}} @_ZN1BD2Ev // LLVM: declare dso_local void @_ZN1BD1Ev(ptr) @@ -42,12 +42,12 @@ struct B : A { // LLVM: call void @_ZdlPv // (aliases from C) -// CIR: cir.func @_ZN1CD2Ev(%arg0: !cir.ptr{{.*}})) {{.*}} { -// CIR: cir.func private @_ZN1CD1Ev(!cir.ptr) alias(@_ZN1CD2Ev) +// CIR: cir.func dso_local @_ZN1CD2Ev(%arg0: !cir.ptr{{.*}})) {{.*}} { +// CIR: cir.func private dso_local @_ZN1CD1Ev(!cir.ptr) alias(@_ZN1CD2Ev) -// CIR_O1-NOT: cir.func @_ZN1CD2Ev(%arg0: !cir.ptr{{.*}})) {{.*}} { -// CIR_O1: cir.func private @_ZN1CD2Ev(!cir.ptr) alias(@_ZN1BD2Ev) -// CIR_O1: cir.func private @_ZN1CD1Ev(!cir.ptr) alias(@_ZN1CD2Ev) +// CIR_O1-NOT: cir.func dso_local @_ZN1CD2Ev(%arg0: !cir.ptr{{.*}})) {{.*}} { +// CIR_O1: cir.func private dso_local @_ZN1CD2Ev(!cir.ptr) alias(@_ZN1BD2Ev) +// CIR_O1: cir.func private dso_local @_ZN1CD1Ev(!cir.ptr) alias(@_ZN1CD2Ev) // FIXME: LLVM output should be: @_ZN1CD2Ev ={{.*}} unnamed_addr alias {{.*}} @_ZN1BD2Ev // LLVM: define dso_local void @_ZN1CD2Ev(ptr @@ -68,7 +68,7 @@ C::~C() { } // Complete dtor: just an alias (checked above). // Deleting dtor: defers to the complete dtor. -// CIR: cir.func @_ZN1CD0Ev +// CIR: cir.func dso_local @_ZN1CD0Ev // CIR: cir.call @_ZN1CD1Ev // CIR: cir.call @_ZdlPvm // LLVM: define{{.*}} void @_ZN1CD0Ev(ptr diff --git a/clang/test/CIR/CodeGen/visibility-attribute.c b/clang/test/CIR/CodeGen/visibility-attribute.c index 9edca315fd2a..145b04698b77 100644 --- a/clang/test/CIR/CodeGen/visibility-attribute.c +++ b/clang/test/CIR/CodeGen/visibility-attribute.c @@ -33,15 +33,15 @@ void __attribute__((__visibility__("protected"))) foo_protected(); // LLVM: declare protected void @foo_protected(...) static void static_foo_default() {} -// CIR: cir.func no_proto internal private @static_foo_default() +// CIR: cir.func no_proto internal private dso_local @static_foo_default() // LLVM: define internal void @static_foo_default() static void __attribute__((__visibility__("hidden"))) static_foo_hidden() {} -// CIR: cir.func no_proto internal private @static_foo_hidden() +// CIR: cir.func no_proto internal private dso_local @static_foo_hidden() // LLVM: define internal void @static_foo_hidden() static void __attribute__((__visibility__("protected"))) static_foo_protected() {} -// CIR: cir.func no_proto internal private @static_foo_protected() +// CIR: cir.func no_proto internal private dso_local @static_foo_protected() // LLVM: define internal void @static_foo_protected() void call_foo() diff --git a/clang/test/CIR/CodeGen/vla.c b/clang/test/CIR/CodeGen/vla.c index 70cdf45def15..b3133e271691 100644 --- a/clang/test/CIR/CodeGen/vla.c +++ b/clang/test/CIR/CodeGen/vla.c @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - | FileCheck %s -// CHECK: cir.func @f0(%arg0: !s32i +// CHECK: cir.func dso_local @f0(%arg0: !s32i // CHECK: [[TMP0:%.*]] = cir.alloca !s32i, !cir.ptr, ["len", init] {alignment = 4 : i64} // CHECK: [[TMP1:%.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["saved_stack"] {alignment = 8 : i64} // CHECK: cir.store{{.*}} %arg0, [[TMP0]] : !s32i, !cir.ptr @@ -15,7 +15,7 @@ void f0(int len) { int a[len]; } -// CHECK: cir.func @f1 +// CHECK: cir.func dso_local @f1 // CHECK-NOT: cir.stack_save // CHECK-NOT: cir.stack_restore // CHECK: cir.return @@ -23,7 +23,7 @@ int f1(int n) { return sizeof(int[n]); } -// CHECK: cir.func @f2 +// CHECK: cir.func dso_local @f2 // CHECK: cir.stack_save // DONT_CHECK: cir.stack_restore // CHECK: cir.return @@ -32,7 +32,7 @@ int f2(int x) { return vla[x-1]; } -// CHECK: cir.func @f3 +// CHECK: cir.func dso_local @f3 // CHECK: cir.stack_save // CHECK: cir.stack_restore // CHECK: cir.return @@ -44,7 +44,7 @@ void f3(int count) { } -// CHECK: cir.func @f4 +// CHECK: cir.func dso_local @f4 // CHECK-NOT: cir.stack_save // CHECK-NOT: cir.stack_restore // CHECK: cir.return @@ -54,7 +54,7 @@ void f4(int count) { int (*b)[][count]; } -// FIXME(cir): the test is commented due to stack_restore operation +// FIXME(cir): the test is commented due to stack_restore operation // is not emitted for the if branch // void f5(unsigned x) { // while (1) { @@ -65,13 +65,13 @@ void f4(int count) { // } // Check no errors happen -void function1(short width, int data[][width]) {} +void function1(short width, int data[][width]) {} void function2(short width, int data[][width][width]) {} void f6(void) { int bork[4][13][15]; function1(1, bork[2]); - function2(1, bork); + function2(1, bork); } static int GLOB; diff --git a/clang/test/CIR/CodeGen/volatile.cpp b/clang/test/CIR/CodeGen/volatile.cpp index 43bb668c88f0..2bb45c98acfe 100644 --- a/clang/test/CIR/CodeGen/volatile.cpp +++ b/clang/test/CIR/CodeGen/volatile.cpp @@ -5,14 +5,14 @@ int test_load(volatile int *ptr) { return *ptr; } -// CHECK: cir.func @_Z9test_loadPVi +// CHECK: cir.func dso_local @_Z9test_loadPVi // CHECK: %{{.+}} = cir.load volatile void test_store(volatile int *ptr) { *ptr = 42; } -// CHECK: cir.func @_Z10test_storePVi +// CHECK: cir.func dso_local @_Z10test_storePVi // CHECK: cir.store volatile struct Foo { @@ -25,7 +25,7 @@ int test_load_field1(volatile Foo *ptr) { return ptr->x; } -// CHECK: cir.func @_Z16test_load_field1PV3Foo +// CHECK: cir.func dso_local @_Z16test_load_field1PV3Foo // CHECK: %[[MemberAddr:.*]] = cir.get_member // CHECK: %{{.+}} = cir.load volatile{{.*}} %[[MemberAddr]] @@ -33,7 +33,7 @@ int test_load_field2(Foo *ptr) { return ptr->y; } -// CHECK: cir.func @_Z16test_load_field2P3Foo +// CHECK: cir.func dso_local @_Z16test_load_field2P3Foo // CHECK: %[[MemberAddr:.+]] = cir.get_member // CHECK: %{{.+}} = cir.load volatile{{.*}} %[[MemberAddr]] @@ -41,7 +41,7 @@ int test_load_field3(Foo *ptr) { return ptr->z; } -// CHECK: cir.func @_Z16test_load_field3P3Foo +// CHECK: cir.func dso_local @_Z16test_load_field3P3Foo // CHECK: %[[MemberAddr:.+]] = cir.get_member // CHECK: %{{.+}} = cir.get_bitfield(#bfi_z, %[[MemberAddr:.+]] {is_volatile} @@ -49,7 +49,7 @@ void test_store_field1(volatile Foo *ptr) { ptr->x = 42; } -// CHECK: cir.func @_Z17test_store_field1PV3Foo +// CHECK: cir.func dso_local @_Z17test_store_field1PV3Foo // CHECK: %[[MemberAddr:.+]] = cir.get_member // CHECK: cir.store volatile{{.*}} %{{.+}}, %[[MemberAddr]] @@ -57,7 +57,7 @@ void test_store_field2(Foo *ptr) { ptr->y = 42; } -// CHECK: cir.func @_Z17test_store_field2P3Foo +// CHECK: cir.func dso_local @_Z17test_store_field2P3Foo // CHECK: %[[MemberAddr:.+]] = cir.get_member // CHECK: cir.store volatile{{.*}} %{{.+}}, %[[MemberAddr]] @@ -65,6 +65,6 @@ void test_store_field3(Foo *ptr) { ptr->z = 4; } -// CHECK: cir.func @_Z17test_store_field3P3Foo +// CHECK: cir.func dso_local @_Z17test_store_field3P3Foo // CHECK: %[[MemberAddr:.+]] = cir.get_member // CHECK: cir.set_bitfield(#bfi_z, %[[MemberAddr:.+]] : !cir.ptr, %1 : !s32i) {is_volatile} diff --git a/clang/test/CIR/CodeGen/vtable-rtti.cpp b/clang/test/CIR/CodeGen/vtable-rtti.cpp index 6c3e976ca5c7..17ec1223cf73 100644 --- a/clang/test/CIR/CodeGen/vtable-rtti.cpp +++ b/clang/test/CIR/CodeGen/vtable-rtti.cpp @@ -53,7 +53,7 @@ class B : public A // foo - zero initialize object B and call ctor (@B::B()) // -// CHECK: cir.func @_Z3foov() +// CHECK: cir.func dso_local @_Z3foov() // CHECK: cir.scope { // CHECK: %0 = cir.alloca !rec_B, !cir.ptr, ["agg.tmp.ensured"] {alignment = 8 : i64} // CHECK: %1 = cir.const #cir.zero : ![[ClassB]] diff --git a/clang/test/CIR/CodeGen/vtt.cpp b/clang/test/CIR/CodeGen/vtt.cpp index 5c22777d300f..6aab0f8da52d 100644 --- a/clang/test/CIR/CodeGen/vtt.cpp +++ b/clang/test/CIR/CodeGen/vtt.cpp @@ -165,7 +165,7 @@ namespace other { } } -// CIR-LABEL: cir.func @_ZN5other1BD1Ev( +// CIR-LABEL: cir.func dso_local @_ZN5other1BD1Ev( // CIR-SAME: %[[VAL_0:.*]]: !cir.ptr // CIR: %[[VAL_1:.*]] = cir.alloca !cir.ptr, !cir.ptr>, ["this", init] {alignment = 8 : i64} // CIR: cir.store{{.*}} %[[VAL_0]], %[[VAL_1]] : !cir.ptr, !cir.ptr> diff --git a/clang/test/CIR/CodeGen/weak.c b/clang/test/CIR/CodeGen/weak.c index 28d4aa5a595a..0dc93f351cfc 100644 --- a/clang/test/CIR/CodeGen/weak.c +++ b/clang/test/CIR/CodeGen/weak.c @@ -15,7 +15,7 @@ void active (void) // LLVM: @x = weak global // CIR: cir.func extern_weak private @B() -// CIR: cir.func @active() +// CIR: cir.func dso_local @active() // CIR-NEXT: cir.call @B() : () -> () // LLVM: declare extern_weak void @B() diff --git a/clang/test/CIR/CodeGen/wide-string.cpp b/clang/test/CIR/CodeGen/wide-string.cpp index 3e3292510d9f..0f1f745ab3ff 100644 --- a/clang/test/CIR/CodeGen/wide-string.cpp +++ b/clang/test/CIR/CodeGen/wide-string.cpp @@ -5,22 +5,22 @@ const char16_t *test_utf16() { return u"你好世界"; } -// CHECK: cir.global "private" constant cir_private dsolocal @{{.+}} = #cir.const_array<[#cir.int<20320> : !u16i, #cir.int<22909> : !u16i, #cir.int<19990> : !u16i, #cir.int<30028> : !u16i, #cir.int<0> : !u16i]> : !cir.array +// CHECK: cir.global "private" constant cir_private dso_local @{{.+}} = #cir.const_array<[#cir.int<20320> : !u16i, #cir.int<22909> : !u16i, #cir.int<19990> : !u16i, #cir.int<30028> : !u16i, #cir.int<0> : !u16i]> : !cir.array const char32_t *test_utf32() { return U"你好世界"; } -// CHECK: cir.global "private" constant cir_private dsolocal @{{.+}} = #cir.const_array<[#cir.int<20320> : !u32i, #cir.int<22909> : !u32i, #cir.int<19990> : !u32i, #cir.int<30028> : !u32i, #cir.int<0> : !u32i]> : !cir.array +// CHECK: cir.global "private" constant cir_private dso_local @{{.+}} = #cir.const_array<[#cir.int<20320> : !u32i, #cir.int<22909> : !u32i, #cir.int<19990> : !u32i, #cir.int<30028> : !u32i, #cir.int<0> : !u32i]> : !cir.array const char16_t *test_zero16() { return u"\0\0\0\0"; } -// CHECK: cir.global "private" constant cir_private dsolocal @{{.+}} = #cir.zero : !cir.array +// CHECK: cir.global "private" constant cir_private dso_local @{{.+}} = #cir.zero : !cir.array const char32_t *test_zero32() { return U"\0\0\0\0"; } -// CHECK: cir.global "private" constant cir_private dsolocal @{{.+}} = #cir.zero : !cir.array +// CHECK: cir.global "private" constant cir_private dso_local @{{.+}} = #cir.zero : !cir.array diff --git a/clang/test/CIR/IR/func-dsolocal-parser.cir b/clang/test/CIR/IR/func-dsolocal-parser.cir index 9737279ce144..4e4bbf3880d4 100644 --- a/clang/test/CIR/IR/func-dsolocal-parser.cir +++ b/clang/test/CIR/IR/func-dsolocal-parser.cir @@ -3,11 +3,11 @@ !s32i = !cir.int #fn_attr = #cir, nothrow = #cir.nothrow, optnone = #cir.optnone})> module { - cir.func dsolocal @foo(%arg0: !s32i ) extra(#fn_attr) { + cir.func dso_local @foo(%arg0: !s32i ) extra(#fn_attr) { %0 = cir.alloca !s32i, !cir.ptr, ["i", init] {alignment = 4 : i64} cir.store %arg0, %0 : !s32i, !cir.ptr cir.return } } -// CHECK: cir.func @foo(%arg0: !s32i) extra(#fn_attr) +// CHECK: cir.func dso_local @foo(%arg0: !s32i) extra(#fn_attr) diff --git a/clang/test/CIR/IR/invalid.cir b/clang/test/CIR/IR/invalid.cir index db83df62584d..3f9c38d724bc 100644 --- a/clang/test/CIR/IR/invalid.cir +++ b/clang/test/CIR/IR/invalid.cir @@ -1533,7 +1533,7 @@ cir.func @cast0(%arg0: !s32i, %arg1: !s32i) { !s32i = !cir.int // expected-error @below {{!cir.func cannot have an explicit 'void' return type}} // expected-error @below {{failed to parse CIR_PointerType parameter}} -cir.global external dsolocal @vfp = #cir.ptr : !cir.ptr !cir.void>> +cir.global external dso_local @vfp = #cir.ptr : !cir.ptr !cir.void>> // ----- diff --git a/clang/test/CIR/Lowering/globals.cir b/clang/test/CIR/Lowering/globals.cir index b9142c7babe0..85b56fc22bf4 100644 --- a/clang/test/CIR/Lowering/globals.cir +++ b/clang/test/CIR/Lowering/globals.cir @@ -165,7 +165,7 @@ module { // LLVM: @undefStruct = global %struct.Bar undef cir.global "private" internal @Handlers = #cir.const_array<[#cir.const_record<{#cir.global_view<@myfun> : !cir.ptr>}> : !rec_anon2E1_]> : !cir.array - cir.func internal private @myfun(%arg0: !s32i) { + cir.func internal private dso_local @myfun(%arg0: !s32i) { %0 = cir.alloca !s32i, !cir.ptr, ["a", init] {alignment = 4 : i64} cir.store %arg0, %0 : !s32i, !cir.ptr cir.return diff --git a/clang/test/CIR/Lowering/try-catch.cpp b/clang/test/CIR/Lowering/try-catch.cpp index 068d8c10b3b3..ca54cb027abd 100644 --- a/clang/test/CIR/Lowering/try-catch.cpp +++ b/clang/test/CIR/Lowering/try-catch.cpp @@ -4,8 +4,8 @@ // RUN_DISABLED: FileCheck --input-file=%t.flat.cir --check-prefix=CIR_LLVM %s double division(int a, int b); -// CIR: cir.func @_Z2tcv() -// CIR_FLAT: cir.func @_Z2tcv() +// CIR: cir.func dso_local @_Z2tcv() +// CIR_FLAT: cir.func dso_local @_Z2tcv() unsigned long long tc() { int x = 50, y = 3; unsigned long long z; @@ -60,7 +60,7 @@ unsigned long long tc() { return z; } -// CIR_FLAT: cir.func @_Z3tc2v +// CIR_FLAT: cir.func dso_local @_Z3tc2v unsigned long long tc2() { int x = 50, y = 3; unsigned long long z; @@ -89,7 +89,7 @@ unsigned long long tc2() { return z; } -// CIR_FLAT: cir.func @_Z3tc3v +// CIR_FLAT: cir.func dso_local @_Z3tc3v unsigned long long tc3() { int x = 50, y = 3; unsigned long long z; @@ -109,4 +109,4 @@ unsigned long long tc3() { } return z; -} \ No newline at end of file +} diff --git a/clang/test/CIR/Lowering/var-arg-x86_64.c b/clang/test/CIR/Lowering/var-arg-x86_64.c index 5a33c4a84fa3..799f469e65f5 100644 --- a/clang/test/CIR/Lowering/var-arg-x86_64.c +++ b/clang/test/CIR/Lowering/var-arg-x86_64.c @@ -41,18 +41,18 @@ double f1(int n, ...) { // CHECK: [[VA_LIST3:%.+]] = getelementptr {{.*}} [[VA_LIST_ALLOCA]], i32 0 // CHECK: call {{.*}}@llvm.va_end.p0(ptr [[VA_LIST3]]) -// CIR: cir.func @f1 +// CIR: cir.func dso_local @f1 // CIR: [[VA_LIST_ALLOCA:%.+]] = cir.alloca !cir.array, // CIR: [[RES:%.+]] = cir.alloca !cir.double, !cir.ptr, ["res", -// CIR: [[VASTED_VA_LIST:%.+]] = cir.cast(array_to_ptrdecay, [[VA_LIST_ALLOCA]] +// CIR: [[VASTED_VA_LIST:%.+]] = cir.cast(array_to_ptrdecay, [[VA_LIST_ALLOCA]] // CIR: cir.va.start [[VASTED_VA_LIST]] -// CIR: [[VASTED_VA_LIST:%.+]] = cir.cast(array_to_ptrdecay, [[VA_LIST_ALLOCA]] +// CIR: [[VASTED_VA_LIST:%.+]] = cir.cast(array_to_ptrdecay, [[VA_LIST_ALLOCA]] // CIR: [[FP_OFFSET_P:%.+]] = cir.get_member [[VASTED_VA_LIST]][1] {name = "fp_offset"} // CIR: [[FP_OFFSET:%.+]] = cir.load [[FP_OFFSET_P]] // CIR: [[OFFSET_CONSTANT:%.+]] = cir.const #cir.int<160> // CIR: [[CMP:%.+]] = cir.cmp(le, [[FP_OFFSET]], [[OFFSET_CONSTANT]]) // CIR: cir.brcond [[CMP]] ^[[InRegBlock:.+]], ^[[InMemBlock:.+]] loc -// +// // CIR: ^[[InRegBlock]]: // CIR: [[REG_SAVE_AREA_P:%.+]] = cir.get_member [[VASTED_VA_LIST]][3] {name = "reg_save_area"} // CIR: [[REG_SAVE_AREA:%.+]] = cir.load [[REG_SAVE_AREA_P]] @@ -107,12 +107,12 @@ long double f2(int n, ...) { // CHECK: [[RETURN_VALUE:%.+]] = load x86_fp80, ptr [[RESULT]] // CHECK: ret x86_fp80 [[RETURN_VALUE]] -// CIR: cir.func @f2 +// CIR: cir.func dso_local @f2 // CIR: [[VA_LIST_ALLOCA:%.+]] = cir.alloca !cir.array, !cir.ptr>, ["valist"] // CIR: [[RES:%.+]] = cir.alloca !cir.long_double, !cir.ptr>, ["res" -// CIR: [[VASTED_VA_LIST:%.+]] = cir.cast(array_to_ptrdecay, [[VA_LIST_ALLOCA]] +// CIR: [[VASTED_VA_LIST:%.+]] = cir.cast(array_to_ptrdecay, [[VA_LIST_ALLOCA]] // CIR: cir.va.start [[VASTED_VA_LIST]] -// CIR: [[VASTED_VA_LIST:%.+]] = cir.cast(array_to_ptrdecay, [[VA_LIST_ALLOCA]] +// CIR: [[VASTED_VA_LIST:%.+]] = cir.cast(array_to_ptrdecay, [[VA_LIST_ALLOCA]] // CIR: [[OVERFLOW_AREA_P:%.+]] = cir.get_member [[VASTED_VA_LIST]][2] {name = "overflow_arg_area"} // CIR-DAG: [[OVERFLOW_AREA:%.+]] = cir.load [[OVERFLOW_AREA_P]] // CIR-DAG: [[CASTED:%.+]] = cir.cast(bitcast, [[OVERFLOW_AREA]] : !cir.ptr) diff --git a/clang/test/CIR/cirtool.cir b/clang/test/CIR/cirtool.cir index 8351d5be3165..c68e2dd649d2 100644 --- a/clang/test/CIR/cirtool.cir +++ b/clang/test/CIR/cirtool.cir @@ -4,7 +4,7 @@ // RUN: FileCheck --input-file=%t.ll %s -check-prefix=LLVM module { - cir.func @foo() { + cir.func dso_local @foo() { cir.return } } diff --git a/clang/test/CIR/driver.c b/clang/test/CIR/driver.c index f06db665ebbd..9fb907a7b7b2 100644 --- a/clang/test/CIR/driver.c +++ b/clang/test/CIR/driver.c @@ -30,7 +30,7 @@ void foo(void) {} // CIR: module {{.*}} { -// CIR-NEXT: cir.func @foo() +// CIR-NEXT: cir.func dso_local @foo() // CIR-NEXT: cir.return // CIR-NEXT: } // CIR-NEXT: } diff --git a/clang/test/CIR/emit-mlir.c b/clang/test/CIR/emit-mlir.c index fc7b04809352..4e9324b597aa 100644 --- a/clang/test/CIR/emit-mlir.c +++ b/clang/test/CIR/emit-mlir.c @@ -32,9 +32,9 @@ int foo(int a, int b) { // LLVM: llvm.func @foo // CORE: func.func @foo -// CIR: cir.func @foo +// CIR: cir.func dso_local @foo // CIR: cir.scope -// CIR_FLAT: cir.func @foo +// CIR_FLAT: cir.func dso_local @foo // CIR_FLAT: ^bb1 // CIR_FLAT-NOT: cir.scope // CORE_ERR: ClangIR direct lowering is incompatible with emitting of MLIR standard dialects diff --git a/clang/test/CIR/hello.c b/clang/test/CIR/hello.c index 7a806cfae85d..077f5c6ac908 100644 --- a/clang/test/CIR/hello.c +++ b/clang/test/CIR/hello.c @@ -2,4 +2,4 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - | FileCheck %s void foo() {} -// CHECK: cir.func no_proto @foo +// CHECK: cir.func no_proto dso_local @foo diff --git a/clang/test/CIR/mlirprint.c b/clang/test/CIR/mlirprint.c index a28e4e851992..90dfbc26f01b 100644 --- a/clang/test/CIR/mlirprint.c +++ b/clang/test/CIR/mlirprint.c @@ -12,20 +12,20 @@ int foo(void) { // CIR: IR Dump After CIRCanonicalize (cir-canonicalize) -// CIR: cir.func @foo() -> !s32i +// CIR: cir.func dso_local @foo() -> !s32i // CIR: IR Dump After LoweringPrepare (cir-lowering-prepare) -// CIR: cir.func @foo() -> !s32i +// CIR: cir.func dso_local @foo() -> !s32i // CIR-NOT: IR Dump After FlattenCFG // CIR-NOT: IR Dump After SCFPrepare // CIR: IR Dump After DropAST (cir-drop-ast) -// CIR: cir.func @foo() -> !s32i +// CIR: cir.func dso_local @foo() -> !s32i // CIRFLAT: IR Dump After CIRCanonicalize (cir-canonicalize) -// CIRFLAT: cir.func @foo() -> !s32i +// CIRFLAT: cir.func dso_local @foo() -> !s32i // CIRFLAT: IR Dump After LoweringPrepare (cir-lowering-prepare) -// CIRFLAT: cir.func @foo() -> !s32i +// CIRFLAT: cir.func dso_local @foo() -> !s32i // CIRFLAT: IR Dump After FlattenCFG (cir-flatten-cfg) // CIRFLAT: IR Dump After DropAST (cir-drop-ast) -// CIRFLAT: cir.func @foo() -> !s32i +// CIRFLAT: cir.func dso_local @foo() -> !s32i // CIRMLIR: IR Dump After CIRCanonicalize (cir-canonicalize) // CIRMLIR: IR Dump After LoweringPrepare (cir-lowering-prepare) // CIRMLIR: IR Dump After SCFPrepare (cir-mlir-scf-prepare