diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-09-05 21:27:52 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-09-05 21:27:52 +0000 |
| commit | d31dc048ca01fbeb4cee31189d8a4e5ca41a5a44 (patch) | |
| tree | ee307e23933ce4a73c9fe16c0e03d446abda027a /llvm/test/Linker/ctors.ll | |
| parent | 4bce548a6bb96d8cc14eaa4a3bd95c9a14a64c5e (diff) | |
| download | bcm5719-llvm-d31dc048ca01fbeb4cee31189d8a4e5ca41a5a44.tar.gz bcm5719-llvm-d31dc048ca01fbeb4cee31189d8a4e5ca41a5a44.zip | |
Fix pr20078.
When linking llvm.global_ctors with the optional third element we have to handle
it specially and only copy the elements whose keys were also copied.
llvm-svn: 217281
Diffstat (limited to 'llvm/test/Linker/ctors.ll')
| -rw-r--r-- | llvm/test/Linker/ctors.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Linker/ctors.ll b/llvm/test/Linker/ctors.ll new file mode 100644 index 00000000000..67bf4563718 --- /dev/null +++ b/llvm/test/Linker/ctors.ll @@ -0,0 +1,15 @@ +; RUN: llvm-link %s %p/Inputs/ctors.ll -S -o - | \ +; RUN: FileCheck --check-prefix=ALL --check-prefix=CHECK1 %s +; RUN: llvm-link %p/Inputs/ctors.ll %s -S -o - | \ +; RUN: FileCheck --check-prefix=ALL --check-prefix=CHECK2 %s + +@v = weak global i8 0 +; CHECK1: @v = weak global i8 0 +; CHECK2: @v = weak global i8 1 + +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* @v }] +; ALL: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* @v }] + +define weak void @f() { + ret void +} |

