[all-commits] [llvm/llvm-project] 14be3f: [debuginfo-tests] Add some optnone tests
Orlando Cazalet-Hyams via All-commits
all-commits at lists.llvm.org
Tue Mar 2 01:02:00 PST 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 14be3f0e8848ee5a2dc215404c0391de4dc9e252
https://github.com/llvm/llvm-project/commit/14be3f0e8848ee5a2dc215404c0391de4dc9e252
Author: OCHyams <orlando.hyams at sony.com>
Date: 2021-03-02 (Tue, 02 Mar 2021)
Changed paths:
A debuginfo-tests/dexter-tests/optnone-fastmath.cpp
A debuginfo-tests/dexter-tests/optnone-simple-functions.cpp
A debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp
A debuginfo-tests/dexter-tests/optnone-vectors-and-functions.cpp
Log Message:
-----------
[debuginfo-tests] Add some optnone tests
Add dexter tests using the optnone attribute in various scenarios. Our users
have found optnone useful when debugging optimised code. We have these tests
downstream (and one upstream already: D89873) and we would like to contribute
them if there is any interest.
The tests are fairly self explanatory. Testing optnone with:
* optnone-fastmath.cpp: floats and -ffast-math,
* optnone-simple-functions: simple functions and integer arithmetic,
* optnone-struct-and-methods: a struct with methods,
* optnone-vectors-and-functions: templates and integer vector arithmetic.
optnone-vectors-and-functions contains two FIXMEs. The first problem is that
lldb seems to struggle with evaluating expressions with the templates used
here (example below). Perhaps this is PR42920?
(lldb) p TypeTraits<int __attribute__((ext_vector_type(4)))>::NumElements
error: <user expression 0>:1:1: no template named 'TypeTraits'
TypeTraits<int __attribute__((ext_vector_type(4)))>::NumElements
^
The second is that while lldb cannot evaluate the following expression, gdb
can, but it reports that the variable has been optimzed away. It does this when
compiling at O0 too. llvm-dwarfdump shows that MysteryNumber does have a
location. I don't know whether the DIE is bad or if both debuggers just don't
support it.
TypeTraits<int __attribute__((ext_vector_type(4)))>::MysteryNumber
DW_TAG_variable
DW_AT_specification (0x0000006b "MysteryNumber")
DW_AT_location (DW_OP_addr 0x601028)
DW_AT_linkage_name ("_ZN10TypeTraitsIDv4_iE13MysteryNumberE")
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D97668
More information about the All-commits
mailing list