summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-12-05 01:31:47 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-12-05 01:31:47 +0000
commit891fc7f37a0be80c59a791d283f5e568254c07fa (patch)
tree880831f30f7be7807a86934a43a5996f48133eac /clang/test/Modules
parent913b42b0e180044c343d666d29412b1b1ff59749 (diff)
downloadbcm5719-llvm-891fc7f37a0be80c59a791d283f5e568254c07fa.tar.gz
bcm5719-llvm-891fc7f37a0be80c59a791d283f5e568254c07fa.zip
Generalize "static data member instantiated" notification to cover variable templates too.
While here, split the "point of instantiation changed" notification out from it; these two really are orthogonal changes. llvm-svn: 319727
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/var-templates.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/Modules/var-templates.cpp b/clang/test/Modules/var-templates.cpp
new file mode 100644
index 00000000000..20e431bc90e
--- /dev/null
+++ b/clang/test/Modules/var-templates.cpp
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -fmodules -std=c++14 -emit-llvm %s -o - | FileCheck %s
+
+#pragma clang module build A
+module A {}
+#pragma clang module contents
+#pragma clang module begin A
+template<int> int n = 42;
+decltype(n<0>) f();
+#pragma clang module end
+#pragma clang module endbuild
+
+#pragma clang module build B
+module B {}
+#pragma clang module contents
+#pragma clang module begin B
+#pragma clang module import A
+inline int f() { return n<0>; }
+#pragma clang module end
+#pragma clang module endbuild
+
+#pragma clang module import B
+
+// CHECK: @_Z1nILi0EE = linkonce_odr global i32 42, comdat
+int g() { return f(); }
OpenPOWER on IntegriCloud