ADT
aaron-thesis
arm-eh
ast-experimental
cleanup-dtors
ctor
deferred_resn
demangler
enum
forall-pointer-decay
gc_noraii
jacob/cs343-translation
jenkins-sandbox
memory
new-ast
new-ast-unique-expr
new-env
no_list
persistent-indexer
pthread-emulation
qualifiedEnum
resolv-new
string
with_gc
Last change
on this file since 1ead581 was a0d9f94, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago |
add compiler flag to driver, update examples, fix unnamed bit fields
|
-
Property mode
set to
100644
|
File size:
353 bytes
|
Line | |
---|
1 | // "./cfa min.c"
|
---|
2 | // "./cfa -CFA min.c > min_out.c"
|
---|
3 | // "gcc32 -g min_out.c LibCfa/libcfa.a"
|
---|
4 |
|
---|
5 | extern "C" {
|
---|
6 | int printf( const char *, ... );
|
---|
7 | }
|
---|
8 |
|
---|
9 | forall( type T | { const T 0; int ?!=?(T, T); int ?<?(T, T); } )
|
---|
10 | T min( T t1, T t2 ) {
|
---|
11 | return t1 < t2 ? t1 : t2;
|
---|
12 | }
|
---|
13 |
|
---|
14 | int main() {
|
---|
15 | float f;
|
---|
16 | f = min( 4.0, 3.0 );
|
---|
17 | printf( "result is %f\n", f );
|
---|
18 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.