Skip to content

Commit ed3961b

Browse files
authored
Merge pull request #82908 from hamishknight/test-tweaks
[test] Tweak a couple of crasher test cases
2 parents 529ec41 + 3ab8fb7 commit ed3961b

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

validation-test/IDE/crashers/539adae64314fae.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
// {"kind":"complete","signature":"void std::__1::__introsort<std::__1::_ClassicAlgPolicy, printCodeCompletionLookedupTypeNames(llvm::ArrayRef<swift::NullTerminatedStringRef>, llvm::raw_ostream&)::$_0&, swift::NullTerminatedStringRef*, false>(swift::NullTerminatedStringRef*, swift::NullTerminatedStringRef*, printCodeCompletionLookedupTypeNames(llvm::ArrayRef<swift::NullTerminatedStringRef>, llvm::raw_ostream&)::$_0&, std::__1::iterator_traits<swift::NullTerminatedStringRef*>::difference_type, bool)"}
2-
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
1+
// {"kind":"complete","signature":"void std::__1::__introsort<std::__1::_ClassicAlgPolicy, printCodeCompletionLookedupTypeNames(llvm::ArrayRef<swift::NullTerminatedStringRef>, llvm::raw_ostream&)::$_0&, swift::NullTerminatedStringRef*, false>(swift::NullTerminatedStringRef*, swift::NullTerminatedStringRef*, printCodeCompletionLookedupTypeNames(llvm::ArrayRef<swift::NullTerminatedStringRef>, llvm::raw_ostream&)::$_0&, std::__1::iterator_traits<swift::NullTerminatedStringRef*>::difference_type, bool)","useGuardMalloc":true}
2+
// RUN: env DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
// REQUIRES: OS=macosx
4+
// REQUIRES: no_asan
5+
// REQUIRES: target-same-as-host
36
struct a<each b: Collection
47
{
58
c: (repeat each b.Index

validation-test/compiler_crashers_2/1e4b431ffe374ef1.swift

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// {"kind":"typecheck","signature":"swift::TypeTransform<swift::Type::transformRec(llvm::function_ref<std::__1::optional<swift::Type> (swift::TypeBase*)>) const::Transform>::doIt(swift::Type, swift::TypePosition)"}
2+
// The issue here is that the solver attempts to recursively apply the same
3+
// dynamic member lookup until eventually it overflows the stack. Make sure
4+
// we either timeout or crash.
5+
// RUN: not %{python} %S/../../test/Inputs/timeout.py 60 %target-swift-frontend -typecheck %s || \
6+
// RUN: not --crash %target-swift-frontend -typecheck %s
7+
@dynamicMemberLookup struct S<T> {
8+
init(_: () -> T) {}
9+
subscript<U>(dynamicMember d: WritableKeyPath<T, U>) -> S<U> {}
10+
}
11+
let x = S { x.e }

0 commit comments

Comments
 (0)