Skip to content

Commit 6572319

Browse files
[embedded] Use @_extern(c) instead of @_silgen_name for putchar in tests
Using inconsistent attributes between stdlib and tests causes compilation errors. There are still several misuses of @_silgen_name in tests, but leaving them as is for now to incrementally fix them.
1 parent 7a205dc commit 6572319

14 files changed

+14
-14
lines changed

test/embedded/array-to-pointer.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// REQUIRES: optimized_stdlib
1010
// REQUIRES: OS=macosx || OS=linux-gnu
1111

12-
@_silgen_name("putchar")
12+
@_extern(c, "putchar")
1313
@discardableResult
1414
func putchar(_: CInt) -> CInt
1515

test/embedded/arrays.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// REQUIRES: optimized_stdlib
1010
// REQUIRES: OS=macosx || OS=linux-gnu
1111

12-
@_silgen_name("putchar")
12+
@_extern(c, "putchar")
1313
@discardableResult
1414
func putchar(_: CInt) -> CInt
1515

test/embedded/collection.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// REQUIRES: optimized_stdlib
1010
// REQUIRES: OS=macosx || OS=linux-gnu
1111

12-
@_silgen_name("putchar")
12+
@_extern(c, "putchar")
1313
@discardableResult
1414
func putchar(_: CInt) -> CInt
1515

test/embedded/custom-print.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// REQUIRES: executable_test
88
// REQUIRES: OS=macosx || OS=linux-gnu
99

10-
@_silgen_name("putchar")
10+
@_extern(c, "putchar")
1111
@discardableResult
1212
func putchar(_: CInt) -> CInt
1313

test/embedded/dependencies-no-allocations.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// REQUIRES: OS=macosx || OS=linux-gnu
2727
// UNSUPPORTED: OS=linux-gnu && CPU=aarch64
2828

29-
@_silgen_name("putchar")
29+
@_extern(c, "putchar")
3030
@discardableResult
3131
func putchar(_: CInt) -> CInt
3232

test/embedded/dependencies-random.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
// REQUIRES: rdar121923818
3434

35-
@_silgen_name("putchar")
35+
@_extern(c, "putchar")
3636
@discardableResult
3737
func putchar(_: CInt) -> CInt
3838

test/embedded/dependencies.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// REQUIRES: OS=macosx || OS=linux-gnu
2929
// UNSUPPORTED: OS=linux-gnu && CPU=aarch64
3030

31-
@_silgen_name("putchar")
31+
@_extern(c, "putchar")
3232
@discardableResult
3333
func putchar(_: CInt) -> CInt
3434

test/embedded/deserialize-vtables.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extension StaticString {
2121
}
2222
}
2323

24-
@_silgen_name("putchar")
24+
@_extern(c, "putchar")
2525
@discardableResult
2626
func putchar(_: CInt) -> CInt
2727

test/embedded/lto.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// loaded too late").
1313
// REQUIRES: no_asan
1414

15-
@_silgen_name("putchar")
15+
@_extern(c, "putchar")
1616
@discardableResult
1717
func putchar(_: CInt) -> CInt
1818

test/embedded/modules-globals-exec.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public func foo() {
2424

2525
import MyModule
2626

27-
@_silgen_name("putchar")
27+
@_extern(c, "putchar")
2828
@discardableResult
2929
func putchar(_: CInt) -> CInt
3030

test/embedded/modules-print-exec.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// BEGIN MyModule.swift
1515

16-
@_silgen_name("putchar")
16+
@_extern(c, "putchar")
1717
@discardableResult
1818
func putchar(_: CInt) -> CInt
1919

test/embedded/runtime.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// REQUIRES: optimized_stdlib
88
// REQUIRES: OS=macosx || OS=linux-gnu
99

10-
@_silgen_name("putchar")
10+
@_extern(c, "putchar")
1111
@discardableResult
1212
func putchar(_: CInt) -> CInt
1313

test/embedded/volatile-exec.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import _Volatile
99

10-
@_silgen_name("putchar")
10+
@_extern(c, "putchar")
1111
@discardableResult
1212
func putchar(_: CInt) -> CInt
1313

validation-test/stdlib/MicroStdlib/Inputs/Swift.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public struct UnsafeMutablePointer<T> {
8484
public typealias CInt = Int32
8585
public typealias CChar = Int8
8686

87-
@_silgen_name("putchar")
87+
@_extern(c, "putchar")
8888
public func putchar(_: CChar)
8989

9090
public func printHello() {

0 commit comments

Comments
 (0)