diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/NaCl/globalcleanup.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Transforms/NaCl/globalcleanup.ll b/test/Transforms/NaCl/globalcleanup.ll index 44e5b45e16..7e1fa3d8a5 100644 --- a/test/Transforms/NaCl/globalcleanup.ll +++ b/test/Transforms/NaCl/globalcleanup.ll @@ -16,6 +16,14 @@ ; CHECK: @weak_gv = internal global @weak_gv = weak global i32 0 +; Libc++'s declarations of iostream values are purely ``extern`` and +; unused otherwise which led to a bug when used as ``(void)std::clog``: +; the global would survive as ``external global`` post-link but without +; a proper definition. Global cleanup should take care of it. +; GV-NOT: ostream +%"class.fake_ostream" = type { i32 } +@ostream = external global %"class.fake_ostream" + ; CHECK: define void @_start define void @_start() { ret void @@ -35,6 +43,12 @@ define i32* @ewc() { ret i32* @extern_weak_gv } +; Make sure @weak_gv is actually used. +define i32* @wgv() { +; CHECK: ret i32* @weak_gv + ret i32* @weak_gv +} + ; GV-NOT: @extern_weak_func declare extern_weak i32 @extern_weak_func() ; CHECK: @ewf |