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 8int f() { 9 return autolink_sub2(); 10} 11 12@import autolink; 13 14int g() { 15 return autolink; 16} 17 18@import Module.SubFramework; 19const char *get_module_subframework() { 20 return module_subframework; 21} 22 23@import DependsOnModule.SubFramework; 24float *get_module_subframework_dep() { 25 return sub_framework; 26} 27 28@import NoUmbrella; 29int use_no_umbrella() { 30 return no_umbrella_A; 31} 32 33int 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]] = !{!"{{(-l|/DEFAULTLIB:|lib", !")}}autolink_from_pch{{(\.lib)?}}"} 41// CHECK: ![[AUTOLINK_FRAMEWORK]] = !{!"-framework", !"autolink_framework"} 42// CHECK: ![[AUTOLINK]] = !{!"{{(-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 49