[llvm] r200030 - Verify that attributes are not lost during linking.

Bill Wendling isanbard at gmail.com
Fri Jan 24 11:20:16 PST 2014


Author: void
Date: Fri Jan 24 13:20:15 2014
New Revision: 200030

URL: http://llvm.org/viewvc/llvm-project?rev=200030&view=rev
Log:
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

Added:
    llvm/trunk/test/Linker/func-attrs-a.ll
    llvm/trunk/test/Linker/func-attrs-b.ll

Added: llvm/trunk/test/Linker/func-attrs-a.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/func-attrs-a.ll?rev=200030&view=auto
==============================================================================
--- llvm/trunk/test/Linker/func-attrs-a.ll (added)
+++ llvm/trunk/test/Linker/func-attrs-a.ll Fri Jan 24 13:20:15 2014
@@ -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*)

Added: llvm/trunk/test/Linker/func-attrs-b.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/func-attrs-b.ll?rev=200030&view=auto
==============================================================================
--- llvm/trunk/test/Linker/func-attrs-b.ll (added)
+++ llvm/trunk/test/Linker/func-attrs-b.ll Fri Jan 24 13:20:15 2014
@@ -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
+}





More information about the llvm-commits mailing list