1 // RUN: rm -rf %t 2 // RUN: %clang_cc1 -emit-llvm -o - -fmodules-cache-path=%t -fmodules -F %S/Inputs -I %S/Inputs %s | FileCheck %s 3 // RUN: %clang_cc1 -emit-llvm -fno-autolink -o - -fmodules-cache-path=%t -fmodules -F %S/Inputs -I %S/Inputs %s | FileCheck --check-prefix=CHECK-AUTOLINK-DISABLED %s 4 5 @import autolink.sub2; 6 7 int f() { 8 return autolink_sub2(); 9 } 10 11 @import autolink; 12 13 int g() { 14 return autolink; 15 } 16 17 @import Module.SubFramework; 18 const char *get_module_subframework() { 19 return module_subframework; 20 } 21 22 @import DependsOnModule.SubFramework; 23 float *get_module_subframework_dep() { 24 return sub_framework; 25 } 26 27 @import NoUmbrella; 28 int use_no_umbrella() { 29 return no_umbrella_A; 30 } 31 32 // NOTE: "autolink_sub" is intentionally not linked. 33 34 // CHECK: !llvm.module.flags = !{!0, !1, !2, !3, !4} 35 // CHECK: !4 = metadata !{i32 6, metadata !"Linker Options", metadata ![[AUTOLINK_OPTIONS:[0-9]+]]} 36 // CHECK: ![[AUTOLINK_OPTIONS]] = metadata !{metadata ![[AUTOLINK_FRAMEWORK:[0-9]+]], metadata ![[AUTOLINK:[0-9]+]], metadata ![[DEPENDSONMODULE:[0-9]+]], metadata ![[MODULE:[0-9]+]], metadata ![[NOUMBRELLA:[0-9]+]]} 37 // CHECK: ![[AUTOLINK_FRAMEWORK]] = metadata !{metadata !"-framework", metadata !"autolink_framework"} 38 // CHECK: ![[AUTOLINK]] = metadata !{metadata !"{{(-l|/DEFAULTLIB:)}}autolink{{(\.lib)?}}"} 39 // CHECK: ![[DEPENDSONMODULE]] = metadata !{metadata !"-framework", metadata !"DependsOnModule"} 40 // CHECK: ![[MODULE]] = metadata !{metadata !"-framework", metadata !"Module"} 41 // CHECK: ![[NOUMBRELLA]] = metadata !{metadata !"-framework", metadata !"NoUmbrella"} 42 43 // CHECK-AUTOLINK-DISABLED: !llvm.module.flags 44 // CHECK-AUTOLINK-DISABLED-NOT: "Linker Options" 45