blob: 20e431bc90e787ec41fa1e7fe41b28bf7dc7ff7b [file] [log] [blame]
Richard Smith891fc7f2017-12-05 01:31:47 +00001// RUN: %clang_cc1 -fmodules -std=c++14 -emit-llvm %s -o - | FileCheck %s
2
3#pragma clang module build A
4module A {}
5#pragma clang module contents
6#pragma clang module begin A
7template<int> int n = 42;
8decltype(n<0>) f();
9#pragma clang module end
10#pragma clang module endbuild
11
12#pragma clang module build B
13module B {}
14#pragma clang module contents
15#pragma clang module begin B
16#pragma clang module import A
17inline int f() { return n<0>; }
18#pragma clang module end
19#pragma clang module endbuild
20
21#pragma clang module import B
22
23// CHECK: @_Z1nILi0EE = linkonce_odr global i32 42, comdat
24int g() { return f(); }