| Douglas Gregor | b6cbe51 | 2013-01-14 17:21:00 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
| Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 2 | // RUN: %clang_cc1 -emit-pch -fmodules-cache-path=%t -fmodules -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 -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 -F %S/Inputs -I %S/Inputs -include-pch %t.pch %s | FileCheck --check-prefix=CHECK-AUTOLINK-DISABLED %s |
| Douglas Gregor | b6cbe51 | 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 | 858afb3 | 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 | 3baad29 | 2013-01-14 19:00:05 +0000 | [diff] [blame] | 23 | @import DependsOnModule.SubFramework; |
| Douglas Gregor | 858afb3 | 2013-01-14 20:53:57 +0000 | [diff] [blame] | 24 | float *get_module_subframework_dep() { |
| Douglas Gregor | 3baad29 | 2013-01-14 19:00:05 +0000 | [diff] [blame] | 25 | return sub_framework; |
| Douglas Gregor | 8767dc2 | 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 | |
| Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 33 | int use_autolink_sub3() { |
| 34 | return autolink_sub3(); |
| 35 | } |
| 36 | |
| Douglas Gregor | 6987e8d | 2013-01-17 01:58:31 +0000 | [diff] [blame] | 37 | // NOTE: "autolink_sub" is intentionally not linked. |
| 38 | |
| Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame] | 39 | // CHECK: !llvm.module.flags = !{{{.*}}} |
| Stephen Hines | 0e2c34f | 2015-03-23 12:09:02 -0700 | [diff] [blame] | 40 | // CHECK: !{{[0-9]+}} = !{i32 6, !"Linker Options", ![[AUTOLINK_OPTIONS:[0-9]+]]} |
| 41 | // CHECK: ![[AUTOLINK_OPTIONS]] = !{![[AUTOLINK_PCH:[0-9]+]], ![[AUTOLINK_FRAMEWORK:[0-9]+]], ![[AUTOLINK:[0-9]+]], ![[DEPENDSONMODULE:[0-9]+]], ![[MODULE:[0-9]+]], ![[NOUMBRELLA:[0-9]+]]} |
| Pirama Arumuga Nainar | 3ea9e33 | 2015-04-08 08:57:32 -0700 | [diff] [blame] | 42 | // CHECK: ![[AUTOLINK_PCH]] = !{!"{{(\\01|-l|/DEFAULTLIB:)}}autolink_from_pch{{(\.lib)?}}"} |
| Stephen Hines | 0e2c34f | 2015-03-23 12:09:02 -0700 | [diff] [blame] | 43 | // CHECK: ![[AUTOLINK_FRAMEWORK]] = !{!"-framework", !"autolink_framework"} |
| Pirama Arumuga Nainar | 3ea9e33 | 2015-04-08 08:57:32 -0700 | [diff] [blame] | 44 | // CHECK: ![[AUTOLINK]] = !{!"{{(\\01|-l|/DEFAULTLIB:)}}autolink{{(\.lib)?}}"} |
| Stephen Hines | 0e2c34f | 2015-03-23 12:09:02 -0700 | [diff] [blame] | 45 | // CHECK: ![[DEPENDSONMODULE]] = !{!"-framework", !"DependsOnModule"} |
| 46 | // CHECK: ![[MODULE]] = !{!"-framework", !"Module"} |
| 47 | // CHECK: ![[NOUMBRELLA]] = !{!"-framework", !"NoUmbrella"} |
| Daniel Dunbar | f491013 | 2013-04-16 18:21:19 +0000 | [diff] [blame] | 48 | |
| 49 | // CHECK-AUTOLINK-DISABLED: !llvm.module.flags |
| 50 | // CHECK-AUTOLINK-DISABLED-NOT: "Linker Options" |