Revision 42e827e6e7247224c068a9dce8f6eabd2ab892ba authored by Devin Coughlin on 21 January 2016, 00:12:56 UTC, committed by Devin Coughlin on 21 January 2016, 01:22:15 UTC
1 parent ac1f5a6
Raw File
submodules.swift
// RUN: rm -rf %t
// RUN: mkdir -p %t

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -verify %s -DIMPORT_TOP_LEVEL
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -verify %s

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module-path %t/submodules.swiftmodule %s -DNO_ERRORS
// RUN: echo 'import submodules; let s = "\(x), \(y)"' | %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse - -I %t
// RUN: echo 'import submodules; let s = "\(x), \(y)"' | not %target-swift-frontend -parse - -I %t 2>&1 | FileCheck -check-prefix=MISSING %s

#if IMPORT_TOP_LEVEL
import ctypes
#endif

import ctypes.bits
// MISSING: missing required modules:
// MISSING-DAG: 'ctypes.bits'
// MISSING-DAG: 'ctypes'

// From bits submodule
public var x : DWORD = MY_INT
public var y : CInt = x

let _: ctypes.DWORD = ctypes.MY_INT
let _: ctypes.Color? = nil

// Error: "bits" should not be a valid name in this scope.
#if !NO_ERRORS
let _: bits.DWORD = 0 // expected-error {{use of undeclared type 'bits'}}
#endif
back to top