xref: /llvm-project/llvm/test/tools/llvm-size/no-input.test (revision 42a21778f61cdc8462ce2cfb6ad7bc1992b2063c)
1a8eef4e5SJames Henderson## Show that llvm-size emits an error if passed in a non-existent file.
2a8eef4e5SJames Henderson
3*42a21778SAbhina Sreeskantharajan# RUN: not llvm-size %t.blah 2>&1 | FileCheck %s -DFILE=%t.blah -DMSG=%errc_ENOENT --check-prefix=ENOENT
4*42a21778SAbhina Sreeskantharajan# ENOENT: {{.*}}llvm-size{{.*}}: error: '[[FILE]]': [[MSG]]
5a8eef4e5SJames Henderson
6a8eef4e5SJames Henderson## Show that llvm-size reads a.out if not passed any file.
7a8eef4e5SJames Henderson
8a8eef4e5SJames Henderson# RUN: rm -rf %t && mkdir -p %t
9a8eef4e5SJames Henderson# RUN: cd %t
10a8eef4e5SJames Henderson# RUN: yaml2obj %s -o a.out
11a8eef4e5SJames Henderson# RUN: llvm-size 2>&1 | FileCheck %s -DFILE=a.out
12a8eef4e5SJames Henderson
13a8eef4e5SJames Henderson# CHECK:         text    data     bss     dec     hex filename
14a8eef4e5SJames Henderson# CHECK-NEXT:      42       0       0      42      2a a.out
15a8eef4e5SJames Henderson
16a8eef4e5SJames Henderson--- !ELF
17a8eef4e5SJames HendersonFileHeader:
18a8eef4e5SJames Henderson  Class:   ELFCLASS64
19a8eef4e5SJames Henderson  Data:    ELFDATA2LSB
20a8eef4e5SJames Henderson  Type:    ET_REL
21a8eef4e5SJames Henderson  Machine: EM_X86_64
22a8eef4e5SJames HendersonSections:
23a8eef4e5SJames Henderson  - Name:  .text
24a8eef4e5SJames Henderson    Type:  SHT_PROGBITS
25a8eef4e5SJames Henderson    Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
26a8eef4e5SJames Henderson    Size:  42
27