diff options
author | Bill Wendling <isanbard@gmail.com> | 2014-01-24 19:20:15 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2014-01-24 19:20:15 +0000 |
commit | d221469cc6c120e0b6ef28741d01bf99c62b16df (patch) | |
tree | f14fa535061d2f1ac54ae3bae966558e28dd17de /test/Linker | |
parent | d7053be532fbabaded65c4c2f578afeffd661d55 (diff) | |
download | llvm-d221469cc6c120e0b6ef28741d01bf99c62b16df.tar.gz llvm-d221469cc6c120e0b6ef28741d01bf99c62b16df.tar.bz2 llvm-d221469cc6c120e0b6ef28741d01bf99c62b16df.tar.xz |
Verify that attributes are not lost during linking.
We don't want to lose attributes when a function decl without them is merged
with a function decl that has them.
PR2382
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200030 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Linker')
-rw-r--r-- | test/Linker/func-attrs-a.ll | 14 | ||||
-rw-r--r-- | test/Linker/func-attrs-b.ll | 8 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/Linker/func-attrs-a.ll b/test/Linker/func-attrs-a.ll new file mode 100644 index 0000000000..d5495e1e3f --- /dev/null +++ b/test/Linker/func-attrs-a.ll @@ -0,0 +1,14 @@ +; RUN: llvm-link %s %p/func-attrs-b.ll -S -o - | FileCheck %s +; PR2382 + +; CHECK: call void @check0(%struct.S0* sret null, %struct.S0* byval align 4 null, %struct.S0* align 4 null, %struct.S0* byval align 4 null) +; CHECK: define void @check0(%struct.S0* sret %agg.result, %struct.S0* byval %arg0, %struct.S0* %arg1, %struct.S0* byval %arg2) + +%struct.S0 = type <{ i8, i8, i8, i8 }> + +define void @a() { + call void @check0(%struct.S0* sret null, %struct.S0* byval align 4 null, %struct.S0* align 4 null, %struct.S0* byval align 4 null) + ret void +} + +declare void @check0(%struct.S0*, %struct.S0*, %struct.S0*, %struct.S0*) diff --git a/test/Linker/func-attrs-b.ll b/test/Linker/func-attrs-b.ll new file mode 100644 index 0000000000..df78e5f54a --- /dev/null +++ b/test/Linker/func-attrs-b.ll @@ -0,0 +1,8 @@ +; This file is used with func-attrs-a.ll +; RUN: true + +%struct.S0 = type <{ i8, i8, i8, i8 }> + +define void @check0(%struct.S0* sret %agg.result, %struct.S0* byval %arg0, %struct.S0* %arg1, %struct.S0* byval %arg2) { + ret void +} |