Rebase.
[official-gcc.git] / gcc / testsuite / gcc.target / avr / progmem.h
blob17bb771537474acb713505e14e606a5ecf76668a
1 #define PROGMEM __attribute__((progmem))
3 #define PSTR(s) \
4 (__extension__({ \
5 static const char __c[] PROGMEM = (s); \
6 &__c[0];}))
8 #ifdef __AVR_HAVE_LPMX__
9 #define pgm_read_char(addr) \
10 (__extension__({ \
11 unsigned int __addr16 = (unsigned int)(addr); \
12 char __result; \
13 __asm__ ("lpm %0, %a1" \
14 : "=r" (__result) : "z" (__addr16)); \
15 __result; }))
16 #else
17 #define pgm_read_char(addr) \
18 (__extension__({ \
19 unsigned int __addr16 = (unsigned int)(addr); \
20 char __result; \
21 __asm__ ("lpm" "\n\t" \
22 "mov %0, r0" \
23 : "=r" (__result) : "z" (__addr16)); \
24 __result; }))
25 #endif