Re: [patch,testsuite,avr]: Support dg-require-effective-target avr_3byte_pc (and use it with PR71151 tests).

2016-06-22 Thread Jeff Law

On 06/22/2016 11:44 AM, Georg-Johann Lay wrote:

Jeff Law schrieb:

On 06/22/2016 08:21 AM, Georg-Johann Lay wrote:

Some tests for PR71151 assume that the target MCU has a 3-byte PC.  The
tests are failing because the simulator (avrtest) rejects to load the
respective executables if .text exceeds 128KiB, e.g. for -mmcu=atmega128
which has only flash of 128KiB and only a 2-byte PC.

Hence the tests have to be skipped if the target MCU has no 3-byte PC,
hence a new dg-require-effective-target proc supporting "avr_3byte_pc".

I added the new proc right after the last check_effective_target_arm_***
so that the test is in ASCII collating order.

Ok for trunk and v6?

Would it make more sense to have a generic test around the size of the
PC and or the size of pointers rather than something AVR specific?

Jeff


At least a test for pointer-size won't work for avr because pointers for
avr are 2-byte, yet there are AVR devices with 3-byte PC.
One of the H8 series might have had similar properties.  H8 stuff is 
getting rather fuzzy for me these days.


I vaguely recall code somewhere that detected when the resulting program 
wouldn't fit into the address space and gracefully exited with an error. 
 I think it was the linker that compiled and something in dejagnu knew 
to look for that error.  IT's probably worth digging around a bit to 
find that code and see if it can be re-used.


jeff




Re: [patch,testsuite,avr]: Support dg-require-effective-target avr_3byte_pc (and use it with PR71151 tests).

2016-06-22 Thread Georg-Johann Lay

Jeff Law schrieb:

On 06/22/2016 08:21 AM, Georg-Johann Lay wrote:

Some tests for PR71151 assume that the target MCU has a 3-byte PC.  The
tests are failing because the simulator (avrtest) rejects to load the
respective executables if .text exceeds 128KiB, e.g. for -mmcu=atmega128
which has only flash of 128KiB and only a 2-byte PC.

Hence the tests have to be skipped if the target MCU has no 3-byte PC,
hence a new dg-require-effective-target proc supporting "avr_3byte_pc".

I added the new proc right after the last check_effective_target_arm_***
so that the test is in ASCII collating order.

Ok for trunk and v6?
Would it make more sense to have a generic test around the size of the 
PC and or the size of pointers rather than something AVR specific?


Jeff


At least a test for pointer-size won't work for avr because pointers for 
avr are 2-byte, yet there are AVR devices with 3-byte PC.


Dunno if other targets need to distinguish between PC sizes like the avr 
target...  For the vast majority of targets stuff like ptr32plus et al. 
are likely to be the right kinds of filters, but that's not the case for 
avr -- ptr*plus won't do it.


Actually it's a test for whether avrtest simulator is run for 
-mmcu=avr51 cores or -mmcu=avr6 cores, so this is quite target specific. 
 It's just the case that 3-byte-pc is more descriptive for avr people 
and more related to gcc because that feature is tested in many places in 
the avr BE and even shipped to user land as a built-in macro.


If it helps other targets I could rename it to, say, pc17plus for 
"Program Counter is at least 17 bits wide".


Johann





Re: [patch,testsuite,avr]: Support dg-require-effective-target avr_3byte_pc (and use it with PR71151 tests).

2016-06-22 Thread Mike Stump
On Jun 22, 2016, at 10:06 AM, Mike Stump  wrote:
> Please see target-utils.exp and ensure that the tools generate a stylized 
> message and then add support for that to target-utils.exp.

Also, see return "::unsupported::memory full" in gcc-dg.exp, there is a copy 
there as well.

Re: [patch,testsuite,avr]: Support dg-require-effective-target avr_3byte_pc (and use it with PR71151 tests).

2016-06-22 Thread Mike Stump
On Jun 22, 2016, at 7:21 AM, Georg-Johann Lay  wrote:
> 
> Some tests for PR71151 assume that the target MCU has a 3-byte PC.  The tests 
> are failing because the simulator (avrtest) rejects to load the respective 
> executables if .text exceeds 128KiB, e.g. for -mmcu=atmega128 which has only 
> flash of 128KiB and only a 2-byte PC.
> 
> Hence the tests have to be skipped if the target MCU has no 3-byte PC, hence 
> a new dg-require-effective-target proc supporting "avr_3byte_pc".
> 
> I added the new proc right after the last check_effective_target_arm_*** so 
> that the test is in ASCII collating order.
> 
> Ok for trunk and v6?

No.  Please see target-utils.exp and ensure that the tools generate a stylized 
message and then add support for that to target-utils.exp.  If you are using 
binutils, the text should go into a memory segment that will fill when it is 
too large.  When it does, then binutils will generate one of the messages 
already handled, then you're done.

Re: [patch,testsuite,avr]: Support dg-require-effective-target avr_3byte_pc (and use it with PR71151 tests).

2016-06-22 Thread Jeff Law

On 06/22/2016 08:21 AM, Georg-Johann Lay wrote:

Some tests for PR71151 assume that the target MCU has a 3-byte PC.  The
tests are failing because the simulator (avrtest) rejects to load the
respective executables if .text exceeds 128KiB, e.g. for -mmcu=atmega128
which has only flash of 128KiB and only a 2-byte PC.

Hence the tests have to be skipped if the target MCU has no 3-byte PC,
hence a new dg-require-effective-target proc supporting "avr_3byte_pc".

I added the new proc right after the last check_effective_target_arm_***
so that the test is in ASCII collating order.

Ok for trunk and v6?
Would it make more sense to have a generic test around the size of the 
PC and or the size of pointers rather than something AVR specific?


Jeff