diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/debug/dwarf2')
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/align-1.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/align-2.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/align-3.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/align-4.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/align-5.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/align-6.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/align-as-1.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2.exp | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/enum-loc1.c | 19 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/nested_fun.c | 65 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/pr71855.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/pr80263.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c | 2 |
14 files changed, 148 insertions, 5 deletions
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/align-1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/align-1.c new file mode 100644 index 0000000000..a00404260a --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/align-1.c @@ -0,0 +1,6 @@ +// { dg-do compile } +// { dg-options "-O -g -dA -gno-strict-dwarf" } +// { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } +// { dg-final { scan-assembler-times " DW_AT_alignment" 1 { xfail { powerpc-ibm-aix* } } } } + +int __attribute__((__aligned__(64))) i; diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/align-2.c b/gcc/testsuite/gcc.dg/debug/dwarf2/align-2.c new file mode 100644 index 0000000000..439a7da0de --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/align-2.c @@ -0,0 +1,7 @@ +// { dg-do compile } +// { dg-options "-O -g -dA -gno-strict-dwarf" } +// { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } +// { dg-final { scan-assembler-times " DW_AT_alignment" 1 { xfail { powerpc-ibm-aix* } } } } + +typedef int __attribute__((__aligned__(64))) i_t; +i_t i; diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/align-3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/align-3.c new file mode 100644 index 0000000000..01c19cdd36 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/align-3.c @@ -0,0 +1,8 @@ +// { dg-do compile } +// { dg-options "-O -g -dA -gno-strict-dwarf" } +// { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } +// { dg-final { scan-assembler-times " DW_AT_alignment" 1 { xfail { powerpc-ibm-aix* } } } } + +typedef int int_t; +typedef int_t __attribute__((__aligned__(64))) i_t; +i_t i; diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/align-4.c b/gcc/testsuite/gcc.dg/debug/dwarf2/align-4.c new file mode 100644 index 0000000000..84182749d7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/align-4.c @@ -0,0 +1,8 @@ +// { dg-do compile } +// { dg-options "-O -g -dA -gno-strict-dwarf" } +// { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } +// { dg-final { scan-assembler-times " DW_AT_alignment" 2 { xfail { powerpc-ibm-aix* } } } } + +struct tt { + int __attribute__((__aligned__(64))) i; +} t; diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/align-5.c b/gcc/testsuite/gcc.dg/debug/dwarf2/align-5.c new file mode 100644 index 0000000000..322ac50cb5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/align-5.c @@ -0,0 +1,8 @@ +// { dg-do compile } +// { dg-options "-O -g -dA -gno-strict-dwarf" } +// { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } +// { dg-final { scan-assembler-times " DW_AT_alignment" 1 { xfail { powerpc-ibm-aix* } } } } + +struct tt { + int i; +} __attribute__((__aligned__(64))) t; diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/align-6.c b/gcc/testsuite/gcc.dg/debug/dwarf2/align-6.c new file mode 100644 index 0000000000..784f213ca1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/align-6.c @@ -0,0 +1,10 @@ +// { dg-do compile } +// { dg-options "-O -g -dA -gno-strict-dwarf" } +// { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } +// { dg-final { scan-assembler-times " DW_AT_alignment" 1 { xfail { powerpc-ibm-aix* } } } } + +struct tt { + int i; +}; + +struct tt __attribute__((__aligned__(64))) t; diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/align-as-1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/align-as-1.c new file mode 100644 index 0000000000..5ef02c378c --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/align-as-1.c @@ -0,0 +1,6 @@ +// { dg-do compile } +// { dg-options "-O -g -dA -gno-strict-dwarf" } +// { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } +// { dg-final { scan-assembler-times " DW_AT_alignment" 1 { xfail { powerpc-ibm-aix* } } } } + +int _Alignas(64) i; diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c b/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c index e7d199d1c4..e5dc55b833 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c @@ -1,6 +1,5 @@ -/* { dg-do compile { target i386*-*-* } } */ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ /* { dg-options "-O -gdwarf -dA -msse" } */ -/* { dg-require-effective-target sse } */ /* { dg-final { scan-assembler "DW_AT_const_value" } } */ typedef float FloatVect __attribute__((__vector_size__(16))); diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2.exp b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2.exp index 12846b95b4..33871f716f 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2.exp +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2.exp @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2016 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/enum-loc1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/enum-loc1.c new file mode 100644 index 0000000000..7394313036 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/enum-loc1.c @@ -0,0 +1,19 @@ +/* PR c/79969 */ +/* { dg-do compile } */ +/* { dg-options "-gdwarf -dA -fno-merge-debug-strings" } */ + +enum ENUMTAG; + +enum ENUMTAG +{ + B = 1, + C = 2 +}; + +void +bar (void) +{ + enum ENUMTAG a = C; +} + +/* { dg-final { scan-assembler "DW_TAG_enumeration_type\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"ENUMTAG\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?7\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/nested_fun.c b/gcc/testsuite/gcc.dg/debug/dwarf2/nested_fun.c new file mode 100644 index 0000000000..c783ac0c11 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/nested_fun.c @@ -0,0 +1,65 @@ +/* As part of inlining, a BLOCK (described as DW_TAG_lexical_block DIE's) may + be present both as an abstract instance and a concrete one in the DWARF + output. This testcase attempts to make sure that the concrete ones refer to + the abstract ones thanks to the DW_AT_abstract_origin attribute. + + Such a back-link enables debuggers to make entities present in the abstract + instance only available in concrete ones. */ + +/* { dg-options "-O2 -g -std=gnu99 -gdwarf -dA" } */ +/* { dg-final { scan-assembler-times "\\(DIE \\(0x.*\\) DW_TAG_lexical_block\\)\[^)\]*DW_AT_abstract_origin" 1 } } */ + +extern void *create (const char *); +extern void destroy (void *); +extern void do_nothing (char); + +struct string +{ + const char *data; + int lb; + int ub; +}; + +int +main (void) +{ + void *o1 = create ("foo"); + + void + parent (void) + { + { + void *o2 = create ("bar"); + + int + child (struct string s) + { + int i = s.lb; + + if (s.lb <= s.ub) + while (1) + { + char c = s.data[i - s.lb]; + do_nothing (c); + if (c == 'o') + return 1; + if (i == s.ub) + break; + ++i; + } + return 0; + } + + int r; + + r = child ((struct string) {"baz", 1, 3}); + r = child ((struct string) {"qux", 2, 4}); + r = child ((struct string) {"foobar", 1, 6}); + } + + do_nothing (0); + } + + parent (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr71855.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr71855.c index 4fd8b74f32..3842dbc027 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/pr71855.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr71855.c @@ -8,4 +8,4 @@ foo (const char *format, ...) { } -// { dg-final { scan-assembler-times "DIE.*DW_TAG_unspecified_parameters" 1 } } +// { dg-final { scan-assembler-times "DIE.*DW_TAG_unspecified_parameters" 1 { xfail { powerpc-ibm-aix* } } } } diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr80263.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr80263.c new file mode 100644 index 0000000000..57633b4f0e --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr80263.c @@ -0,0 +1,7 @@ +/* PR debug/80263 */ +/* { dg-do compile } */ +/* { dg-options "-g -dA" } */ + +char array[1]; + +/* { dg-final { scan-assembler-not {\msizetype} } } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c b/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c index e6bc1371f2..6577eff354 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c @@ -4,7 +4,7 @@ as well. */ /* { dg-do compile } */ /* { dg-options "-O2 -gdwarf -dA -fdebug-prefix-map=a=b" } */ -/* { dg-final { scan-assembler "DW_AT_producer: \"GNU C" { target { { { ! *-*-solaris2* } || gas } && { ! hppa*64*-*-* } } } } } */ +/* { dg-final { scan-assembler "DW_AT_producer: \"GNU C" { target { { { ! *-*-solaris2* } || gas } && { { ! hppa*64*-*-* } && { ! powerpc-ibm-aix* } } } } } } */ /* { dg-final { scan-assembler "\"GNU C\[^\\n\\r\]+ DW_AT_producer" { target { { *-*-solaris2* && { ! gas } } || { hppa*64*-*-* } } } } } */ /* { dg-final { scan-assembler-not "debug-prefix-map" } } */ |