mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
24 lines
967 B
Plaintext
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
|
|
}
|