]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Modules/autolink.m
Vendor import of clang trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / test / Modules / autolink.m
1 // RUN: rm -rf %t
2 // 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
5
6 @import autolink.sub2;
7
8 int f() {
9   return autolink_sub2();
10 }
11
12 @import autolink;
13
14 int g() {
15   return autolink;
16 }
17
18 @import Module.SubFramework;
19 const char *get_module_subframework() {
20   return module_subframework;
21 }
22
23 @import DependsOnModule.SubFramework;
24 float *get_module_subframework_dep() {
25   return sub_framework;
26 }
27
28 @import NoUmbrella;
29 int use_no_umbrella() {
30   return no_umbrella_A;
31 }
32
33 int use_autolink_sub3() {
34   return autolink_sub3();
35 }
36
37 // NOTE: "autolink_sub" is intentionally not linked.
38
39 // CHECK: !llvm.linker.options = !{![[AUTOLINK_PCH:[0-9]+]], ![[AUTOLINK_FRAMEWORK:[0-9]+]], ![[AUTOLINK:[0-9]+]], ![[DEPENDSONMODULE:[0-9]+]], ![[MODULE:[0-9]+]], ![[NOUMBRELLA:[0-9]+]]}
40 // CHECK: ![[AUTOLINK_PCH]] = !{!"{{(\\01|-l|/DEFAULTLIB:|lib", !")}}autolink_from_pch{{(\.lib)?}}"}
41 // CHECK: ![[AUTOLINK_FRAMEWORK]] = !{!"-framework", !"autolink_framework"}
42 // CHECK: ![[AUTOLINK]] = !{!"{{(\\01|-l|/DEFAULTLIB:|lib", !")}}autolink{{(\.lib)?}}"}
43 // CHECK: ![[DEPENDSONMODULE]] = !{!"-framework", !"DependsOnModule"}
44 // CHECK: ![[MODULE]] = !{!"-framework", !"Module"}
45 // CHECK: ![[NOUMBRELLA]] = !{!"-framework", !"NoUmbrella"}
46
47 // CHECK-AUTOLINK-DISABLED: !llvm.module.flags
48 // CHECK-AUTOLINK-DISABLED-NOT: !llvm.linker.options