summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-size/response-file.test
diff options
context:
space:
mode:
authorJames Henderson <jh7370@my.bristol.ac.uk>2019-08-14 10:17:34 +0000
committerJames Henderson <jh7370@my.bristol.ac.uk>2019-08-14 10:17:34 +0000
commita8eef4e5f50009f9b4387c8e617f34493549a781 (patch)
tree72b4712e6e995f5c32489833e8d2acc5056b5f06 /llvm/test/tools/llvm-size/response-file.test
parent32f1e1a01d9ad8d00345eb005e362eedf47bb1fb (diff)
downloadbcm5719-llvm-a8eef4e5f50009f9b4387c8e617f34493549a781.tar.gz
bcm5719-llvm-a8eef4e5f50009f9b4387c8e617f34493549a781.zip
[llvm-size][test] Improve llvm-size testing
This patch significantly improves the llvm-size testing. The changes made are: 1) Change all tests to use yaml2obj instead of assembly or pre-canned inputs. 2) Move the tests out of the X86 directory, since they don't need to be there after 1). 3) Increased test coverage. 4) Added comments to explain purpose of tests. I haven't attempted to add test coverage for all Mach-O related code, as I am not familiar enough with that file format to be able to. Reviewers: grimar, MaskRay Differential Revision: https://reviews.llvm.org/D66134 llvm-svn: 368821
Diffstat (limited to 'llvm/test/tools/llvm-size/response-file.test')
-rw-r--r--llvm/test/tools/llvm-size/response-file.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-size/response-file.test b/llvm/test/tools/llvm-size/response-file.test
new file mode 100644
index 00000000000..694901eb0f0
--- /dev/null
+++ b/llvm/test/tools/llvm-size/response-file.test
@@ -0,0 +1,21 @@
+## Show that llvm-size can consume a response file.
+
+# RUN: echo "-t %t" > %t.rsp
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-size -x @%t.rsp | FileCheck %s -DFILE=%t
+
+# CHECK: text data bss dec hex filename
+# CHECK-NEXT: 0x10 0 0 16 10 [[FILE]]
+# CHECK-NEXT: 0x10 0 0 16 10 (TOTALS)
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+ Machine: EM_X86_64
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Size: 0x10
+ Flags: [SHF_ALLOC, SHF_EXECINSTR]
OpenPOWER on IntegriCloud