llvm-project/debuginfo-tests/dexter-tests
OCHyams 14be3f0e88 [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
2021-03-02 08:46:39 +00:00
..
memvars [DebugInfo][dexter] Tweak dexter test for merged values 2021-01-19 12:45:31 +00:00
aggregate-indirect-arg.cpp Unmask dexter debuginfo tests on Darwin 2019-11-01 13:12:47 +00:00
asan-deque.cpp Unmask dexter debuginfo tests on Darwin 2019-11-01 13:12:47 +00:00
asan.c Unmask dexter debuginfo tests on Darwin 2019-11-01 13:12:47 +00:00
ctor.cpp Unmask dexter debuginfo tests on Darwin 2019-11-01 13:12:47 +00:00
dbg-arg.c Unmask dexter debuginfo tests on Darwin 2019-11-01 13:12:47 +00:00
deferred_globals.cpp [debuginfo-tests][dexter] add requires lldb to two tests 2020-10-28 17:33:29 +00:00
global-constant.cpp Reapply "Import Dexter to debuginfo-tests"" 2019-10-31 16:51:53 +00:00
hello.c Reapply "Import Dexter to debuginfo-tests"" 2019-10-31 16:51:53 +00:00
inline-line-gap.cpp Reapply "Import Dexter to debuginfo-tests"" 2019-10-31 16:51:53 +00:00
lit.local.cfg [dexter] Force dexter tests to use the host triple 2021-02-24 11:11:17 +00:00
namespace.cpp [debuginfo-tests][dexter] add requires lldb to two tests 2020-10-28 17:33:29 +00:00
nrvo-string.cpp [DebugInfo] Prevent inlining in NRVO-string test cases 2021-02-11 10:33:30 +01:00
nrvo.cpp Reapply "Import Dexter to debuginfo-tests"" 2019-10-31 16:51:53 +00:00
optnone-fastmath.cpp [debuginfo-tests] Add some optnone tests 2021-03-02 08:46:39 +00:00
optnone-loops.cpp [debuginfo-tests] Skip optnone-loops.cpp on Darwin 2020-11-06 13:05:33 -08:00
optnone-simple-functions.cpp [debuginfo-tests] Add some optnone tests 2021-03-02 08:46:39 +00:00
optnone-struct-and-methods.cpp [debuginfo-tests] Add some optnone tests 2021-03-02 08:46:39 +00:00
optnone-vectors-and-functions.cpp [debuginfo-tests] Add some optnone tests 2021-03-02 08:46:39 +00:00
realigned-frame.cpp Reapply "Import Dexter to debuginfo-tests"" 2019-10-31 16:51:53 +00:00
stack-var.c Unmask dexter debuginfo tests on Darwin 2019-11-01 13:12:47 +00:00
vla.c Unmask dexter debuginfo tests on Darwin 2019-11-01 13:12:47 +00:00