xref: /llvm-project/lld/test/MachO/uuid.s (revision f317ce218e75abe6bc0818709fbbb81657224ffe)
1# REQUIRES: x86
2# UNSUPPORTED: system-windows
3# RUN: rm -rf %t && mkdir -p %t
4# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/test.o
5# RUN: %lld -lSystem %t/test.o -o %t/a
6# RUN: %lld -lSystem %t/test.o -o %t/b
7# RUN: llvm-dwarfdump --uuid %t/a | awk '{print $2}' > %t/uuida
8# RUN: llvm-dwarfdump --uuid %t/b | awk '{print $2}' > %t/uuidb
9# RUN: FileCheck %s < %t/uuida
10# RUN: FileCheck %s < %t/uuidb
11# RUN: not cmp %t/uuida %t/uuidb
12
13## Ensure -final_output is used for universal binaries, which may be linked with
14## temporary output file names
15# RUN: %lld -lSystem %t/test.o -o %t/c -final_output %t/a
16# RUN: llvm-dwarfdump --uuid %t/c | awk '{print $2}' > %t/uuidc
17# RUN: cmp %t/uuida %t/uuidc
18
19## Test disabling UUID generation
20# RUN: %lld -lSystem %t/test.o -o %t/d -no_uuid
21# RUN: llvm-dwarfdump --uuid %t/d | count 0
22
23# CHECK: 4C4C44{{([[:xdigit:]]{2})}}-5555-{{([[:xdigit:]]{4})}}-A1{{([[:xdigit:]]{2})}}-{{([[:xdigit:]]{12})}}
24
25.globl _main
26_main:
27  ret
28