blob: a8fa6b63e0b2316fe47fc87a9a4948cfa130b47e [file] [log] [blame]
/* { dg-do run } */
/* { dg-options "-Os -fno-tree-switch-conversion -ffunction-sections -mno-relax -fdata-sections -Wl,--section-start=.foo=0x10000" } */
#ifdef __AVR_HAVE_ELPM__
/* Make sure jumptables work properly if placed above 64 KB and below 128 KB,
i.e. 3 byte flash address for loading jump table entry and 2 byte jump table
entry, with relaxation disabled, after removing the special section
placement hook. */
#define SECTION_NAME ".foo"
#else
/* No special jump table placement so that avrtest won't abort
for, e.g. ATmega64. */
#define SECTION_NAME ".text.foo"
#endif
#include "exit-abort.h"
#include "pr71151-common.h"
int main()
{
foo(5);
if (y != 37)
abort();
foo(0);
if (y != 67)
abort();
foo(7);
if (y != 98)
abort();
}