blob: eca2428739693591ff97cd97acf081e2b377ff2d [file] [log] [blame]
Richard Smithfa285df2017-12-05 21:29:36 +00001// RUN: %clang_cc1 -fmodules -std=c++14 -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s
Richard Smith891fc7f2017-12-05 01:31:47 +00002
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(); }