Skip to content

Commit d3abee7

Browse files
committed
[test] Require asserts for all compiler_crashers_2 tests
These contain a mix of crashers that may or may not crash under non-asserts builds, avoid testing them for non-asserts builds. When fixed, they'll receive non-assert coverage.
1 parent a40a7be commit d3abee7

30 files changed

+2
-29
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// {"signature":"swift::rewriting::RequirementMachine::verify(swift::rewriting::MutableTerm const&) const"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
protocol a {
54
typealias Index extension Collection where Self : a{b : Index} protocol a

validation-test/compiler_crashers_2/1be7dd4882cd8c39.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// {"signature":"swift::RootProtocolConformance::getWitness(swift::ValueDecl*) const"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
protocol a{typealias b : IteratorProtocol} extension a{typealias Element =
54
b.Element} protocol c
65
: a{typealias b typealias Element} protocol d
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// {"signature":"swift::ast_scope::SpecializeAttributeScope::getSourceRangeOfThisASTNode(bool) const"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
{
54
@in
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// {"signature":"swift::ast_scope::ASTScopeImpl::printRange(llvm::raw_ostream&) const"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
func a < >>
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// {"signature":"swift::Decl::getResolvedCustomAttrType(swift::CustomAttr*) const"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
struct a {
54
@b c, () {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// {"signature":"swift::constraints::ConstraintSystem::setCapturedExpansions(swift::AnyFunctionRef, llvm::SmallVector<swift::PackExpansionExpr*, 1u>)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
{
54
repeat a {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// {"signature":"swift::constraints::ConstraintSystem::repairFailures(swift::Type, swift::Type, swift::constraints::ConstraintKind, swift::optionset::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, llvm::SmallVectorImpl<swift::constraints::RestrictionOrFix>&, swift::constraints::ConstraintLocatorBuilder)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
func a< b , c : Sequence, d >( b, c) where b== c.Element a( ( 0 , [ (0 0), (

validation-test/compiler_crashers_2/462ee2aa7dc23cf3.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// {"signature":"recordTypeWitness(swift::NormalProtocolConformance*, swift::AssociatedTypeDecl*, swift::Type, swift::TypeDecl*)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
protocol a{associatedtype b} protocol c
54
: a{d(b)} protocol e{associatedtype f} extension e {
65
protocol g : e, c { associatedtype f : c associatedtype b }
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// {"signature":"swift::TypeChecker::typeCheckParameterDefault(swift::Expr*&, swift::DeclContext*, swift::Type, bool, bool)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
init<a>(b: a == {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// {"signature":"swift::TuplePatternElt& llvm::SmallVectorTemplateBase<swift::TuplePatternElt, true>::growAndEmplaceBack<swift::Identifier, swift::SourceLoc, swift::Pattern*&>(swift::Identifier&&, swift::SourceLoc&&, swift::Pattern*&)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
switch { case .a(&b
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// {"signature":"swift::constraints::ConstraintSystem::simplifySameShapeConstraint(swift::Type, swift::Type, swift::optionset::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::constraints::ConstraintLocatorBuilder)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
struct a < each b {
54
c(d : repeat each b) {
65
c(preacidte : b) {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// {"signature":"swift::constraints::ConjunctionStep::SolverSnapshot::~SolverSnapshot()"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
33
// REQUIRES: OS=macosx
4-
// REQUIRES: asserts
54
import Foundation{let a = malloc(b.c <d>
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// {"signature":"(anonymous namespace)::DeclChecker::visitExtensionDecl(swift::ExtensionDecl*)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
extension repeat (
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// {"signature":"swift::DefaultAndMaxAccessLevelRequest::cacheResult(std::__1::pair<swift::AccessLevel, swift::AccessLevel>) const"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
struct a < b extension a where b : c, d == a {
54
protocol c struct a

validation-test/compiler_crashers_2/6a33401772c7458.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// {"signature":"swift::constraints::GenericArgumentsMismatchFailure::GenericArgumentsMismatchFailure(swift::constraints::Solution const&, swift::Type, swift::Type, llvm::ArrayRef<unsigned int>, swift::constraints::ConstraintLocator*)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
class a < b, c {
54
typealias d = b typealias e =
65
c class f<b, c> : a<b, c> class g<h, i> : f<(h, i), c> {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// {"signature":"swift::TuplePattern::createSimple(swift::ASTContext&, swift::SourceLoc, llvm::ArrayRef<swift::TuplePatternElt>, swift::SourceLoc)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
switch { case (repeat a

validation-test/compiler_crashers_2/756ba8587e7eb26b.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// {"signature":"(anonymous namespace)::Verifier::verifyChecked(swift::Type)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
class a < b {
54
d {
65
class e<c, b> : a struct f subscript<g>(h : e<f, g>) {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// {"signature":"swift::Parser::parseStmtConditionElement(llvm::SmallVectorImpl<swift::StmtConditionElement>&, swift::Diag<>, swift::StmtKind, llvm::StringRef&)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
func a: b[ if let
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// {"signature":"swift::AccessLevelRequest::cacheResult(swift::AccessLevel) const"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
class a < b extension a where c == d {
54
protocol d

validation-test/compiler_crashers_2/a7ee60c01ddf9624.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// {"signature":"(anonymous namespace)::LookupResultBuilder::add(swift::ValueDecl*, swift::DeclContext*, swift::ValueDecl*, swift::Type, bool)::'lambda'(swift::ValueDecl*)::operator()(swift::ValueDecl*) const"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
protocol a{b} protocol c : a protocol d : c extension d {
54
struct e : d {
65
f {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// {"signature":"swift::PrintingDiagnosticConsumer::printDiagnostic(swift::SourceManager&, swift::DiagnosticInfo const&)"}
22
// RUN: not --crash %target-swift-frontend -typecheck -diagnostic-style=llvm %s
3-
// REQUIRES: asserts
43
' '
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// {"signature":"(anonymous namespace)::Verifier::verifyParsed(swift::AbstractClosureExpr*)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
func == {
54
switch {
65
case.a {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// {"signature":"swift::SubstitutionMap::get(swift::GenericSignature, swift::InFlightSubstitution&)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
struct a < each b { class c protocol d init(e: c & d

validation-test/compiler_crashers_2/d9fe6f57e64fee5.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// {"signature":"swift::constraints::simplifyLocator(swift::ASTNode&, llvm::ArrayRef<swift::constraints::ConstraintLocator::PathElement>&, swift::SourceRange&)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
struct a { eq = "" b "Self ecuador1 Self) > Bool {
54
let getProperties = (
65
\.eq as Self -> _
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// {"signature":"swift::ASTContext::getSpecializedConformance(swift::Type, swift::NormalProtocolConformance*, swift::SubstitutionMap)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
protocol a{ < } protocol b { associatedtype c : a where d == Self }
54
class e<f> : a where f : b, f.c == e
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// {"signature":"swift::ForeignRepresentationInfo::isRepresentableAsOptional() const"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
a!!= 1
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// {"signature":"swift::constraints::MissingContextualConformanceFailure::diagnoseAsError()"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
protocol a }
54
{
65
b -> a? in return .c<d e
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// {"signature":"swift::constraints::Solution::getFunctionArgApplyInfo(swift::constraints::ConstraintLocator*) const"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
3-
// REQUIRES: asserts
43
func a<b, each c>(d : repeat(b)->each c) { repeat d(e = f

validation-test/compiler_crashers_2/issue-81834.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// RUN: not --crash %target-swift-frontend -typecheck -library-level api %s
22
// REQUIRES: OS=macosx
3-
// REQUIRES: asserts
43

54
// https://github.com/swiftlang/swift/issues/81834
65
public class C {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
if "asserts" not in config.available_features:
2+
config.unsupported = True

0 commit comments

Comments
 (0)