summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/attr-retain-8.c
blob: c1a9b52972e8f6c4d3727609ec83a5ddd15e4888 (plain)
1
2
3
4
5
6
7
8
9
10
/* { dg-do compile { target R_flag_in_section } } */
/* { dg-skip-if "non-ELF target" { *-*-darwin* powerpc*-*-aix* } } */
/* { dg-options "-Wall -O2" } */

int __attribute__((section(".data.foo"))) foo1 = 1;
/* { dg-warning "'.*' without 'retain' attribute and '.*' with 'retain' attribute are placed in a section with the same name" "" { target R_flag_in_section } .-1 } */
int __attribute__((used,retain,section(".data.foo"))) foo2 = 2;

/* { dg-final { scan-assembler ".data.foo,\"aw\"" { target R_flag_in_section } } } */
/* { dg-final { scan-assembler ".data.foo,\"awR\"" { target R_flag_in_section } } } */