A C test suite (was: Opinions on Rowley CrossWorks for ARM)

C

CBFalconer

David said:
I tried a quick google for "Plum Hall IAR", and looked at the
first link:

http://www.plumhall.com/cqs/tr/trackrecord.html

It would appear that IAR is a customer of Plum Hall, as is Red Hat.
That by no means implies that gcc is certified by Plum Hall, but it
does look like they take test suite testing seriously.

Another interesting find from google:

http://gcc.gnu.org/ml/gcc/1998-07/msg00656.html

The problem with the gcc test suite is that it is geared to the gcc
'standard', rather than the ISO standard. A test suite should be
open-source, and there should probably be several of them (with
some commonality), one each for C90, C99, and C0X. The tests
should be clearly tied to the standard. There are several classes
of tests needed, i.e. conformance, detection of errors, and
quality. The last will be controversial.

The unfortunate experience with the Pascal test-suite is a
warning. This was excellent, but handed over to some British firm
(I forget the name) and basically lost. It included portable means
of selecting individual tests, and of running an overall check.
Thus GPL licencing is essential.

The results should be very useful, even when systems fail. For
example, where a compiler is aimed at a PIC many things are simply
not feasible. Running the suite would point out those constructs
to the user, who can then avoid using them. Maybe a sourceforge
project would be appropriate? Such a suite would obviously be poor
at the start, but should mature. The first task would be a method
of organizing the tests. The Pascal suite is an excellent
example. There should be no pressure to include C++ in the
testing, that is an entirely separate issue (and language).

Xposted from comp.arch.embedded to comp.lang.c and comp.std.c
 
P

Paul Keinanen

Some PICs only have three levels of stack.

The only problem I can think of is saving the (code space) return
address into the data address space RAM.

Usually even Harvard architecture have some means of transferring data
between code and data space, if these PICs do not have such feature,
implementing C would be problematic. As long as an indirect jump can
be performed, the situation is not hopeless.

Paul
 
C

CBFalconer

Paul said:
The only problem I can think of is saving the (code space) return
address into the data address space RAM.

Usually even Harvard architecture have some means of transferring
data between code and data space, if these PICs do not have such
feature, implementing C would be problematic. As long as an
indirect jump can be performed, the situation is not hopeless.

Not a PIC. The only access to the return stack is the return
instruction. As I set, not feasible. And there is not enough
memory to allow creating an interpreter.
 
W

Walter Banks

CBFalconer said:
The only access to the return stack is the return
instruction. As I set, not feasible. And there is not enough
memory to allow creating an interpreter.

You mean something like the parallax basic stamp.
 
W

Walter Banks

Leon said:
Some PICs only have three levels of stack.

At least one C compiler built a soft stack on those parts. We chose to
seem that as a part limit with aggressive function chaining.
 
W

Walter Banks

Paul said:
The only problem I can think of is saving the (code space) return
address into the data address space RAM.

Close it can be done but it requires some application planning.
Usually even Harvard architecture have some means of transferring data
between code and data space, if these PICs do not have such feature,
implementing C would be problematic.

Data can be transferred from ROM to data space and in some parts
the ROM can be written from the application parts

w..
 
W

Walter Banks

Leon said:
Some PICs only have three levels of stack.

At least one C compiler built a soft stack on those parts. We chose to
see that as a part limit and partly compensated with aggressive function
chaining.
 
W

Walter Banks

Paul said:
The only problem I can think of is saving the (code space) return
address into the data address space RAM.

Close it can be done but it requires some application planning.
Usually even Harvard architecture have some means of transferring data
between code and data space, if these PICs do not have such feature,
implementing C would be problematic.

Data can be transferred from ROM to data space and in some parts
the ROM can be written from the application parts

w..
 
R

Robert Adsett

I am curious, what for example?

I seem to recall some of the minimum translation requirements would be
an issue. Isn't there a minimum maximal length string restriction?

Robert
 
R

Robert Adsett

The problem with the gcc test suite is that it is geared to the gcc
'standard', rather than the ISO standard. A test suite should be
open-source, and there should probably be several of them (with
some commonality), one each for C90, C99, and C0X. The tests
should be clearly tied to the standard. There are several classes
of tests needed, i.e. conformance, detection of errors, and
quality. The last will be controversial.

The unfortunate experience with the Pascal test-suite is a
warning. This was excellent, but handed over to some British firm
(I forget the name) and basically lost. It included portable means
of selecting individual tests, and of running an overall check.
Thus GPL licencing is essential.

I rather like the idea. Does this mean you are volunteering to start
it? :)

Robert
 
C

CBFalconer

Robert said:
I rather like the idea. Does this mean you are volunteering to start
it? :)

If I were 20 years younger and in good health, I would. As it is I
can only offer advice. Been a lot a places, and seen a lot of
mistakes. The health can, I hope, be fixed.
 
R

Robert Adsett

If I were 20 years younger and in good health, I would. As it is I
can only offer advice. Been a lot a places, and seen a lot of
mistakes. The health can, I hope, be fixed.

Here's hoping. Been through, a thankfully light, dose of that myself.

Robert
 
J

Joe Wright

CBFalconer said:
If I were 20 years younger and in good health, I would. As it is I
can only offer advice. Been a lot a places, and seen a lot of
mistakes. The health can, I hope, be fixed.
We don't get younger so you can forget that one. :) I do hope you
regain your good health. Hang in there. Older is usually better, when
you consider the alternative.
 
R

Richard Heathfield

Robert Adsett said:
I seem to recall some of the minimum translation requirements would be
an issue. Isn't there a minimum maximal length string restriction?

In C90, the implementation must support a minimum of 509 characters in a
logical source line and in a character string literal. 509 is also the
minimum value for the maximum number of characters produced by any single
fprintf conversion.
 
W

Walter Banks

Robert said:
I seem to recall some of the minimum translation requirements would be
an issue. Isn't there a minimum maximal length string restriction?

Good point combined with Richard's comment on fprintf. It is possible
to implement around this limit on processors like the PIC but I do not
know of anyone (including us) who have done so..

w..
 
K

kyle york

Greetings,
Not a PIC. The only access to the return stack is the return
instruction. As I set, not feasible. And there is not enough
memory to allow creating an interpreter.

Indirect calls and/or jumps are trivial on the 16 (& I think 12 & 14)
series so I don't see the problem. It's also fairly trivial to ignore
the call/return stack by passing the return address as a hidden
parametert to a function.

About the only problem I see is with only a single indirect register
allowing recursion is difficult.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top