blob: 6aee0e11b12024e3fba7a4b5c4c3037b76c36729 [file] [log] [blame]
Douglas Gregor6ddfca92013-01-14 17:21:00 +00001// RUN: rm -rf %t
Richard Smith47972af2015-06-16 00:08:24 +00002// RUN: %clang_cc1 -emit-pch -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -o %t.pch -I %S/Inputs -x objective-c-header %S/Inputs/autolink-sub3.pch
3// RUN: %clang_cc1 -emit-llvm -o - -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -F %S/Inputs -I %S/Inputs -include-pch %t.pch %s | FileCheck %s
4// RUN: %clang_cc1 -emit-llvm -fno-autolink -o - -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -F %S/Inputs -I %S/Inputs -include-pch %t.pch %s | FileCheck --check-prefix=CHECK-AUTOLINK-DISABLED %s
Douglas Gregor6ddfca92013-01-14 17:21:00 +00005
6@import autolink.sub2;
7
8int f() {
9 return autolink_sub2();
10}
11
12@import autolink;
13
14int g() {
15 return autolink;
16}
17
Douglas Gregorbc25ff42013-01-14 20:53:57 +000018@import Module.SubFramework;
19const char *get_module_subframework() {
20 return module_subframework;
21}
22
Douglas Gregor1715a2f2013-01-14 19:00:05 +000023@import DependsOnModule.SubFramework;
Douglas Gregorbc25ff42013-01-14 20:53:57 +000024float *get_module_subframework_dep() {
Douglas Gregor1715a2f2013-01-14 19:00:05 +000025 return sub_framework;
Douglas Gregor11dfe6f2013-01-14 17:57:51 +000026}
27
28@import NoUmbrella;
29int use_no_umbrella() {
30 return no_umbrella_A;
31}
32
Ben Langmuir332aafe2014-01-31 01:06:56 +000033int use_autolink_sub3() {
34 return autolink_sub3();
35}
36
Douglas Gregoreaa75a62013-01-17 01:58:31 +000037// NOTE: "autolink_sub" is intentionally not linked.
38
Peter Collingbourne89061b22017-06-12 20:10:48 +000039// CHECK: !llvm.linker.options = !{![[AUTOLINK_PCH:[0-9]+]], ![[AUTOLINK_FRAMEWORK:[0-9]+]], ![[AUTOLINK:[0-9]+]], ![[DEPENDSONMODULE:[0-9]+]], ![[MODULE:[0-9]+]], ![[NOUMBRELLA:[0-9]+]]}
Filipe Cabecinhasd0dc5292015-02-28 07:35:07 +000040// CHECK: ![[AUTOLINK_PCH]] = !{!"{{(\\01|-l|/DEFAULTLIB:)}}autolink_from_pch{{(\.lib)?}}"}
Duncan P. N. Exon Smithb3a66692014-12-15 19:10:08 +000041// CHECK: ![[AUTOLINK_FRAMEWORK]] = !{!"-framework", !"autolink_framework"}
Filipe Cabecinhasd0dc5292015-02-28 07:35:07 +000042// CHECK: ![[AUTOLINK]] = !{!"{{(\\01|-l|/DEFAULTLIB:)}}autolink{{(\.lib)?}}"}
Duncan P. N. Exon Smithb3a66692014-12-15 19:10:08 +000043// CHECK: ![[DEPENDSONMODULE]] = !{!"-framework", !"DependsOnModule"}
44// CHECK: ![[MODULE]] = !{!"-framework", !"Module"}
45// CHECK: ![[NOUMBRELLA]] = !{!"-framework", !"NoUmbrella"}
Daniel Dunbare246fbe2013-04-16 18:21:19 +000046
47// CHECK-AUTOLINK-DISABLED: !llvm.module.flags
Peter Collingbourne89061b22017-06-12 20:10:48 +000048// CHECK-AUTOLINK-DISABLED-NOT: !llvm.linker.options