Files
swift-mirror/test/ASTGen/regex.swift
Rintaro Ishizaki 74f5f1de44 [ASTGen] Adopt '-dump-ast-format default-with-decl-contexts' in tests
Verify ASTGen generating DeclContext hierarchy correctly.
2025-02-14 11:17:16 -08:00

37 lines
961 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend-dump-parse -enable-bare-slash-regex -disable-availability-checking -enable-experimental-feature ParserASTGen \
// RUN: | %sanitize-address > %t/astgen.ast
// RUN: %target-swift-frontend-dump-parse -enable-bare-slash-regex -disable-availability-checking \
// RUN: | %sanitize-address > %t/cpp-parser.ast
// RUN: %diff -u %t/astgen.ast %t/cpp-parser.ast
// RUN: %target-typecheck-verify-swift -enable-experimental-feature ParserASTGen -enable-bare-slash-regex -disable-availability-checking
// REQUIRES: swift_swift_parser
// REQUIRES: swift_feature_ParserASTGen
// rdar://116686158
// UNSUPPORTED: asan
func testRegexLiteral() {
_ = /abc/
_ = #/abc/#
_ = ##/abc/##
func foo<T>(_ x: T...) {}
foo(/abc/, #/abc/#, ##/abc/##)
let _ = [/abc/, #/abc/#, ##/abc/##]
_ = /\w+/.self
_ = #/\w+/#.self
_ = ##/\w+/##.self
_ = /#\/\#\\/
_ = #/#/\/\#\\/#
_ = ##/#|\|\#\\/##
}