Skip to content

Commit a18f639

Browse files
committed
Make the MicroStdlib test executable
1 parent ec04246 commit a18f639

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

validation-test/stdlib/MicroStdlib.swift renamed to validation-test/stdlib/MicroStdlib/MicroStdlib.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
// RUN: ls %t/Swift.swiftmodule
55
// RUN: ls %t/Swift.swiftdoc
66
// RUN: ls %t/Swift.o
7+
// RUN: %target-clang -x c -c %S/RuntimeStubs.c -o %t/RuntimeStubs.o
8+
// RUN: %target-build-swift -I %t -module-name main -o %t/hello %S/main.swift %t/Swift.o %t/RuntimeStubs.o
9+
// RUN: %target-run %t/hello | FileCheck %s
710
// REQUIRES: executable_test
11+
// CHECK: Hello
812

913
//
1014
// A bare-bones Swift standard library
@@ -90,6 +94,18 @@ public struct UnsafeMutablePointer<T> {
9094
public typealias CInt = Int32
9195
public typealias CChar = Int8
9296

97+
@_silgen_name("putchar")
98+
public func putchar(_: CChar)
99+
100+
public func printHello() {
101+
putchar(0x48)
102+
putchar(0x65)
103+
putchar(0x6c)
104+
putchar(0x6c)
105+
putchar(0x6f)
106+
putchar(0x0a)
107+
}
108+
93109
//public var C_ARGC: CInt = CInt()
94110

95111
//public var C_ARGV: UnsafeMutablePointer<UnsafeMutablePointer<Int8>> = UnsafeMutablePointer()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
int _TMBi32_;
2+
int _TMBi64_;
3+
int _TMBi8_;
4+
void _swift_getEnumCaseSinglePayload(void) {}
5+
void _swift_getGenericMetadata(void) {}
6+
void _swift_slowAlloc(void) {}
7+
void _swift_slowDealloc(void) {}
8+
void _swift_storeEnumTagSinglePayload(void) {}
9+
void swift_allocateGenericValueMetadata(void) {}
10+
void swift_initEnumValueWitnessTableSinglePayload(void) {}
11+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
printHello()
2+

0 commit comments

Comments
 (0)