brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · bf5e3ff Raw
42 lines · plain
1# Test various error cases2 3# Synthesize a header only cgdata.4# struct Header {5#   uint64_t Magic;6#   uint32_t Version;7#   uint32_t DataKind;8#   uint64_t OutlinedHashTreeOffset;9#   uint64_t StableFunctionMapOffset;10# }11RUN: touch %t_empty.cgdata12RUN: not llvm-cgdata --show %t_empty.cgdata 2>&1 | FileCheck %s --check-prefix=EMPTY13EMPTY: {{.}}cgdata: empty codegen data14 15# Not a magic.16RUN: printf '\377' > %t_malformed.cgdata17RUN: not llvm-cgdata --show %t_malformed.cgdata 2>&1 | FileCheck %s --check-prefix=MALFORMED18MALFORMED: {{.}}cgdata: malformed codegen data19 20# The minimum header size is 24.21RUN: printf '\377cgdata\201' > %t_corrupt.cgdata22RUN: not llvm-cgdata --show %t_corrupt.cgdata 2>&1 | FileCheck %s  --check-prefix=CORRUPT23CORRUPT: {{.}}cgdata: invalid codegen data (file header is corrupt)24 25# The current version 4 while the header says 5.26RUN: printf '\377cgdata\201' > %t_version.cgdata27RUN: printf '\005\000\000\000' >> %t_version.cgdata28RUN: printf '\000\000\000\000' >> %t_version.cgdata29RUN: printf '\040\000\000\000\000\000\000\000' >> %t_version.cgdata30RUN: printf '\040\000\000\000\000\000\000\000' >> %t_version.cgdata31RUN: not llvm-cgdata --show %t_version.cgdata 2>&1 | FileCheck %s  --check-prefix=BAD_VERSION32BAD_VERSION: {{.}}cgdata: unsupported codegen data version33 34# Header says an outlined hash tree, but the file ends after the header.35RUN: printf '\377cgdata\201' > %t_eof.cgdata36RUN: printf '\002\000\000\000' >> %t_eof.cgdata37RUN: printf '\001\000\000\000' >> %t_eof.cgdata38RUN: printf '\040\000\000\000\000\000\000\000' >> %t_eof.cgdata39RUN: printf '\040\000\000\000\000\000\000\000' >> %t_eof.cgdata40RUN: not llvm-cgdata --show %t_eof.cgdata 2>&1 | FileCheck %s  --check-prefix=EOF41EOF: {{.}}cgdata: end of File42