Compiler projects using llvm
# RUN: yaml2obj -D DESC='0d000000' %s -o %t
# RUN: llvm-readelf --notes %t | FileCheck %s --check-prefixes=GNU,GNU-OK,ASYNC,HEAP,STACK
# RUN: llvm-readobj --notes %t | FileCheck %s --check-prefixes=LLVM,LLVM-OK,ASYNC,HEAP,STACK

# RUN: yaml2obj -D DESC='0e000000' %s -o %t
# RUN: llvm-readelf --notes %t | FileCheck %s --check-prefixes=GNU,GNU-OK,SYNC,HEAP,STACK
# RUN: llvm-readobj --notes %t | FileCheck %s --check-prefixes=LLVM,LLVM-OK,SYNC,HEAP,STACK

# RUN: yaml2obj -D DESC='05000000' %s -o %t
# RUN: llvm-readelf --notes %t | FileCheck %s --check-prefixes=GNU,GNU-OK,ASYNC,HEAP,NOSTACK
# RUN: llvm-readobj --notes %t | FileCheck %s --check-prefixes=LLVM,LLVM-OK,ASYNC,HEAP,NOSTACK

# RUN: yaml2obj -D DESC='06000000' %s -o %t
# RUN: llvm-readelf --notes %t | FileCheck %s --check-prefixes=GNU,GNU-OK,SYNC,HEAP,NOSTACK
# RUN: llvm-readobj --notes %t | FileCheck %s --check-prefixes=LLVM,LLVM-OK,SYNC,HEAP,NOSTACK

# RUN: yaml2obj -D DESC='09000000' %s -o %t
# RUN: llvm-readelf --notes %t | FileCheck %s --check-prefixes=GNU,GNU-OK,ASYNC,NOHEAP,STACK
# RUN: llvm-readobj --notes %t | FileCheck %s --check-prefixes=LLVM,LLVM-OK,ASYNC,NOHEAP,STACK

# RUN: yaml2obj -D DESC='0a000000' %s -o %t
# RUN: llvm-readelf --notes %t | FileCheck %s --check-prefixes=GNU,GNU-OK,SYNC,NOHEAP,STACK
# RUN: llvm-readobj --notes %t | FileCheck %s --check-prefixes=LLVM,LLVM-OK,SYNC,NOHEAP,STACK

# RUN: yaml2obj -D DESC='03000000' %s -o %t
# RUN: llvm-readelf --notes %t | FileCheck %s --check-prefixes=GNU,GNU-OK,UNKNOWN,NOHEAP,NOSTACK
# RUN: llvm-readobj --notes %t | FileCheck %s --check-prefixes=LLVM,LLVM-OK,UNKNOWN,NOHEAP,NOSTACK

# RUN: yaml2obj -D DESC='00000000' %s -o %t
# RUN: llvm-readelf --notes %t | FileCheck %s --check-prefixes=GNU,GNU-OK,NONE,NOHEAP,NOSTACK
# RUN: llvm-readobj --notes %t | FileCheck %s --check-prefixes=LLVM,LLVM-OK,NONE,NOHEAP,NOSTACK

# RUN: yaml2obj -D DESC='""' %s -o %t
# RUN: llvm-readelf --notes %t | FileCheck %s --check-prefixes=GNU,GNU-BAD,INVALID
# RUN: llvm-readobj --notes %t | FileCheck %s --check-prefixes=LLVM,LLVM-BAD,INVALID

# GNU:          Displaying notes found in: .note.android.memtag
# GNU-NEXT:     Owner    Data size	 Description
# GNU-OK-NEXT:  Android  0x00000004  NT_ANDROID_TYPE_MEMTAG (Android memory tagging information)
# GNU-BAD-NEXT: Android  0x00000000  NT_ANDROID_TYPE_MEMTAG (Android memory tagging information)

# LLVM:      Notes [
# LLVM-NEXT:   NoteSection {
# LLVM-NEXT:     Name: .note.android.memtag
# LLVM-NEXT:     Offset: 0x40
# LLVM-OK-NEXT:  Size: 0x18
# LLVM-BAD-NEXT: Size: 0x14
# LLVM-NEXT:     Note {
# LLVM-NEXT:       Owner: Android
# LLVM-OK-NEXT:    Data size: 0x4
# LLVM-BAD-NEXT:   Data size: 0x0
# LLVM-NEXT:       Type: NT_ANDROID_TYPE_MEMTAG (Android memory tagging information)

## Hint: Also used for the GNU tests.
# INVALID-NEXT:    Invalid .note.android.memtag
# NONE-NEXT:       Tagging Mode: NONE
# ASYNC-NEXT:      Tagging Mode: ASYNC
# SYNC-NEXT:       Tagging Mode: SYNC
# UNKNOWN-NEXT:    Tagging Mode: Unknown (3)
# HEAP-NEXT:       Heap: Enabled
# NOHEAP-NEXT:     Heap: Disabled
# STACK-NEXT:      Stack: Enabled
# NOSTACK-NEXT:    Stack: Disabled

# LLVM-NEXT:     }
# LLVM-NEXT:   }
# LLVM-NEXT: ]

--- !ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_DYN
Sections:
  - Name: .note.android.memtag
    Type: SHT_NOTE
    Notes:
      - Name: Android
        Type: NT_ANDROID_TYPE_MEMTAG
        Desc: [[DESC]]