[PATCH] D85099: [UpdateTestChecks] Match unnamed values like "@[0-9]+" and "![0-9]+"

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 13:30:57 PDT 2020


jdoerfert added inline comments.


================
Comment at: llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/check_attrs.ll.funcattrs.expected:20
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@foo
-; IS__CGSCC____-SAME: (%struct.ST* nofree readnone [[S:%.*]]) #0
+; IS__CGSCC____-SAME: (%struct.ST* nofree readnone [[S:%.*]]) [[ATTRIBUTES0:#.*]]
 ; IS__CGSCC____-NEXT:  entry:
----------------
jdoerfert wrote:
> arichardson wrote:
> > Since we are capturing the attribute number instead of using a `#{{[0-9]+}}` regex, should we be using a non-capturing [[ATTRIBUTES0]] after the first time?
> > 
> > I guess this would require something like `global_vars_seen` in addition to `vars_seen`
> Argh, good catch. Will fix this for sure. 
I think here it actually made sense to capture the name again, it is a different prefix after all. However, I did introduce the global_vars_seen now changed the test to include two functions. All but `%{{.*}}` values are considered global and we will reuse the existing mapping from the same prefix. You can see `tbaa` is reused in the test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85099/new/

https://reviews.llvm.org/D85099



More information about the llvm-commits mailing list