forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NoFoundation.swift
38 lines (31 loc) · 1.32 KB
/
NoFoundation.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//===--- NoFoundation.swift - Tests that run without Foundation loaded ----===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// These tests are supposed to work *without* Foundation being present
//
//===----------------------------------------------------------------------===//
// RUN: %target-run-simple-swift
// REQUIRES: executable_test
// REQUIRES: objc_interop
// Unfortunately, StdlibUnittest brings in Foundation somehow, so we
// can't use it here.
// import StdlibUnittest
//===--- Verify that Foundation isn't loaded ------------------------------===//
struct No {}
struct Yes {}
func isRandomAccessIndex<T : ForwardIndexType>(_: T) -> No { return No() }
func isRandomAccessIndex<T : RandomAccessIndexType>(_: T) -> Yes { return Yes() }
let no = isRandomAccessIndex("".utf16.startIndex)
_ = no as No
//===--- Tests ------------------------------------------------------------===//
import Dispatch
print(dispatch_get_global_queue(0,0))