[PATCH] D42830: Add and link to a testing philosophy document in the developer documentation.

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 17:58:30 PST 2018


MatzeB accepted this revision.
MatzeB added a comment.
This revision is now accepted and ready to land.

Thanks for writing this! And LGTM in it's current form already.

I wonder if we should mention unittests here... As the whole llc/opt per-pass testing thing works nice for the majority of our testing. But we still have `llvm/unittests` for the cases where it doesn't...



================
Comment at: docs/TestingPolicy.rst:42
+
+``clang -O0 -mllvm -disable-llvm-optzns -S a.c -o - -emit-llvm | FileCheck %s``
+
----------------
I hate making a simple example more complicated... But I would add `-disable-O0-optnone` to the clang commandline as many developers get biten by that nowadays.


================
Comment at: docs/TestingPolicy.rst:67-69
+or even:
+
+``llc a.ll -S -o - | FileCheck %s``
----------------
as you mention testing a single-pass in opt you should also mention:

``llc -o - a.mir -run-pass=peephole-opt | FileCheck %s``


================
Comment at: docs/TestingPolicy.rst:93-94
+
+   ``clang++  -O0 -mllvm -disable-llvm-optzns -S a.cc -o - -emit-llvm | opt -O3
+   -S | llc -O3``
+
----------------
see above


================
Comment at: docs/TestingPolicy.rst:109-110
+
+   You’re a compiler developer now! We want to be more able to pinpoint bugs
+   when something fails under testing.
+
----------------
The first sentence seems a bit too much tongue in cheek...

You could also switch the perspective here: "You should make it easy for others to fix your bugs".


Repository:
  rL LLVM

https://reviews.llvm.org/D42830





More information about the llvm-commits mailing list