gcc/testsuite/g++.dg/cpp0x/gen-attrs-3.C
raw| 1 | // Test that attributes work in a variety of situations. |
| 2 | // { dg-options "-O -ftrack-macro-expansion=0" } |
| 3 | // { dg-do run { target c++11 } } |
| 4 | |
| 5 | #define attrib [[gnu::mode (QI)]] |
| 6 | #define gnu_attrib __attribute((mode (QI))) |
| 7 | |
| 8 | attrib signed int a; |
| 9 | static unsigned int b attrib; |
| 10 | |
| 11 | int foo(attrib int o) |
| 12 | { |
| 13 | return (sizeof (a) != 1 |
| 14 | || sizeof (b) != 1 |
| 15 | || sizeof (o) != 1 |
| 16 | || sizeof ((gnu_attrib signed int) b) != 1); |
| 17 | } |
| 18 | |
| 19 | int main () |
| 20 | { |
| 21 | return foo (42); |
| 22 | } |