aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/debug/dwarf2/sso-3.c
blob: 004327c78ad82656bce8712ce0f2eb58b4b7e5f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* { dg-do compile } */
/* { dg-options "-gdwarf-3 -dA" } */

typedef int   int_t;
typedef short short_t;

#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define REVERSE_SSO __attribute__((scalar_storage_order("big-endian")));
#else
#define REVERSE_SSO __attribute__((scalar_storage_order("little-endian")));
#endif

struct reverse
{
  int_t i;
  short_t a[4];
} REVERSE_SSO;

struct native
{
  int_t i;
  short_t a[4];
};

struct reverse R;
struct native  N;

/* Verify that we have endianity on the common base type of 'i' and the
 *  element of 'a' in the first 2 structures.  */
/* { dg-final { scan-assembler-times " DW_AT_endianity" 2 } } */
/* { dg-final { scan-assembler-times "DIE \\(\[0-9a-z\]*\\) DW_TAG_base_type" 5 } } */