Debian Codegraph @

gcc/testsuite/g++.dg/ext/attrib3.C

raw
1 // Test that attributes work in a variety of situations.
2 // { dg-options -O }
3 // { dg-do run }
4
5 #define attrib __attribute ((mode (QI)))
6
7 attrib signed int a; // attributes before type are broken
8 static attrib unsigned int b;
9
10 int foo(attrib int o) // attribute arguments are broken
11 {
12 return (sizeof (a) != 1
13 || sizeof (b) != 1
14 || sizeof (o) != 1
15 || sizeof ((attrib signed int) b) != 1);
16 }
17
18 int main ()
19 {
20 return foo (42);
21 }