Debian Codegraph @

gcc/testsuite/gcc.target/avr/torture/builtins-2-flash.c

raw
1 /* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */
2 /* { dg-do run { target { ! avr_tiny } } } */
3
4 #include <stdlib.h>
5
6 const __flash char c0 = 1;
7 #ifdef __FLASH1
8 const __flash1 char c1 = 1;
9 #endif
10
11 int main (void)
12 {
13 const __memx void *p;
14
15 p = &c0;
16 if (__builtin_avr_flash_segment (p) != 0)
17 abort();
18
19 #ifdef __FLASH1
20 p = &c1;
21 if (__builtin_avr_flash_segment (p) != 1)
22 abort();
23 #endif
24
25 if (__builtin_avr_flash_segment ("p") != -1)
26 abort();
27
28 exit (0);
29 return 0;
30 }