1 // RUN: rm -rf %t
2 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fmodules-cache-path=%t %s -emit-llvm -o - | FileCheck %s
3 
4 // CHECK: @{{.*var.*}} = {{.*}} %union.union_type { i8 1 },
5 
6 #pragma clang module build bar
7 module bar {
8   header "bar.h" { size 40 mtime 0 }
9   export *
10 }
11 #pragma clang module contents
12 #pragma clang module begin bar
13 union union_type {
14   char h{1};
15 };
16 #pragma clang module end
17 #pragma clang module endbuild
18 #pragma clang module build foo
19 module foo {
20   header "foo.h" { size 97 mtime 0 }
21   export *
22 }
23 #pragma clang module contents
24 #pragma clang module begin foo
25 union union_type {
26   char h{1};
27 };
28 #pragma clang module import bar
29 template<typename T>
30 union_type var;
31 #pragma clang module end
32 #pragma clang module endbuild
33 #pragma clang module import foo
main()34 int main() {
35   (void)&var<int>;
36 }
37