Skip to content

tests: adjustments for Windows #22684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#import <NonModular.h>
#include <NonModular.h>

extern int x;
4 changes: 2 additions & 2 deletions test/ClangImporter/MixedSource/autolinking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ public let y = Test()

// CHECK: !llvm.linker.options
// CHECK-NOT: !{!"-framework", !"AutolinkingTest"}
// CHECK: !{!"-lswiftCore"}
// CHECK-NOT: !{!"-framework", !"AutolinkingTest"}
// CHECK: !{!{{"-lswiftCore"|"/DEFAULTLIB:swiftCore.lib"}}}
// CHECK-NOT: !{!"-framework", !"AutolinkingTest"}
7 changes: 4 additions & 3 deletions test/ClangImporter/MixedSource/broken-modules.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %empty-directory(%t)

// RUN: not %target-swift-frontend -enable-objc-interop -typecheck %/s -I %S/Inputs/broken-modules/ -enable-source-import -show-diagnostics-after-fatal -o /dev/null 2>&1 | %FileCheck -check-prefix CHECK -check-prefix CLANG-CHECK %s

// RUN: not %target-swift-frontend -typecheck %/s -enable-objc-interop -import-objc-header %S/Inputs/broken-modules/BrokenClangModule.h -enable-source-import -o /dev/null 2>&1 | %FileCheck -check-prefix CHECK-BRIDGING-HEADER -check-prefix CLANG-CHECK %s
Expand All @@ -22,13 +23,13 @@ import MissingDependencyFromClang
// CHECK: error: no such module 'MissingDependencyFromClang'

import BrokenClangModule
// CLANG-CHECK: {{.+}}/Inputs/broken-modules/BrokenClangModule.h:2:13: error: redefinition of 'conflict' as different kind of symbol
// CLANG-CHECK: {{.+}}/Inputs/broken-modules/BrokenClangModule.h:1:5: note: previous definition is here
// CLANG-CHECK: {{.+}}{{/|\\}}Inputs{{/|\\}}broken-modules{{/|\\}}BrokenClangModule.h:2:13: error: redefinition of 'conflict' as different kind of symbol
// CLANG-CHECK: {{.+}}{{/|\\}}Inputs{{/|\\}}broken-modules{{/|\\}}BrokenClangModule.h:1:5: note: previous definition is here
// CLANG-CHECK: a-fake-file.h:43:13: error: redefinition of 'conflict2' as different kind of symbol
// CLANG-CHECK: a-fake-file.h:42:5: note: previous definition is here
// CLANG-CHECK: a-fake-file.h:46:5: error: expected identifier or '('
// CLANG-CHECK: a-fake-file.h:45:11: note: expanded from macro 'I'
// CLANG-CHECK: {{.+}}/Inputs/broken-modules/BrokenClangModule.h:11:35: error: expected ';' after top level declarator
// CLANG-CHECK: {{.+}}{{/|\\}}Inputs{{/|\\}}broken-modules{{/|\\}}BrokenClangModule.h:11:35: error: expected ';' after top level declarator

// CHECK: broken-modules.swift:[[@LINE-9]]:8: error: could not build Objective-C module 'BrokenClangModule'
// CHECK: error: no such module 'BrokenClangModule'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// RUN: rm -rf %t/mixed-target/
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -I %S/../Inputs/custom-modules -enable-objc-interop -typecheck %s -verify

// XFAIL: linux
// REQUIRES: SR7768

import MixedWithHeader

Expand Down
15 changes: 8 additions & 7 deletions test/ClangImporter/autolinking.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %s -sdk %S/Inputs -I %S/Inputs/custom-modules -emit-ir -o - | %FileCheck %s

// RUN: %target-swift-frontend %s -sdk %S/Inputs -Fsystem %S/Inputs/System/Library/Frameworks -enable-objc-interop -I %S/Inputs/custom-modules -emit-ir -o - | %FileCheck %s

// RUN: %target-swift-frontend -emit-module %S/Inputs/adapter.swift -sdk %S/Inputs -module-link-name SwiftAdapter -module-name ClangModuleWithAdapter -I %S/Inputs/custom-modules -o %t

// RUN: %target-swift-frontend %s -sdk %S/Inputs -I %S/Inputs/custom-modules -I %t -emit-ir -o %t/with-adapter.ll
// RUN: %target-swift-frontend %s -sdk %S/Inputs -Fsystem %S/Inputs/System/Library/Frameworks -enable-objc-interop -I %S/Inputs/custom-modules -I %t -emit-ir -o %t/with-adapter.ll
// RUN: %FileCheck %s < %t/with-adapter.ll
// RUN: %FileCheck -check-prefix CHECK-WITH-SWIFT %s < %t/with-adapter.ll

// RUN: %target-swift-frontend %s -sdk %S/Inputs -I %S/Inputs/custom-modules -emit-ir -disable-autolink-framework LinkFramework -o - > %t/with-disabled.ll
// RUN: %target-swift-frontend %s -sdk %S/Inputs -I %S/Inputs/custom-modules -Fsystem %S/Inputs/System/Library/Frameworks -enable-objc-interop -emit-ir -disable-autolink-framework LinkFramework -o - > %t/with-disabled.ll
// RUN: %FileCheck -check-prefix CHECK-WITH-DISABLED %s < %t/with-disabled.ll
// RUN: %FileCheck -check-prefix NEGATIVE-WITH-DISABLED %s < %t/with-disabled.ll

Expand All @@ -29,15 +30,15 @@ UsesSubmodule.useSomethingFromSubmodule()

// CHECK: !llvm.linker.options = !{

// CHECK-DAG: !{{[0-9]+}} = !{!"-lLock"}
// CHECK-DAG: !{{[0-9]+}} = !{!"-lStock"}
// CHECK-DAG: !{{[0-9]+}} = !{!{{"-lLock"|"/DEFAULTLIB:Lock.lib"}}}
// CHECK-DAG: !{{[0-9]+}} = !{!{{"-lStock"|"/DEFAULTLIB:Stock.lib"}}}
// CHECK-DAG: !{{[0-9]+}} = !{!"-framework", !"Barrel"}
// CHECK-DAG: !{{[0-9]+}} = !{!"-framework", !"LinkFramework"}
// CHECK-DAG: !{{[0-9]+}} = !{!"-lUnderlyingClangLibrary"}
// CHECK-DAG: !{{[0-9]+}} = !{!{{"-lUnderlyingClangLibrary"|"/DEFAULTLIB:UnderlyingClangLibrary.lib"}}}
// CHECK-DAG: !{{[0-9]+}} = !{!"-framework", !"Indirect"}
// CHECK-DAG: !{{[0-9]+}} = !{!"-framework", !"HasSubmodule"}

// CHECK-WITH-SWIFT: !{{[0-9]+}} = !{!"-lSwiftAdapter"}
// CHECK-WITH-SWIFT: !{{[0-9]+}} = !{!{{"-lSwiftAdapter"|"/DEFAULTLIB:SwiftAdapter.lib"}}}

// CHECK-WITH-DISABLED-DAG: !{!"-framework", !"Barrel"}
// CHECK-WITH-DISABLED-DAG: !{!"-framework", !"Indirect"}
Expand Down
6 changes: 3 additions & 3 deletions test/ClangImporter/broken-modules.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#if MISSING_FROM_MODULE
import MissingHeader
// CHECK-MODULE-MAP: {{.*}}/Inputs/custom-modules/module.map:{{[0-9]+:[0-9]+}}: error: header 'this-header-does-not-exist.h' not found
// CHECK-MODULE-MAP: {{.*}}{{/|\\}}Inputs{{/|\\}}custom-modules{{/|\\}}module.map:{{[0-9]+:[0-9]+}}: error: header 'this-header-does-not-exist.h' not found
// CHECK-MODULE-MAP: broken-modules.swift:[[@LINE-2]]:8: error: could not build Objective-C module 'MissingHeader'

#else
Expand All @@ -17,7 +17,7 @@ import ImportsMissingHeaderIndirect
import ImportsMissingHeader
#endif

// CHECK-INDIRECT: {{.*}}/Inputs/custom-modules/more-custom-modules/ImportsMissingHeaderIndirect.h:1:9: note: while building module 'ImportsMissingHeader' imported from {{.*}}/Inputs/custom-modules/more-custom-modules/ImportsMissingHeaderIndirect.h:1:
// CHECK-INDIRECT: {{.*}}{{/|\\}}Inputs{{/|\\}}custom-modules{{/|\\}}more-custom-modules{{/|\\}}ImportsMissingHeaderIndirect.h:1:9: note: while building module 'ImportsMissingHeader' imported from {{.*}}{{/|\\}}Inputs{{/|\\}}custom-modules{{/|\\}}more-custom-modules{{/|\\}}ImportsMissingHeaderIndirect.h:1:
// CHECK-INDIRECT-NEXT: @import ImportsMissingHeader;

// CHECK: <module-includes>:1:9: note: in file included from <module-includes>:1:
Expand All @@ -28,7 +28,7 @@ import ImportsMissingHeader
// CHECK-INDIRECT: <module-includes>:1:9: note: in file included from <module-includes>:1:
// CHECK-INDIRECT-NEXT: #import "{{.*}}ImportsMissingHeaderIndirect.h"

// CHECK-INDIRECT: {{.*}}/Inputs/custom-modules/more-custom-modules/ImportsMissingHeaderIndirect.h:1:9: error: could not build module 'ImportsMissingHeader'
// CHECK-INDIRECT: {{.*}}{{/|\\}}Inputs{{/|\\}}custom-modules{{/|\\}}more-custom-modules{{/|\\}}ImportsMissingHeaderIndirect.h:1:9: error: could not build module 'ImportsMissingHeader'
// CHECK-INDIRECT-NEXT: @import ImportsMissingHeader;


Expand Down
2 changes: 1 addition & 1 deletion test/ClangImporter/non-modular-include.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: not %target-swift-frontend -enable-objc-interop -typecheck %/s -I %S/Inputs/non-modular -F %S/Inputs/non-modular 2>&1 | %FileCheck --check-prefix=CHECK -check-prefix CHECK-objc %s
// RUN: not %target-swift-frontend -disable-objc-interop -typecheck %/s -I %S/Inputs/non-modular -F %S/Inputs/non-modular 2>&1 | %FileCheck --check-prefix=CHECK -check-prefix CHECK-native %s

// CHECK: {{.+}}/non-modular/Foo.framework/Headers/Foo.h:1:9: error: include of non-modular header inside framework module 'Foo'
// CHECK: {{.+}}/non-modular{{/|\\}}Foo.framework/Headers{{/|\\}}Foo.h:1:10: error: include of non-modular header inside framework module 'Foo'
// CHECK-objc: error: could not build Objective-C module 'Foo'
// CHECK-native: error: could not build C module 'Foo'
// CHECK-NOT: error
Expand Down
10 changes: 5 additions & 5 deletions test/ClangImporter/pch-bridging-header-deps.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
// Generate a bridging PCH, use it in a swift file, and check that the swift file's .swiftdeps
// mention the .h the PCH was generated from, and any .h files included in it.
//
// RUN: %target-swift-frontend -emit-pch -o %t.pch %S/Inputs/chained-unit-test-bridging-header-to-pch.h
// RUN: %target-swift-frontend -emit-pch -o %t.pch %/S/Inputs/chained-unit-test-bridging-header-to-pch.h
// RUN: %target-swift-frontend -module-name test -c -emit-dependencies-path %t.d -emit-reference-dependencies-path %t.swiftdeps -primary-file %s -import-objc-header %t.pch
// RUN: %FileCheck --check-prefix CHECK-DEPS %s < %t.d
// RUN: %FileCheck --check-prefix CHECK-SWIFTDEPS %s < %t.swiftdeps
// RUN: %FileCheck --check-prefix CHECK-SWIFTDEPS2 %s < %t.swiftdeps

// RUN: %target-swift-frontend -module-name test -c -emit-dependencies-path %t.persistent.d -emit-reference-dependencies-path %t.persistent.swiftdeps -primary-file %s -import-objc-header %S/Inputs/chained-unit-test-bridging-header-to-pch.h -pch-output-dir %t/pch
// RUN: %target-swift-frontend -module-name test -c -emit-dependencies-path %t.persistent.d -emit-reference-dependencies-path %t.persistent.swiftdeps -primary-file %s -import-objc-header %/S/Inputs/chained-unit-test-bridging-header-to-pch.h -pch-output-dir %t/pch
// RUN: %FileCheck --check-prefix CHECK-DEPS %s < %t.persistent.d
// RUN: %FileCheck --check-prefix CHECK-SWIFTDEPS %s < %t.persistent.swiftdeps
// RUN: %FileCheck --check-prefix CHECK-SWIFTDEPS2 %s < %t.persistent.swiftdeps

print(app_function(1))

// CHECK-DEPS: pch-bridging-header-deps.o : {{.*}}SOURCE_DIR/test/ClangImporter/Inputs/app-bridging-header-to-pch.h {{.*}}SOURCE_DIR/test/ClangImporter/Inputs/chained-unit-test-bridging-header-to-pch.h
// CHECK-DEPS: pch-bridging-header-deps.o : {{.*}}SOURCE_DIR{{/|\\}}test{{/|\\}}ClangImporter{{/|\\}}Inputs{{/|\\}}app-bridging-header-to-pch.h {{.*}}SOURCE_DIR{{/|\\}}test{{/|\\}}ClangImporter{{/|\\}}Inputs{{/|\\}}chained-unit-test-bridging-header-to-pch.h

// CHECK-SWIFTDEPS: depends-external:
// CHECK-SWIFTDEPS: - "SOURCE_DIR/test/ClangImporter/Inputs/app-bridging-header-to-pch.h"
// CHECK-SWIFTDEPS: - "SOURCE_DIR/test/ClangImporter/Inputs/chained-unit-test-bridging-header-to-pch.h"
// CHECK-SWIFTDEPS: - "SOURCE_DIR{{/|\\\\}}test{{/|\\\\}}ClangImporter{{/|\\\\}}Inputs{{/|\\\\}}app-bridging-header-to-pch.h"
// CHECK-SWIFTDEPS: - "SOURCE_DIR{{/|\\\\}}test{{/|\\\\}}ClangImporter{{/|\\\\}}Inputs{{/|\\\\}}chained-unit-test-bridging-header-to-pch.h"

// CHECK-SWIFTDEPS2-NOT: {{.*}}.pch
2 changes: 1 addition & 1 deletion test/ClangImporter/sdk.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %target-typecheck-verify-swift

// XFAIL: linux
// REQUIRES: objc_interop

import Foundation

Expand Down
2 changes: 2 additions & 0 deletions test/Inputs/clang-importer-sdk/usr/include/MacTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ STDLIB_TYPEDEF(__UINT8_TYPE__, UInt8);
STDLIB_TYPEDEF(__UINT16_TYPE__, UInt16);
STDLIB_TYPEDEF(__UINT32_TYPE__, UInt32);

#if !defined(_WIN32)
#include <stdint.h>
#endif

typedef SInt32 Fixed;
typedef Fixed * FixedPtr;
Expand Down