[PATCH] D46223: Introduce a direct LLVM IR execution UnitTests framework, and add the first such test.

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 30 19:13:44 PDT 2018


dberris added a comment.

I wonder whether it's better/useful to implement these eventually as Google Test / Google Mock matchers. Something to think about in the future maybe.



================
Comment at: Bitcode/UnitTests/README.md:23-24
+
+To refresh the textual IR for these tests, use the script `update_ll.sh`. It
+will recreate the `.ll` file next to each `.bc` by disassembling it with the
+`llvm-dis` binary found in your `$PATH`. Note that this will in many cases
----------------
I don't see an update_ll.sh file, does it already exist in the parent directory?


================
Comment at: Bitcode/UnitTests/large_int/driver.cpp:51-53
+    for (int i = 0; i < (NumChunks - 1); ++i)
+    LHS.Chunks[i] = -1;
+    RHS.Chunks[0] = 1;
----------------
Reformat? I suspect you intended to indent the `LHS.Chunks[i] = -1` statement?


================
Comment at: Bitcode/UnitTests/update_bc.sh:1-4
+#!/bin/sh
+#
+# This script simply finds all .ll files in immediate subdirectories of the
+# script itself and runs `llvm-as` to convert them into bitcode.
----------------
My CMake-fu is not strong, but is it possible/valuable to make this run as part of the testing process? i.e. checking that we can generate the .bc files from the .ll files?


Repository:
  rT test-suite

https://reviews.llvm.org/D46223





More information about the llvm-commits mailing list