[llvm] 40c2bdf - [llvm-locstats] Move the test from D110621 into test/llvm-locstats/ dir

Djordje Todorovic via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 27 08:44:16 PDT 2021


Author: Djordje Todorovic
Date: 2021-10-27T17:36:19+02:00
New Revision: 40c2bdf6d191fa475a968692f317e660d6425be6

URL: https://github.com/llvm/llvm-project/commit/40c2bdf6d191fa475a968692f317e660d6425be6
DIFF: https://github.com/llvm/llvm-project/commit/40c2bdf6d191fa475a968692f317e660d6425be6.diff

LOG: [llvm-locstats] Move the test from D110621 into test/llvm-locstats/ dir

Added: 
    llvm/test/tools/llvm-locstats/locstats-bytes-overflow.yaml

Modified: 
    llvm/test/tools/llvm-dwarfdump/X86/locstats-bytes-overflow.yaml

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-dwarfdump/X86/locstats-bytes-overflow.yaml b/llvm/test/tools/llvm-dwarfdump/X86/locstats-bytes-overflow.yaml
index c19d54cafcaca..a17b3e55bdc5e 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/locstats-bytes-overflow.yaml
+++ b/llvm/test/tools/llvm-dwarfdump/X86/locstats-bytes-overflow.yaml
@@ -1,6 +1,5 @@
 # RUN: yaml2obj %s -o %t.o
 # RUN: llvm-dwarfdump --statistics %t.o 2>&1 | FileCheck %s
-# RUN: %llvm-locstats %t.o 2>&1 | FileCheck %s --check-prefix=LOCSTATS
 # RUN: rm %t.o
 
 ## Check that we are covering the situation when a stat field overflows.
@@ -25,8 +24,6 @@
 ##             [0x0000000000000003, 0x0000000000000005): DW_OP_reg2 RCX)
 
 # CHECK: "sum_all_variables(#bytes in parent scope)": "overflowed"
-# LOCSTATS: warning: "sum_all_variables(#bytes in parent scope)" field overflowed.
-# LOCSTATS: PC ranges covered: tainted
 
 --- !ELF
 FileHeader:

diff  --git a/llvm/test/tools/llvm-locstats/locstats-bytes-overflow.yaml b/llvm/test/tools/llvm-locstats/locstats-bytes-overflow.yaml
new file mode 100644
index 0000000000000..692c9a114ac94
--- /dev/null
+++ b/llvm/test/tools/llvm-locstats/locstats-bytes-overflow.yaml
@@ -0,0 +1,93 @@
+# RUN: yaml2obj %s -o %t.o
+# RUN: %llvm-locstats %t.o 2>&1 | FileCheck %s
+# RUN: rm %t.o
+
+## Check that we are covering the situation when a stat field overflows.
+##
+## The yaml represents this DWARF:
+##
+## DW_TAG_compile_unit
+##   DW_AT_low_pc (0x0000000000000000)
+##   DW_AT_high_pc  (0x000000000000000b)
+##
+##   DW_TAG_subprogram
+##     DW_AT_low_pc (0x0000000000000000)
+##     DW_AT_high_pc  (0xffffffffffffffff)
+##       DW_TAG_variable
+##         DW_AT_location (0x00000023:
+##            [0x0000000000000003, 0x0000000000000005): DW_OP_reg2 RCX)
+##   DW_TAG_subprogram
+##     DW_AT_low_pc    (0x0000000000000000)
+##     DW_AT_high_pc   (0xffffffffffffffff)
+##     DW_TAG_variable
+##       DW_AT_location        (0x00000023:
+##             [0x0000000000000003, 0x0000000000000005): DW_OP_reg2 RCX)
+
+# CHECK: warning: "sum_all_variables(#bytes in parent scope)" field overflowed.
+# CHECK: PC ranges covered: tainted
+
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS[[BITS=64]]
+  Data:    ELFDATA2LSB
+  Type:    ET_EXEC
+  Machine: EM_X86_64
+Sections:
+  - Name:         .debug_loc
+    Type:         SHT_PROGBITS
+    AddressAlign: 0x01
+    Content:      '00000000000000000600000000000000010055000000000000000000000000000000000300000000000000050000000000000001005200000000000000000000000000000000'
+  - Name:         .debug_ranges
+    Type:         SHT_PROGBITS
+    AddressAlign: 0x01
+    Content:      '000000000000000003000000000000000500000000000000080000000000000000000000000000000000000000000000'
+DWARF:
+  debug_abbrev:
+    - Table:
+      - Code:     1
+        Tag:      DW_TAG_compile_unit
+        Children: DW_CHILDREN_yes
+        Attributes:
+          - Attribute: DW_AT_low_pc
+            Form:      DW_FORM_addr
+          - Attribute: DW_AT_high_pc
+            Form:      DW_FORM_data8
+      - Code:     2
+        Tag:      DW_TAG_subprogram
+        Children: DW_CHILDREN_yes
+        Attributes:
+          - Attribute: DW_AT_low_pc
+            Form:      DW_FORM_addr
+          - Attribute: DW_AT_high_pc
+            Form:      DW_FORM_data8
+      - Code:     3
+        Tag:      DW_TAG_variable
+        Children: DW_CHILDREN_no
+        Attributes:
+          - Attribute: DW_AT_location
+            Form:      DW_FORM_sec_offset
+  debug_info:
+    - Version:    4
+      AbbrOffset: 0x00
+      Entries:
+        - AbbrCode: 1 ## DW_TAG_compile_unit
+          Values:
+            - Value: 0x00 ## DW_AT_low_pc
+            - Value: 0x0b ## DW_AT_high_pc
+        - AbbrCode: 2 ## DW_TAG_subprogram
+          Values:
+            - Value: 0x00 ## DW_AT_low_pc
+            - Value: 0xFFFFFFFFFFFFFFFF ## DW_AT_high_pc
+        - AbbrCode: 3 ## DW_TAG_variable
+          Values:
+            - Value: 0x23 ## DW_AT_sec_offset
+        - AbbrCode: 0 ## NULL
+        - AbbrCode: 2 ## DW_TAG_subprogram
+          Values:
+            - Value: 0x00 ## DW_AT_low_pc
+            - Value: 0xFFFFFFFFFFFFFFFF ## DW_AT_high_pc
+        - AbbrCode: 3 ## DW_TAG_variable
+          Values:
+            - Value: 0x23 ## DW_AT_sec_offset
+        - AbbrCode: 0 ## NULL
+        - AbbrCode: 0 ## NULL


        


More information about the llvm-commits mailing list