diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:08 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:08 +0000 |
| commit | bab175ec4b075c8076ba14c762900392533f6ee4 (patch) | |
| tree | 01f4f29419a2cb10abe13c1e63cd2a66068b0137 /test/Modules/global-init.cpp | |
| parent | 8b7a8012d223fac5d17d16a66bb39168a9a1dfc0 (diff) | |
Notes
Diffstat (limited to 'test/Modules/global-init.cpp')
| -rw-r--r-- | test/Modules/global-init.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Modules/global-init.cpp b/test/Modules/global-init.cpp new file mode 100644 index 0000000000000..fb42464dcc92f --- /dev/null +++ b/test/Modules/global-init.cpp @@ -0,0 +1,19 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// +// RUN: echo '#pragma once' > %t/a.h +// RUN: echo 'struct A { A() {} int f() const; } const a;' >> %t/a.h +// +// RUN: echo '#include "a.h"' > %t/b.h +// +// RUN: echo 'module M { module b { header "b.h" export * } module a { header "a.h" export * } }' > %t/map +// +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fmodule-map-file=%t/map -I%t %s -emit-llvm -o - -triple %itanium_abi_triple | FileCheck %s + +#include "b.h" + +// CHECK: @_ZL1a = internal global +// CHECK: call {{.*}} @_ZN1AC1Ev({{.*}}@_ZL1a +// CHECK: call {{.*}} @_ZNK1A1fEv({{.*}}@_ZL1a +// CHECK: store {{.*}} @x +int x = a.f(); |
