[PATCH] D118646: [lld-macho][test] Add test for UUID format

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 20:32:21 PST 2022


int3 added inline comments.


================
Comment at: lld/test/MachO/uuid.s:5
+# RUN: llvm-dwarfdump --uuid %t | FileCheck %s
+# CHECK: 4C4C44{{([[:xdigit:]]{2})}}-5555-{{([[:xdigit:]]{4})}}-A1{{([[:xdigit:]]{2})}}-{{([[:xdigit:]]{8})}}
+
----------------
thevinster wrote:
> How come we can't do strict match here? It shouldn't ever change right? Also, `{{([[:xdigit:]]{8})}}` should be 12? `LC_UUID` shows 12 characters for me on that. 
> It shouldn't ever change right?

The UUID is a hash, so if we e.g. adjusted how LLD encodes something in the mach header, this would change. It would be annoying to have to update it every time something like that happens.

Also, by using a regex, we can make it clear what behavior is invariant across all binaries, not just this specific one.

> LC_UUID shows 12 characters for me on that.

Whoops, you're right, good catch!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118646



More information about the llvm-commits mailing list