[PATCH] D152921: [lld] Synthesize metadata for MTE globals
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 11 10:42:01 PDT 2023
MaskRay added a comment.
I'll read this shortly...
================
Comment at: lld/test/ELF/aarch64-memtag-globals.s:3
+
+# RUN: split-file %S/Inputs/aarch64-memtag-globals.s %t
+# RUN: llvm-mc --filetype=obj -triple=aarch64-none-linux-android \
----------------
We typically `rm -rf %t` the directory, especially for a large test with many temporary files. Otherwise, if we remove an output file, the test may sometimes still pass as there is a lingering file in our build directory.
================
Comment at: lld/test/ELF/aarch64-memtag-globals.s:18
+
+# CHECK: Symbol table '.dynsym' contains
+# CHECK-DAG: {{0*}}[[GLOBAL:[0-9a-f]+]] 32 OBJECT GLOBAL DEFAULT {{.*}} global{{$}}
----------------
For newer tests, we align the value of `CHECK` to look better
```
# CHECK: check
# CHECK-NEXT: no indentation
# CHECK-NEXT: 2-space indentation
```
================
Comment at: lld/test/ELF/aarch64-memtag-globals.s:19
+# CHECK: Symbol table '.dynsym' contains
+# CHECK-DAG: {{0*}}[[GLOBAL:[0-9a-f]+]] 32 OBJECT GLOBAL DEFAULT {{.*}} global{{$}}
+# CHECK-DAG: {{0*}}[[GLOBAL_UNTAGGED:[0-9a-f]+]] 4 OBJECT GLOBAL DEFAULT {{.*}} global_untagged{{$}}
----------------
Ignoring a decimal number prefers `[[#]]`
================
Comment at: lld/test/ELF/aarch64-memtag-globals.s:21
+# CHECK-DAG: {{0*}}[[GLOBAL_UNTAGGED:[0-9a-f]+]] 4 OBJECT GLOBAL DEFAULT {{.*}} global_untagged{{$}}
+# CHECK-DAG: {{0*}}[[CONST_GLOBAL:[0-9a-f]+]] 4 OBJECT GLOBAL DEFAULT {{.*}} const_global{{$}}
+# CHECK-DAG: {{0*}}[[GLOBAL_EXTERN:[0-9a-f]+]] 16 OBJECT GLOBAL DEFAULT {{.*}} global_extern{{$}}
----------------
`[0-9a-f]+` can be replaced with `[[#%x,xxx:]]`, though the references need to look like `[[#xxx]]`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152921/new/
https://reviews.llvm.org/D152921
More information about the llvm-commits
mailing list