Files
swift-mirror/test/ClangModules/mapped-integers.swift.gyb
Graham Batty 0c281d5a23 Use --sysroot instead of -isysroot on non-Darwin
Clang does not properly set up the include root on non-darwin
platforms with -isysroot, so use --sysroot on those platforms
instead.

Swift SVN r26102
2015-03-13 16:32:09 +00:00

24 lines
967 B
Plaintext

// RUN: rm -rf %t && mkdir -p %t
// RUN: %S/../../utils/gyb %s -o %t/mapped-integers.swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -verify %t/mapped-integers.swift
import ctypes
func testUnsignedIntegers() {
%for size in [8, 16, 32, 64]:
%for (prefix, suffix) in [('UInt', ''), ('uint', '_t'), ('u_int', '_t')]:
let unqual_${prefix}${size}${suffix}: UInt${size} = ${prefix}${size}${suffix}_test
let qual_${prefix}${size}${suffix}: ctypes.${prefix}${size}${suffix} = 0 // expected-error {{no type named '${prefix}${size}${suffix}' in module 'ctypes'}}
%end
%end
}
func testSignedIntegers() {
%for size in [8, 16, 32, 64]:
%for (prefix, suffix) in [('SInt', ''), ('int', '_t')]:
let unqual_${prefix}${size}${suffix}: Int${size} = ${prefix}${size}${suffix}_test
let qual_${prefix}${size}${suffix}: ctypes.${prefix}${size}${suffix} = 0 // expected-error {{no type named '${prefix}${size}${suffix}' in module 'ctypes'}}
%end
%end
}