gollvm: fix sret bug, update unit tests for call attr changes

Fix an off-by-one error in call attribute creation in CL 290532, and
update the output of a couple unit tests that are impacted by
the change.

Change-Id: Ia4c1cd2f5aa6afa1c46c5b8345d81a4966f05d6e
Reviewed-on: https://go-review.googlesource.com/c/gollvm/+/290671
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Than McIntosh <thanm@google.com>
diff --git a/bridge/go-llvm-materialize.cpp b/bridge/go-llvm-materialize.cpp
index 99fa552..acacbae 100644
--- a/bridge/go-llvm-materialize.cpp
+++ b/bridge/go-llvm-materialize.cpp
@@ -1330,7 +1330,7 @@
     llvm::AttrBuilder ab;
     ab.addAttribute(llvm::Attribute::StructRet);
     ab.addAttribute(llvm::Attribute::get(call->getContext(), "go_sret"));
-    argAttrs[1] = llvm::AttributeSet::get(context_, ab);
+    argAttrs[0] = llvm::AttributeSet::get(context_, ab);
   }
 
   // Nest attribute if needed
diff --git a/unittests/BackendCore/BackendCABIOracleTests.cpp b/unittests/BackendCore/BackendCABIOracleTests.cpp
index 98561e8..454c216 100644
--- a/unittests/BackendCore/BackendCABIOracleTests.cpp
+++ b/unittests/BackendCore/BackendCABIOracleTests.cpp
@@ -545,7 +545,7 @@
     %ld.3 = load double, double* %field0.1, align 8
     %field1.1 = getelementptr inbounds { double, <2 x float> }, { double, <2 x float> }* %cast.2, i32 0, i32 1
     %ld.4 = load <2 x float>, <2 x float>* %field1.1, align 8
-    %call.0 = call addrspace(0) { double, <2 x float> } @foo(i8* nest undef, <2 x float> %ld.1, i48 %ld.2, double %ld.3, <2 x float> %ld.4, i8 zeroext %sub.0, i8 signext %p4.ld.0, { { float, float, i16, i16, i16 }, { double, float, float } }* byval %p5)
+    %call.0 = call addrspace(0) { double, <2 x float> } @foo(i8* nest undef, <2 x float> %ld.1, i48 %ld.2, double %ld.3, <2 x float> %ld.4, i8 zeroext %sub.0, i8 signext %p4.ld.0, { { float, float, i16, i16, i16 }, { double, float, float } }* byval({ { float, float, i16, i16, i16 }, { double, float, float } }) %p5)
     %cast.3 = bitcast { double, float, float }* %sret.actual.0 to { double, <2 x float> }*
     store { double, <2 x float> } %call.0, { double, <2 x float> }* %cast.3, align 8
     %cast.4 = bitcast { double, float, float }* %sret.actual.0 to { double, <2 x float> }*