[Orc] Make the makeStub function propagate argument attributes onto the call to
the function body.

This is necessary for correctness when lazily compiling.

Also, flesh out the Orc unit test infrastructure slightly, and add a unit test
for this.

llvm-svn: 235347
diff --git a/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.cpp b/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.cpp
new file mode 100644
index 0000000..5fea3c8
--- /dev/null
+++ b/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.cpp
@@ -0,0 +1,23 @@
+//===--------- OrcTestCommon.cpp - Utilities for Orc Unit Tests -----------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Common utilities for Orc unit tests.
+//
+//===----------------------------------------------------------------------===//
+
+#include "OrcTestCommon.h"
+
+using namespace llvm;
+
+ModuleBuilder::ModuleBuilder(LLVMContext &Context, StringRef Triple,
+                             StringRef Name)
+  : M(new Module(Name, Context)),
+    Builder(Context) {
+  M->setTargetTriple(Triple);
+}