2013-01-15 01:21:00 +08:00
|
|
|
// RUN: rm -rf %t
|
2013-01-16 09:23:41 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -o - -fmodule-cache-path %t -fmodules -fmodules-autolink -F %S/Inputs -I %S/Inputs %s | FileCheck %s
|
2013-01-15 01:21:00 +08:00
|
|
|
|
|
|
|
@import autolink.sub2;
|
|
|
|
|
|
|
|
int f() {
|
|
|
|
return autolink_sub2();
|
|
|
|
}
|
|
|
|
|
|
|
|
@import autolink;
|
|
|
|
|
|
|
|
int g() {
|
|
|
|
return autolink;
|
|
|
|
}
|
|
|
|
|
2013-01-15 04:53:57 +08:00
|
|
|
@import Module.SubFramework;
|
|
|
|
const char *get_module_subframework() {
|
|
|
|
return module_subframework;
|
|
|
|
}
|
|
|
|
|
2013-01-15 03:00:05 +08:00
|
|
|
@import DependsOnModule.SubFramework;
|
2013-01-15 04:53:57 +08:00
|
|
|
float *get_module_subframework_dep() {
|
2013-01-15 03:00:05 +08:00
|
|
|
return sub_framework;
|
2013-01-15 01:57:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@import NoUmbrella;
|
|
|
|
int use_no_umbrella() {
|
|
|
|
return no_umbrella_A;
|
|
|
|
}
|
|
|
|
|
2013-01-15 04:53:57 +08:00
|
|
|
// CHECK: !llvm.module.linkoptions = !{![[AUTOLINK_FRAMEWORK:[0-9]+]], ![[AUTOLINK:[0-9]+]], ![[DEPENDSONMODULE:[0-9]+]], ![[MODULE:[0-9]+]], ![[NOUMBRELLA:[0-9]+]]}
|
Switch autolinking metadata format over to actual linker options, e.g.,
!0 = metadata !{metadata !"-lautolink"}
!1 = metadata !{metadata !"-framework", metadata !"autolink_framework"}
referenced from llvm.module.linkoptions, e.g.,
!llvm.module.linkoptions = !{!0, !1, !2, !3}
This conceptually moves the logic for figuring out the syntax the
linker will accept from LLVM into Clang. Moreover, it makes it easier
to support MSVC's
#pragma comment(linker, "some option")
in the future, should anyone care to do so.
llvm-svn: 172441
2013-01-15 02:28:43 +08:00
|
|
|
// CHECK: ![[AUTOLINK_FRAMEWORK]] = metadata !{metadata !"-framework", metadata !"autolink_framework"}
|
2013-01-15 04:53:57 +08:00
|
|
|
// CHECK: ![[AUTOLINK]] = metadata !{metadata !"-lautolink"}
|
2013-01-15 03:00:05 +08:00
|
|
|
// CHECK: ![[DEPENDSONMODULE]] = metadata !{metadata !"-framework", metadata !"DependsOnModule"}
|
Switch autolinking metadata format over to actual linker options, e.g.,
!0 = metadata !{metadata !"-lautolink"}
!1 = metadata !{metadata !"-framework", metadata !"autolink_framework"}
referenced from llvm.module.linkoptions, e.g.,
!llvm.module.linkoptions = !{!0, !1, !2, !3}
This conceptually moves the logic for figuring out the syntax the
linker will accept from LLVM into Clang. Moreover, it makes it easier
to support MSVC's
#pragma comment(linker, "some option")
in the future, should anyone care to do so.
llvm-svn: 172441
2013-01-15 02:28:43 +08:00
|
|
|
// CHECK: ![[MODULE]] = metadata !{metadata !"-framework", metadata !"Module"}
|
|
|
|
// CHECK: ![[NOUMBRELLA]] = metadata !{metadata !"-framework", metadata !"NoUmbrella"}
|