summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/autolink.m
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-01-14 17:21:00 +0000
committerDouglas Gregor <dgregor@apple.com>2013-01-14 17:21:00 +0000
commit6ddfca91e04e62089d685b31533b9a2d677d9a5e (patch)
treeb803eaa1d88091fd5b65134468b8e922c1deb773 /clang/test/Modules/autolink.m
parent3778f27b2302c69ce1d9d4af70aab60143fd5b54 (diff)
downloadbcm5719-llvm-6ddfca91e04e62089d685b31533b9a2d677d9a5e.tar.gz
bcm5719-llvm-6ddfca91e04e62089d685b31533b9a2d677d9a5e.zip
Implement parsing, AST, (de-)serialization, and placeholder global
metadata for linking against the libraries/frameworks for imported modules. The module map language is extended with a new "link" directive that specifies what library or framework to link against when a module is imported, e.g., link "clangAST" or link framework "MyFramework" Importing the corresponding module (or any of its submodules) will eventually link against the named library/framework. For now, I've added some placeholder global metadata that encodes the imported libraries/frameworks, so that we can test that this information gets through to the IR. The format of the data is still under discussion. llvm-svn: 172437
Diffstat (limited to 'clang/test/Modules/autolink.m')
-rw-r--r--clang/test/Modules/autolink.m18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Modules/autolink.m b/clang/test/Modules/autolink.m
new file mode 100644
index 00000000000..e4db6991fca
--- /dev/null
+++ b/clang/test/Modules/autolink.m
@@ -0,0 +1,18 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -emit-llvm -o - -fmodule-cache-path %t -fmodules -F %S/Inputs -I %S/Inputs %s | FileCheck %s
+
+@import autolink.sub2;
+
+int f() {
+ return autolink_sub2();
+}
+
+@import autolink;
+
+int g() {
+ return autolink;
+}
+
+// CHECK: !llvm.link.libraries = !{![[AUTOLINK:[0-9]+]], ![[AUTOLINK_FRAMEWORK:[0-9]+]]}
+// CHECK: ![[AUTOLINK]] = metadata !{metadata !"autolink", i1 false}
+// CHECK: ![[AUTOLINK_FRAMEWORK]] = metadata !{metadata !"autolink_framework", i1 true}
OpenPOWER on IntegriCloud