Skip to content

Commit a680211

Browse files
authored
Merge pull request swiftlang#77594 from kubamracek/embedded-int-parsing
[embedded] Enable integer parsing in Embedded Swift
2 parents 97eda9a + b370050 commit a680211

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

stdlib/public/core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ split_embedded_sources(
9393
EMBEDDED Identifiable.swift
9494
EMBEDDED Indices.swift
9595
EMBEDDED InputStream.swift
96-
NORMAL IntegerParsing.swift
96+
EMBEDDED IntegerParsing.swift
9797
EMBEDDED Integers.swift
9898
NORMAL Join.swift
9999
EMBEDDED KeyPath.swift

test/embedded/stdlib-parsing.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %target-run-simple-swift(-Osize -swift-version 5 -enable-experimental-feature Embedded -parse-as-library -runtime-compatibility-version none -wmo) | %FileCheck %s
2+
3+
// REQUIRES: swift_in_compiler
4+
// REQUIRES: executable_test
5+
// REQUIRES: optimized_stdlib
6+
// REQUIRES: OS=macosx || OS=linux-gnu
7+
// REQUIRES: swift_feature_Embedded
8+
9+
@main
10+
struct Main {
11+
static func main() {
12+
print(Int("42")!)
13+
// CHECK: 42
14+
print(Int("-123")!)
15+
// CHECK: -123
16+
print(Int("1000", radix: 16)!)
17+
// CHECK: 4096
18+
}
19+
}

0 commit comments

Comments
 (0)