summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/microblaze/others/sdata_var6.c
blob: 0c8fe431f5d0f8a1ee5675ececed358bc2b23dbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-options "-mxl-gp-opt -G 16" } */

struct test_s {
    int a;
    int b;
    int c;
    int d;
};

/* { dg-final { scan-assembler "\.sdata2" } } */
const struct test_s global1 = { 1, 2, 3, 4};
extern const struct test_s global2;

int testfunc ()
{
/* { dg-final { scan-assembler "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r2" } } */
    return global2.a + global1.a;
}