mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[test] Add a test for indirect link dependencies relying on -L.
...as described in rdar://problem/23588774. We don't really have a good way to make this test cross-platform as such, but I'll add a Linux version soon.
This commit is contained in:
1
validation-test/execution/Inputs/custom-modules/foo.h
Normal file
1
validation-test/execution/Inputs/custom-modules/foo.h
Normal file
@@ -0,0 +1 @@
|
||||
int test();
|
||||
@@ -0,0 +1,4 @@
|
||||
module foo {
|
||||
header "foo.h"
|
||||
link "foo"
|
||||
}
|
||||
16
validation-test/execution/interpret-with-dependencies.swift
Normal file
16
validation-test/execution/interpret-with-dependencies.swift
Normal file
@@ -0,0 +1,16 @@
|
||||
// REQUIRES: OS=macosx
|
||||
// RUN: rm -rf %t && mkdir %t
|
||||
|
||||
// RUN: echo 'int abc = 42;' | %clang -x c - -dynamiclib -Xlinker -install_name -Xlinker libabc.dylib -o %t/libabc.dylib
|
||||
// RUN: echo 'int test() { extern int abc; return abc; }' | %clang -x c - -L%t -dynamiclib -labc -o %t/libfoo.dylib
|
||||
|
||||
// RUN: %swift_driver -I %S/Inputs/custom-modules -L%t %s | FileCheck %s
|
||||
// CHECK: {{okay}}
|
||||
|
||||
import foo
|
||||
|
||||
if test() == 42 {
|
||||
print("okay")
|
||||
} else {
|
||||
print("problem")
|
||||
}
|
||||
Reference in New Issue
Block a user