xref: /minix3/external/bsd/llvm/dist/clang/test/Modules/autolink.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc// RUN: rm -rf %t
2*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -emit-pch -fmodules-cache-path=%t -fmodules -o %t.pch -I %S/Inputs -x objective-c-header %S/Inputs/autolink-sub3.pch
3*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -emit-llvm -o - -fmodules-cache-path=%t -fmodules -F %S/Inputs -I %S/Inputs -include-pch %t.pch %s | FileCheck %s
4*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -emit-llvm -fno-autolink -o - -fmodules-cache-path=%t -fmodules -F %S/Inputs -I %S/Inputs -include-pch %t.pch %s | FileCheck --check-prefix=CHECK-AUTOLINK-DISABLED %s
5f4a2713aSLionel Sambuc
6f4a2713aSLionel Sambuc@import autolink.sub2;
7f4a2713aSLionel Sambuc
8f4a2713aSLionel Sambucint f() {
9f4a2713aSLionel Sambuc  return autolink_sub2();
10f4a2713aSLionel Sambuc}
11f4a2713aSLionel Sambuc
12f4a2713aSLionel Sambuc@import autolink;
13f4a2713aSLionel Sambuc
14f4a2713aSLionel Sambucint g() {
15f4a2713aSLionel Sambuc  return autolink;
16f4a2713aSLionel Sambuc}
17f4a2713aSLionel Sambuc
18f4a2713aSLionel Sambuc@import Module.SubFramework;
19f4a2713aSLionel Sambucconst char *get_module_subframework() {
20f4a2713aSLionel Sambuc  return module_subframework;
21f4a2713aSLionel Sambuc}
22f4a2713aSLionel Sambuc
23f4a2713aSLionel Sambuc@import DependsOnModule.SubFramework;
24f4a2713aSLionel Sambucfloat *get_module_subframework_dep() {
25f4a2713aSLionel Sambuc  return sub_framework;
26f4a2713aSLionel Sambuc}
27f4a2713aSLionel Sambuc
28f4a2713aSLionel Sambuc@import NoUmbrella;
29f4a2713aSLionel Sambucint use_no_umbrella() {
30f4a2713aSLionel Sambuc  return no_umbrella_A;
31f4a2713aSLionel Sambuc}
32f4a2713aSLionel Sambuc
33*0a6a1f1dSLionel Sambucint use_autolink_sub3() {
34*0a6a1f1dSLionel Sambuc  return autolink_sub3();
35*0a6a1f1dSLionel Sambuc}
36*0a6a1f1dSLionel Sambuc
37f4a2713aSLionel Sambuc// NOTE: "autolink_sub" is intentionally not linked.
38f4a2713aSLionel Sambuc
39*0a6a1f1dSLionel Sambuc// CHECK: !llvm.module.flags = !{{{.*}}}
40*0a6a1f1dSLionel Sambuc// CHECK: !{{[0-9]+}} = !{i32 6, !"Linker Options", ![[AUTOLINK_OPTIONS:[0-9]+]]}
41*0a6a1f1dSLionel Sambuc// CHECK: ![[AUTOLINK_OPTIONS]] = !{![[AUTOLINK_PCH:[0-9]+]], ![[AUTOLINK_FRAMEWORK:[0-9]+]], ![[AUTOLINK:[0-9]+]], ![[DEPENDSONMODULE:[0-9]+]], ![[MODULE:[0-9]+]], ![[NOUMBRELLA:[0-9]+]]}
42*0a6a1f1dSLionel Sambuc// CHECK: ![[AUTOLINK_PCH]] = !{!"{{(-l|/DEFAULTLIB:)}}autolink_from_pch{{(\.lib)?}}"}
43*0a6a1f1dSLionel Sambuc// CHECK: ![[AUTOLINK_FRAMEWORK]] = !{!"-framework", !"autolink_framework"}
44*0a6a1f1dSLionel Sambuc// CHECK: ![[AUTOLINK]] = !{!"{{(-l|/DEFAULTLIB:)}}autolink{{(\.lib)?}}"}
45*0a6a1f1dSLionel Sambuc// CHECK: ![[DEPENDSONMODULE]] = !{!"-framework", !"DependsOnModule"}
46*0a6a1f1dSLionel Sambuc// CHECK: ![[MODULE]] = !{!"-framework", !"Module"}
47*0a6a1f1dSLionel Sambuc// CHECK: ![[NOUMBRELLA]] = !{!"-framework", !"NoUmbrella"}
48f4a2713aSLionel Sambuc
49f4a2713aSLionel Sambuc// CHECK-AUTOLINK-DISABLED: !llvm.module.flags
50f4a2713aSLionel Sambuc// CHECK-AUTOLINK-DISABLED-NOT: "Linker Options"
51