diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Modules/Inputs/autolink-sub.h | 1 | ||||
-rw-r--r-- | test/Modules/Inputs/autolink-sub2.h | 1 | ||||
-rw-r--r-- | test/Modules/Inputs/autolink.h | 1 | ||||
-rw-r--r-- | test/Modules/Inputs/module.map | 15 | ||||
-rw-r--r-- | test/Modules/autolink.m | 18 |
5 files changed, 36 insertions, 0 deletions
diff --git a/test/Modules/Inputs/autolink-sub.h b/test/Modules/Inputs/autolink-sub.h new file mode 100644 index 0000000000..60f9aa037e --- /dev/null +++ b/test/Modules/Inputs/autolink-sub.h @@ -0,0 +1 @@ +int autolink_sub(void); diff --git a/test/Modules/Inputs/autolink-sub2.h b/test/Modules/Inputs/autolink-sub2.h new file mode 100644 index 0000000000..c3ea7021ab --- /dev/null +++ b/test/Modules/Inputs/autolink-sub2.h @@ -0,0 +1 @@ +int autolink_sub2(void); diff --git a/test/Modules/Inputs/autolink.h b/test/Modules/Inputs/autolink.h new file mode 100644 index 0000000000..1014e29dc6 --- /dev/null +++ b/test/Modules/Inputs/autolink.h @@ -0,0 +1 @@ +extern int autolink; diff --git a/test/Modules/Inputs/module.map b/test/Modules/Inputs/module.map index 9657c165a8..702f5c11cd 100644 --- a/test/Modules/Inputs/module.map +++ b/test/Modules/Inputs/module.map @@ -124,3 +124,18 @@ module linkage_merge_left { header "linkage-merge-sub.h" } } + +module autolink { + header "autolink.h" + link "autolink" + + explicit module sub { + header "autolink-sub.h" + link "autolink_sub" + } + + explicit module sub2 { + header "autolink-sub2.h" + link framework "autolink_framework" + } +} diff --git a/test/Modules/autolink.m b/test/Modules/autolink.m new file mode 100644 index 0000000000..e4db6991fc --- /dev/null +++ b/test/Modules/autolink.m @@ -0,0 +1,18 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -emit-llvm -o - -fmodule-cache-path %t -fmodules -F %S/Inputs -I %S/Inputs %s | FileCheck %s + +@import autolink.sub2; + +int f() { + return autolink_sub2(); +} + +@import autolink; + +int g() { + return autolink; +} + +// CHECK: !llvm.link.libraries = !{![[AUTOLINK:[0-9]+]], ![[AUTOLINK_FRAMEWORK:[0-9]+]]} +// CHECK: ![[AUTOLINK]] = metadata !{metadata !"autolink", i1 false} +// CHECK: ![[AUTOLINK_FRAMEWORK]] = metadata !{metadata !"autolink_framework", i1 true} |