Richard Smith | 891fc7f | 2017-12-05 01:31:47 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fmodules -std=c++14 -emit-llvm %s -o - | FileCheck %s |
| 2 | |
| 3 | #pragma clang module build A |
| 4 | module A {} |
| 5 | #pragma clang module contents |
| 6 | #pragma clang module begin A |
| 7 | template<int> int n = 42; |
| 8 | decltype(n<0>) f(); |
| 9 | #pragma clang module end |
| 10 | #pragma clang module endbuild |
| 11 | |
| 12 | #pragma clang module build B |
| 13 | module B {} |
| 14 | #pragma clang module contents |
| 15 | #pragma clang module begin B |
| 16 | #pragma clang module import A |
| 17 | inline 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 |
| 24 | int g() { return f(); } |