llvm-project/lld/test/COFF/resource.test
Eric Beckmann c8dba240b1 Revert "Revert "Revert "Revert "Switch external cvtres.exe for llvm's own resource library.""""
This reverts commit 147f45ff24456aea59575fa4ac16c8fa554df46a.

Revert "Revert "Revert "Revert "Replace trivial use of external rc.exe by writing our own .res file.""""

This reverts commit 61a90a67ed54a1f0dfeab457b65abffa129569e4.

The patches were intially reverted because they were causing a failure
on CrWinClangLLD.  Unfortunately, this was done haphazardly and didn't
compile, so the revert was reverted again quickly to fix this.  One that
was done, the revert of the revert was itself reverted.  This allowed me
to finally fix the actual bug in r307452.  This patch re-enables the
code path that had originally been causing the bug, now that it (should)
be fixed.

llvm-svn: 307460
2017-07-08 03:06:10 +00:00

45 lines
2.2 KiB
Plaintext

# RUN: yaml2obj < %p/Inputs/ret42.yaml > %t.obj
# RUN: lld-link /out:%t.exe /entry:main %t.obj %p/Inputs/resource.res
# Check if the binary contains UTF-16LE string "Hello" copied from resource.res.
# RUN: FileCheck --check-prefix=EXE %s < %t.exe
EXE: {{H.e.l.l.o}}
# Verify the resource tree layout in the final executable.
# RUN: llvm-readobj -file-headers -coff-resources -section-data %t.exe | \
# RUN: FileCheck --check-prefix=RESOURCE_INFO %s
RESOURCE_INFO: ResourceTableRVA: 0x1000
RESOURCE_INFO-NEXT: ResourceTableSize: 0x88
RESOURCE_INFO-DAG: Resources [
RESOURCE_INFO-NEXT: Total Number of Resources: 1
RESOURCE_INFO-NEXT: Base Table Address: 0x400
RESOURCE_INFO-DAG: Number of String Entries: 0
RESOURCE_INFO-NEXT: Number of ID Entries: 1
RESOURCE_INFO-NEXT: Type: kRT_STRING (ID 6) [
RESOURCE_INFO-NEXT: Table Offset: 0x18
RESOURCE_INFO-NEXT: Number of String Entries: 0
RESOURCE_INFO-NEXT: Number of ID Entries: 1
RESOURCE_INFO-NEXT: Name: (ID 1) [
RESOURCE_INFO-NEXT: Table Offset: 0x30
RESOURCE_INFO-NEXT: Number of String Entries: 0
RESOURCE_INFO-NEXT: Number of ID Entries: 1
RESOURCE_INFO-NEXT: Language: (ID 1033) [
RESOURCE_INFO-NEXT: Entry Offset: 0x48
RESOURCE_INFO-NEXT: Time/Date Stamp: 1970-01-01 00:00:00 (0x0)
RESOURCE_INFO-NEXT: Major Version: 0
RESOURCE_INFO-NEXT: Minor Version: 0
RESOURCE_INFO-NEXT: Characteristics: 0
RESOURCE_INFO-DAG: .rsrc Data (
RESOURCE_INFO-NEXT: 0000: 00000000 00000000 00000000 00000100 |................|
RESOURCE_INFO-NEXT: 0010: 06000000 18000080 00000000 00000000 |................|
RESOURCE_INFO-NEXT: 0020: 00000000 00000100 01000000 30000080 |............0...|
RESOURCE_INFO-NEXT: 0030: 00000000 00000000 00000000 00000100 |................|
RESOURCE_INFO-NEXT: 0040: 09040000 48000000 58100000 2A000000 |....H...X...*...|
RESOURCE_INFO-NEXT: 0050: 00000000 00000000 00000500 48006500 |............H.e.|
RESOURCE_INFO-NEXT: 0060: 6C006C00 6F000000 00000000 00000000 |l.l.o...........|
RESOURCE_INFO-NEXT: 0070: 00000000 00000000 00000000 00000000 |................|
RESOURCE_INFO-NEXT: 0080: 00000000 00000000 |........|
RESOURCE_INFO-NEXT: )