[llvm] Add option to dump IR to files intstead of stderr (PR #66412)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 16:20:57 PDT 2023


================
@@ -0,0 +1,57 @@
+; RUN: mkdir -p %t/logs
+; RUN: rm -rf %t/logs
+
+; Basic dump before and after a single module pass
+
+; RUN: opt %s -disable-output -passes='no-op-module' -ir-dump-directory %t/logs -print-after=no-op-module -print-before=no-op-module
+; RUN: find %t/logs -type f -print | sort | FileCheck %s --check-prefix=SINGLE-PASS
----------------
kyulee-com wrote:

> I will say using sort won't work if there are more than 9 passes (10-foo is alphabetically before 8-bar), so this test could be a little fragile.

I think you can try `sort -n` to sort the files based on the first numeric value.

https://github.com/llvm/llvm-project/pull/66412


More information about the llvm-commits mailing list