[PATCH] D10725: Improve testing for the C API

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 15:27:30 PST 2016


echristo added a comment.

Few more inline comments and can you mark the ones you've completed as Done please?

Thanks!

-eric


================
Comment at: tools/llvm-c-test/calc.c:17
@@ -16,3 +16,2 @@
 #include "llvm-c-test.h"
-#include "llvm-c/Core.h"
 #include <stdio.h>
----------------
Ah, I see you're doing it in this patch. OK.

================
Comment at: tools/llvm-c-test/echo.cpp:13
@@ +12,3 @@
+// This command use the C API to read a module and output an exact copy of it
+// as output. It used to check that the output matches the input in order to
+// validate that the C API allow to read and write modules properly.
----------------
"This command uses the C API to read a module and output an exact copy of it as output. It is used to check that the resulting module matches the input to validate that the C API can read and write modules properly."

================
Comment at: tools/llvm-c-test/echo.cpp:77-81
@@ +76,7 @@
+      return LLVMIntTypeInContext(Ctx, LLVMGetIntTypeWidth(Src));
+    case LLVMFunctionTypeKind: {
+      unsigned ParamCount = LLVMCountParamTypes(Src);
+      LLVMTypeRef* Params = nullptr;
+      if (ParamCount > 0) {
+        Params = (LLVMTypeRef*) malloc(ParamCount * sizeof(LLVMTypeRef));
+        LLVMGetParamTypes(Src, Params);
----------------
Yep :)


http://reviews.llvm.org/D10725





More information about the llvm-commits mailing list