From: Sanjoy Das Date: Thu, 3 Sep 2015 22:27:42 +0000 (+0000) Subject: [IR] Have AttrBuilder::clear clear `TargetDepAttrs`. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=dc0eb17133567488576c3541a450665d51c3a3bb;p=oota-llvm.git [IR] Have AttrBuilder::clear clear `TargetDepAttrs`. Test case attached -- currently the parser smears the "foo bar" to all of the formal arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246812 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp index d909f7b880c..2586cb54c3e 100644 --- a/lib/IR/Attributes.cpp +++ b/lib/IR/Attributes.cpp @@ -1108,6 +1108,7 @@ AttrBuilder::AttrBuilder(AttributeSet AS, unsigned Index) void AttrBuilder::clear() { Attrs.reset(); + TargetDepAttrs.clear(); Alignment = StackAlignment = DerefBytes = DerefOrNullBytes = 0; } diff --git a/test/Assembler/incorrect-tdep-attrs-parsing.ll b/test/Assembler/incorrect-tdep-attrs-parsing.ll new file mode 100644 index 00000000000..bf8152b69dc --- /dev/null +++ b/test/Assembler/incorrect-tdep-attrs-parsing.ll @@ -0,0 +1,6 @@ +; RUN: llvm-as < %s | llvm-dis | FileCheck %s + +; CHECK: define i32 @f(i64 "foo bar", i64, i64, i64 "xyz") { +define i32 @f(i64 "foo bar", i64, i64, i64 "xyz") { + ret i32 41 +}