[Mlir-commits] [mlir] [mlir][Pass] Handle escaped pipline option values (PR #97667)

Nikhil Kalra llvmlistbot at llvm.org
Thu Jul 4 10:07:41 PDT 2024


================
@@ -7,6 +7,8 @@
 // RUN: mlir-opt %s -verify-each=false -pass-pipeline='builtin.module(func.func(test-options-pass{string-list=a list=1,2,3,4 string-list=b,c list=5 string-list=d string=nested_pipeline{arg1=10 arg2=" {} " arg3=true}}))' -dump-pass-pipeline 2>&1 | FileCheck --check-prefix=CHECK_1 %s
 // RUN: mlir-opt %s -verify-each=false -test-options-pass-pipeline='list=1 string-list=a,b enum=one' -dump-pass-pipeline 2>&1 | FileCheck --check-prefix=CHECK_2 %s
 // RUN: mlir-opt %s -verify-each=false -pass-pipeline='builtin.module(builtin.module(func.func(test-options-pass{list=3}), func.func(test-options-pass{enum=one list=1,2,3,4})))' -dump-pass-pipeline 2>&1 | FileCheck --check-prefix=CHECK_3 %s
+// RUN: mlir-opt %s -verify-each=false -pass-pipeline='builtin.module(builtin.module(func.func(test-options-pass{list=3}), func.func(test-options-pass{enum=one list=1,2,3,4 string="foobarbaz"})))' -dump-pass-pipeline 2>&1 | FileCheck --check-prefix=CHECK_4 %s
----------------
nikalra wrote:

I added a new test with spaces, but I'm not too happy with it because the resulting output from `-dump-pass-pipeline` can't be round-tripped. I can also update the printer to add escape sequences back in when printing if you feel that'd be a good addition.

I also left in the test without spaces to validate the following:
`option="foo"` → option: `"foo"` (incorrect, should be `foo`)

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


More information about the Mlir-commits mailing list