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