Douglas Gregor | 6ddfca9 | 2013-01-14 17:21:00 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 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 |
Douglas Gregor | 6ddfca9 | 2013-01-14 17:21:00 +0000 | [diff] [blame] | 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 | |
Douglas Gregor | bc25ff4 | 2013-01-14 20:53:57 +0000 | [diff] [blame] | 18 | @import Module.SubFramework; |
| 19 | const char *get_module_subframework() { |
| 20 | return module_subframework; |
| 21 | } |
| 22 | |
Douglas Gregor | 1715a2f | 2013-01-14 19:00:05 +0000 | [diff] [blame] | 23 | @import DependsOnModule.SubFramework; |
Douglas Gregor | bc25ff4 | 2013-01-14 20:53:57 +0000 | [diff] [blame] | 24 | float *get_module_subframework_dep() { |
Douglas Gregor | 1715a2f | 2013-01-14 19:00:05 +0000 | [diff] [blame] | 25 | return sub_framework; |
Douglas Gregor | 11dfe6f | 2013-01-14 17:57:51 +0000 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | @import NoUmbrella; |
| 29 | int use_no_umbrella() { |
| 30 | return no_umbrella_A; |
| 31 | } |
| 32 | |
Ben Langmuir | 332aafe | 2014-01-31 01:06:56 +0000 | [diff] [blame] | 33 | int use_autolink_sub3() { |
| 34 | return autolink_sub3(); |
| 35 | } |
| 36 | |
Douglas Gregor | eaa75a6 | 2013-01-17 01:58:31 +0000 | [diff] [blame] | 37 | // NOTE: "autolink_sub" is intentionally not linked. |
| 38 | |
Peter Collingbourne | 89061b2 | 2017-06-12 20:10:48 +0000 | [diff] [blame] | 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]+]]} |
Filipe Cabecinhas | d0dc529 | 2015-02-28 07:35:07 +0000 | [diff] [blame] | 40 | // CHECK: ![[AUTOLINK_PCH]] = !{!"{{(\\01|-l|/DEFAULTLIB:)}}autolink_from_pch{{(\.lib)?}}"} |
Duncan P. N. Exon Smith | b3a6669 | 2014-12-15 19:10:08 +0000 | [diff] [blame] | 41 | // CHECK: ![[AUTOLINK_FRAMEWORK]] = !{!"-framework", !"autolink_framework"} |
Filipe Cabecinhas | d0dc529 | 2015-02-28 07:35:07 +0000 | [diff] [blame] | 42 | // CHECK: ![[AUTOLINK]] = !{!"{{(\\01|-l|/DEFAULTLIB:)}}autolink{{(\.lib)?}}"} |
Duncan P. N. Exon Smith | b3a6669 | 2014-12-15 19:10:08 +0000 | [diff] [blame] | 43 | // CHECK: ![[DEPENDSONMODULE]] = !{!"-framework", !"DependsOnModule"} |
| 44 | // CHECK: ![[MODULE]] = !{!"-framework", !"Module"} |
| 45 | // CHECK: ![[NOUMBRELLA]] = !{!"-framework", !"NoUmbrella"} |
Daniel Dunbar | e246fbe | 2013-04-16 18:21:19 +0000 | [diff] [blame] | 46 | |
| 47 | // CHECK-AUTOLINK-DISABLED: !llvm.module.flags |
Peter Collingbourne | 89061b2 | 2017-06-12 20:10:48 +0000 | [diff] [blame] | 48 | // CHECK-AUTOLINK-DISABLED-NOT: !llvm.linker.options |