Skip to content

Commit be14e10

Browse files
committed
fix test. use 2>&1 | count 0 instead
Created using spr 1.3.5-bogner
2 parents 896ff29 + 211ee04 commit be14e10

File tree

44 files changed

+787
-128
lines changed

Some content is hidden

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

44 files changed

+787
-128
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ Bug Fixes to C++ Support
703703
certain differences in qualifiers (this could happen during template argument
704704
deduction or when building a ternary operator). (#GH97005)
705705
- Fixed type alias CTAD issues involving default template arguments. (#GH134471)
706+
- Fixed CTAD issues when initializing anonymous fields with designated initializers. (#GH67173)
706707
- The initialization kind of elements of structured bindings
707708
direct-list-initialized from an array is corrected to direct-initialization.
708709
- Clang no longer crashes when a coroutine is declared ``[[noreturn]]``. (#GH127327)

clang/lib/Format/Format.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3808,8 +3808,10 @@ reformat(const FormatStyle &Style, StringRef Code,
38083808
tooling::Replacements Replaces =
38093809
Formatter(*Env, Style, Status).process().first;
38103810
// add a replacement to remove the "x = " from the result.
3811-
Replaces = Replaces.merge(
3812-
tooling::Replacements(tooling::Replacement(FileName, 0, 4, "")));
3811+
if (Code.starts_with("x = ")) {
3812+
Replaces = Replaces.merge(
3813+
tooling::Replacements(tooling::Replacement(FileName, 0, 4, "")));
3814+
}
38133815
// apply the reformatting changes and the removal of "x = ".
38143816
if (applyAllReplacements(Code, Replaces))
38153817
return {Replaces, 0};

clang/lib/Sema/SemaInit.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,16 +2791,20 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity,
27912791
// initializer list that the child calls see, so that we don't try
27922792
// to re-process the designator.
27932793
unsigned OldIndex = Index;
2794-
IList->setInit(OldIndex, DIE->getInit());
2794+
auto *OldDIE =
2795+
dyn_cast_if_present<DesignatedInitExpr>(IList->getInit(OldIndex));
2796+
if (!OldDIE)
2797+
OldDIE = DIE;
2798+
IList->setInit(OldIndex, OldDIE->getInit());
27952799

27962800
CheckSubElementType(Entity, IList, CurrentObjectType, Index, StructuredList,
27972801
StructuredIndex, /*DirectlyDesignated=*/true);
27982802

27992803
// Restore the designated initializer expression in the syntactic
28002804
// form of the initializer list.
2801-
if (IList->getInit(OldIndex) != DIE->getInit())
2802-
DIE->setInit(IList->getInit(OldIndex));
2803-
IList->setInit(OldIndex, DIE);
2805+
if (IList->getInit(OldIndex) != OldDIE->getInit())
2806+
OldDIE->setInit(IList->getInit(OldIndex));
2807+
IList->setInit(OldIndex, OldDIE);
28042808

28052809
return hadError && !prevHadError;
28062810
}

clang/test/SemaTemplate/deduction-guide.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,3 +886,30 @@ CC c{};
886886
// CHECK-NEXT: `-ClassTemplateSpecialization {{.+}} 'A'
887887

888888
}
889+
890+
namespace GH67173 {
891+
892+
template <class T> struct Vec2d {
893+
struct {
894+
T x;
895+
T y;
896+
};
897+
};
898+
899+
void f() {
900+
Vec2d v{.x = 1, .y = 2};
901+
}
902+
903+
// CHECK-LABEL: Dumping GH67173::<deduction guide for Vec2d>:
904+
// CHECK-NEXT: FunctionTemplateDecl {{.+}} implicit <deduction guide for Vec2d>
905+
// CHECK-NEXT: |-TemplateTypeParmDecl {{.+}} referenced class depth 0 index 0 T
906+
// CHECK: |-CXXDeductionGuideDecl {{.+}} implicit <deduction guide for Vec2d> 'auto (T, T) -> Vec2d<T>' aggregate
907+
// CHECK-NEXT: | |-ParmVarDecl {{.+}} col:27 'T'
908+
// CHECK-NEXT: | `-ParmVarDecl {{.+}} col:27 'T'
909+
// CHECK-NEXT: `-CXXDeductionGuideDecl {{.+}} implicit used <deduction guide for Vec2d> 'auto (int, int) -> GH67173::Vec2d<int>' implicit_instantiation aggregate
910+
// CHECK-NEXT: |-TemplateArgument type 'int'
911+
// CHECK-NEXT: | `-BuiltinType {{.+}} 'int'
912+
// CHECK-NEXT: |-ParmVarDecl {{.+}} 'int'
913+
// CHECK-NEXT: `-ParmVarDecl {{.+}} 'int'
914+
915+
}

clang/tools/clang-format/ClangFormat.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ static bool format(StringRef FileName, bool ErrorOnIncompleteFormat = false) {
491491
// To format JSON insert a variable to trick the code into thinking its
492492
// JavaScript.
493493
if (IsJson && !FormatStyle->DisableFormat) {
494-
auto Err = Replaces.add(tooling::Replacement(
495-
tooling::Replacement(AssumedFileName, 0, 0, "x = ")));
494+
auto Err =
495+
Replaces.add(tooling::Replacement(AssumedFileName, 0, 0, "x = "));
496496
if (Err)
497497
llvm::errs() << "Bad Json variable insertion\n";
498498
}

clang/unittests/Format/FormatTestRawStrings.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,28 @@ fffffffffffffffffffff("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
988988
)pb");)test",
989989
Style));
990990
}
991+
992+
TEST_F(FormatTestRawStrings, Json) {
993+
auto Style = getLLVMStyle();
994+
Style.RawStringFormats = {
995+
{
996+
/*Language=*/FormatStyle::LK_Json,
997+
/*Delimiters=*/{"json"},
998+
/*EnclosingFunctions=*/{},
999+
/*CanonicalDelimiter=*/"",
1000+
/*BasedOnStyle=*/"llvm",
1001+
},
1002+
};
1003+
1004+
EXPECT_EQ("json = R\"json({\n"
1005+
" \"str\": \"test\"\n"
1006+
" })json\";",
1007+
format("json = R\"json({\n"
1008+
" \"str\": \"test\"\n"
1009+
"})json\";",
1010+
Style));
1011+
}
1012+
9911013
} // end namespace
9921014
} // end namespace format
9931015
} // end namespace clang

flang/lib/Optimizer/CodeGen/CodeGen.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,9 @@ static bool isDeviceAllocation(mlir::Value val, mlir::Value adaptorVal) {
18301830
(callOp.getCallee().value().getRootReference().getValue().starts_with(
18311831
RTNAME_STRING(CUFMemAlloc)) ||
18321832
callOp.getCallee().value().getRootReference().getValue().starts_with(
1833-
RTNAME_STRING(CUFAllocDescriptor))))
1833+
RTNAME_STRING(CUFAllocDescriptor)) ||
1834+
callOp.getCallee().value().getRootReference().getValue() ==
1835+
"__tgt_acc_get_deviceptr"))
18341836
return true;
18351837
return false;
18361838
}
@@ -3253,8 +3255,9 @@ struct LoadOpConversion : public fir::FIROpConversion<fir::LoadOp> {
32533255
if (auto callOp = mlir::dyn_cast_or_null<mlir::LLVM::CallOp>(
32543256
inputBoxStorage.getDefiningOp())) {
32553257
if (callOp.getCallee() &&
3256-
(*callOp.getCallee())
3257-
.starts_with(RTNAME_STRING(CUFAllocDescriptor))) {
3258+
((*callOp.getCallee())
3259+
.starts_with(RTNAME_STRING(CUFAllocDescriptor)) ||
3260+
(*callOp.getCallee()).starts_with("__tgt_acc_get_deviceptr"))) {
32583261
// CUDA Fortran local descriptor are allocated in managed memory. So
32593262
// new storage must be allocated the same way.
32603263
auto mod = load->getParentOfType<mlir::ModuleOp>();

flang/test/Fir/CUDA/cuda-code-gen.mlir

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,20 @@ func.func @_QMm1Psub1(%arg0: !fir.box<!fir.array<?xi32>> {cuf.data_attr = #cuf.c
204204
fir.global common @_QPshared_static__shared_mem(dense<0> : vector<28xi8>) {alignment = 8 : i64, data_attr = #cuf.cuda<shared>} : !fir.array<28xi8>
205205

206206
// CHECK: llvm.mlir.global common @_QPshared_static__shared_mem(dense<0> : vector<28xi8>) {addr_space = 3 : i32, alignment = 8 : i64} : !llvm.array<28 x i8>
207+
208+
// -----
209+
210+
module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<f80, dense<128> : vector<2xi64>>, #dlti.dl_entry<i128, dense<128> : vector<2xi64>>, #dlti.dl_entry<i64, dense<64> : vector<2xi64>>, #dlti.dl_entry<!llvm.ptr<272>, dense<64> : vector<4xi64>>, #dlti.dl_entry<!llvm.ptr<271>, dense<32> : vector<4xi64>>, #dlti.dl_entry<!llvm.ptr<270>, dense<32> : vector<4xi64>>, #dlti.dl_entry<f128, dense<128> : vector<2xi64>>, #dlti.dl_entry<f64, dense<64> : vector<2xi64>>, #dlti.dl_entry<f16, dense<16> : vector<2xi64>>, #dlti.dl_entry<i32, dense<32> : vector<2xi64>>, #dlti.dl_entry<i16, dense<16> : vector<2xi64>>, #dlti.dl_entry<i8, dense<8> : vector<2xi64>>, #dlti.dl_entry<i1, dense<8> : vector<2xi64>>, #dlti.dl_entry<!llvm.ptr, dense<64> : vector<4xi64>>, #dlti.dl_entry<"dlti.endianness", "little">, #dlti.dl_entry<"dlti.stack_alignment", 128 : i64>>} {
211+
func.func @_QQmain() attributes {fir.bindc_name = "cufkernel_global"} {
212+
%c0 = arith.constant 0 : index
213+
%3 = fir.call @__tgt_acc_get_deviceptr() : () -> !fir.ref<!fir.box<none>>
214+
%4 = fir.convert %3 : (!fir.ref<!fir.box<none>>) -> !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>
215+
%5 = fir.load %4 : !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>
216+
return
217+
}
218+
219+
// CHECK-LABEL: llvm.func @_QQmain()
220+
// CHECK: llvm.call @_FortranACUFAllocDescriptor
221+
222+
func.func private @__tgt_acc_get_deviceptr() -> !fir.ref<!fir.box<none>>
223+
}

lld/test/ELF/sectionstart.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
## The errors go away when the image base is 0.
2121
# RUN: ld.lld %t.o -pie --section-start .text=0x100000 \
22-
# RUN: --section-start=.data=0x110000 --section-start .bss=0x200000 -o %t --noinhibit-exec
22+
# RUN: --section-start=.data=0x110000 --section-start .bss=0x200000 -o %t 2>&1 | count 0
2323
# RUN: llvm-objdump --section-headers %t | FileCheck %s
2424

2525
## The same, but dropped "0x" prefix. Specify a smaller --image-base to suppress warnings.
2626
# RUN: ld.lld %t.o --image-base=0x90000 --section-start .text=100000 \
27-
# RUN: --section-start .data=110000 --section-start .bss=0x200000 -o %t1 --noinhibit-exec
27+
# RUN: --section-start .data=110000 --section-start .bss=0x200000 -o %t1 2>&1 | count 0
2828
# RUN: llvm-objdump --section-headers %t1 | FileCheck %s
2929

3030
## Use -Ttext, -Tdata, -Tbss as replacement for --section-start:

lldb/tools/lldb-dap/DAP.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,22 +1292,17 @@ void DAP::EventThread() {
12921292

12931293
llvm::StringRef reason;
12941294
bool id_only = false;
1295-
if (event_mask & lldb::SBTarget::eBroadcastBitModulesLoaded) {
1296-
modules.insert(module_id);
1297-
reason = "new";
1298-
} else {
1299-
// If this is a module we've never told the client about, don't
1300-
// send an event.
1301-
if (!modules.contains(module_id))
1302-
continue;
1303-
1295+
if (modules.contains(module_id)) {
13041296
if (event_mask & lldb::SBTarget::eBroadcastBitModulesUnloaded) {
13051297
modules.erase(module_id);
13061298
reason = "removed";
13071299
id_only = true;
13081300
} else {
13091301
reason = "changed";
13101302
}
1303+
} else {
1304+
modules.insert(module_id);
1305+
reason = "new";
13111306
}
13121307

13131308
llvm::json::Object body;

0 commit comments

Comments
 (0)