Changeset f80e0218 for src/examples
- Timestamp:
- Jun 30, 2016, 4:32:56 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- ea29e73
- Parents:
- 1b5c81ed (diff), 84d4d6f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/examples
- Files:
-
- 4 added
- 8 deleted
- 6 edited
- 9 moved
Legend:
- Unmodified
- Added
- Removed
-
src/examples/Attributes.c
r1b5c81ed rf80e0218 6 6 // @max 7 7 // 8 // 2. a direct application to a manifest type8 // 2. a direct application to a manifest otype 9 9 // 10 10 // @max( int ) 11 11 // 12 // 3. constraining a type variable; the application is implicitly performed at the call site as in (2)12 // 3. constraining a otype variable; the application is implicitly performed at the call site as in (2) 13 13 // 14 // forall( type T | { T @max( T ); } ) T x( T t );14 // forall( otype T | { T @max( T ); } ) T x( T t ); 15 15 // 16 16 // … … 23 23 // x = (*attr_var); 24 24 // 25 // 2. an indirect application to a manifest type25 // 2. an indirect application to a manifest otype 26 26 // 27 27 // (*attr_var)( int ) 28 28 // 29 // 3. a direct application to a type variable29 // 3. a direct application to a otype variable 30 30 // 31 31 // @max( T ) … … 47 47 // 3. polymorphic 48 48 // 49 // forall( type T | constraint( T ) ) int @attr( T );49 // forall( otype T | constraint( T ) ) int @attr( T ); 50 50 51 51 int @max = 3; … … 53 53 int main() { 54 54 int x; 55 type @type(type t); // compiler intrinsic56 type @widest(type t);57 @ type(x) *y; // gcc:typeof(x) *y;58 const @widest(double) *w; // gcc: consttypeof(x) *w;59 * @type(3 + 4) z; // cfa declaration syntax55 otype @otype(otype t); // compiler intrinsic 56 otype @widest(otype t); 57 @otype(x) *y; // gcc: otypeof(x) *y; 58 // const @widest(double) *w; // gcc: const otypeof(x) *w; 59 // * @otype(3 + 4) z; // cfa declaration syntax 60 60 y = @max; 61 61 z = @max(x) + @size(int); -
src/examples/Initialization.c
r1b5c81ed rf80e0218 12 12 } a = { .w : [2] }; 13 13 14 struct { int a[3], b; } w [] = { [0].a : {1}, [0].b : 1, [1].a[0] : 2 };14 struct { int a[3], b; } w [] = { [0].a : {1}, [0].b : 3, [1].a[0] : 2 }; 15 15 16 16 struct { -
src/examples/Makefile.am
r1b5c81ed rf80e0218 6 6 ## file "LICENCE" distributed with Cforall. 7 7 ## 8 ## Makefile.am -- 8 ## Makefile.am -- 9 9 ## 10 10 ## Author : Peter A. Buhr … … 19 19 CC = @CFA_BINDIR@/cfa 20 20 21 noinst_PROGRAMS = fstream_test vector_test # build but do not install21 noinst_PROGRAMS = fstream_test vector_test avl_test # build but do not install 22 22 fstream_test_SOURCES = fstream_test.c 23 23 vector_test_SOURCES = vector_int.c array.c vector_test.c 24 avl_test_SOURCES = avltree/avl_test.c avltree/avl0.c avltree/avl1.c avltree/avl2.c avltree/avl3.c avltree/avl4.c avltree/avl-private.c -
src/examples/Makefile.example
r1b5c81ed rf80e0218 1 CFA ?= ../ cfa-cpp1 CFA ?= ../driver/cfa-cpp 2 2 CFAOPT ?= -a 3 3 OUTPUT ?= Output … … 32 32 33 33 ${OUTPUTDIR} : 34 mkdir $@34 mkdir -p $@ 35 35 36 36 # remove the expected results directories to generate new ones from the current output -
src/examples/Makefile.in
r1b5c81ed rf80e0218 36 36 PRE_UNINSTALL = : 37 37 POST_UNINSTALL = : 38 noinst_PROGRAMS = fstream_test$(EXEEXT) vector_test$(EXEEXT) 38 noinst_PROGRAMS = fstream_test$(EXEEXT) vector_test$(EXEEXT) \ 39 avl_test$(EXEEXT) 39 40 subdir = src/examples 40 41 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in … … 48 49 CONFIG_CLEAN_VPATH_FILES = 49 50 PROGRAMS = $(noinst_PROGRAMS) 51 am_avl_test_OBJECTS = avl_test.$(OBJEXT) avl0.$(OBJEXT) avl1.$(OBJEXT) \ 52 avl2.$(OBJEXT) avl3.$(OBJEXT) avl4.$(OBJEXT) \ 53 avl-private.$(OBJEXT) 54 avl_test_OBJECTS = $(am_avl_test_OBJECTS) 55 avl_test_LDADD = $(LDADD) 50 56 am_fstream_test_OBJECTS = fstream_test.$(OBJEXT) 51 57 fstream_test_OBJECTS = $(am_fstream_test_OBJECTS) … … 59 65 am__depfiles_maybe = depfiles 60 66 am__mv = mv -f 67 AM_V_lt = $(am__v_lt_@AM_V@) 68 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) 69 am__v_lt_0 = --silent 61 70 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 62 71 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 72 AM_V_CC = $(am__v_CC_@AM_V@) 73 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) 74 am__v_CC_0 = @echo " CC " $@; 75 AM_V_at = $(am__v_at_@AM_V@) 76 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) 77 am__v_at_0 = @ 63 78 CCLD = $(CC) 64 79 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ 65 SOURCES = $(fstream_test_SOURCES) $(vector_test_SOURCES) 66 DIST_SOURCES = $(fstream_test_SOURCES) $(vector_test_SOURCES) 80 AM_V_CCLD = $(am__v_CCLD_@AM_V@) 81 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) 82 am__v_CCLD_0 = @echo " CCLD " $@; 83 AM_V_GEN = $(am__v_GEN_@AM_V@) 84 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 85 am__v_GEN_0 = @echo " GEN " $@; 86 SOURCES = $(avl_test_SOURCES) $(fstream_test_SOURCES) \ 87 $(vector_test_SOURCES) 88 DIST_SOURCES = $(avl_test_SOURCES) $(fstream_test_SOURCES) \ 89 $(vector_test_SOURCES) 67 90 ETAGS = etags 68 91 CTAGS = ctags … … 71 94 ALLOCA = @ALLOCA@ 72 95 AMTAR = @AMTAR@ 96 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 73 97 AUTOCONF = @AUTOCONF@ 74 98 AUTOHEADER = @AUTOHEADER@ … … 78 102 CC = @CFA_BINDIR@/cfa 79 103 CCDEPMODE = @CCDEPMODE@ 104 CFA_BACKEND_CC = @CFA_BACKEND_CC@ 80 105 CFA_BINDIR = @CFA_BINDIR@ 81 106 CFA_INCDIR = @CFA_INCDIR@ … … 98 123 EGREP = @EGREP@ 99 124 EXEEXT = @EXEEXT@ 100 GCC_PATH = @GCC_PATH@101 125 GREP = @GREP@ 102 126 INSTALL = @INSTALL@ … … 176 200 fstream_test_SOURCES = fstream_test.c 177 201 vector_test_SOURCES = vector_int.c array.c vector_test.c 202 avl_test_SOURCES = avltree/avl_test.c avltree/avl0.c avltree/avl1.c avltree/avl2.c avltree/avl3.c avltree/avl4.c avltree/avl-private.c 178 203 all: all-am 179 204 … … 213 238 clean-noinstPROGRAMS: 214 239 -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) 240 avl_test$(EXEEXT): $(avl_test_OBJECTS) $(avl_test_DEPENDENCIES) $(EXTRA_avl_test_DEPENDENCIES) 241 @rm -f avl_test$(EXEEXT) 242 $(AM_V_CCLD)$(LINK) $(avl_test_OBJECTS) $(avl_test_LDADD) $(LIBS) 215 243 fstream_test$(EXEEXT): $(fstream_test_OBJECTS) $(fstream_test_DEPENDENCIES) $(EXTRA_fstream_test_DEPENDENCIES) 216 244 @rm -f fstream_test$(EXEEXT) 217 $( LINK) $(fstream_test_OBJECTS) $(fstream_test_LDADD) $(LIBS)245 $(AM_V_CCLD)$(LINK) $(fstream_test_OBJECTS) $(fstream_test_LDADD) $(LIBS) 218 246 vector_test$(EXEEXT): $(vector_test_OBJECTS) $(vector_test_DEPENDENCIES) $(EXTRA_vector_test_DEPENDENCIES) 219 247 @rm -f vector_test$(EXEEXT) 220 $( LINK) $(vector_test_OBJECTS) $(vector_test_LDADD) $(LIBS)248 $(AM_V_CCLD)$(LINK) $(vector_test_OBJECTS) $(vector_test_LDADD) $(LIBS) 221 249 222 250 mostlyclean-compile: … … 227 255 228 256 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@ 257 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avl-private.Po@am__quote@ 258 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avl0.Po@am__quote@ 259 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avl1.Po@am__quote@ 260 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avl2.Po@am__quote@ 261 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avl3.Po@am__quote@ 262 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avl4.Po@am__quote@ 263 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avl_test.Po@am__quote@ 229 264 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstream_test.Po@am__quote@ 230 265 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector_int.Po@am__quote@ … … 232 267 233 268 .c.o: 234 @am__fastdepCC_TRUE@ $( COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<235 @am__fastdepCC_TRUE@ $( am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po236 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@237 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 238 @am__fastdepCC_FALSE@ $( COMPILE) -c $<269 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 270 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 271 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 272 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 273 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< 239 274 240 275 .c.obj: 241 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` 242 @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 243 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 244 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 245 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 276 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` 277 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 278 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 279 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 280 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` 281 282 avl_test.o: avltree/avl_test.c 283 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl_test.o -MD -MP -MF $(DEPDIR)/avl_test.Tpo -c -o avl_test.o `test -f 'avltree/avl_test.c' || echo '$(srcdir)/'`avltree/avl_test.c 284 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl_test.Tpo $(DEPDIR)/avl_test.Po 285 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl_test.c' object='avl_test.o' libtool=no @AMDEPBACKSLASH@ 286 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 287 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl_test.o `test -f 'avltree/avl_test.c' || echo '$(srcdir)/'`avltree/avl_test.c 288 289 avl_test.obj: avltree/avl_test.c 290 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl_test.obj -MD -MP -MF $(DEPDIR)/avl_test.Tpo -c -o avl_test.obj `if test -f 'avltree/avl_test.c'; then $(CYGPATH_W) 'avltree/avl_test.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl_test.c'; fi` 291 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl_test.Tpo $(DEPDIR)/avl_test.Po 292 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl_test.c' object='avl_test.obj' libtool=no @AMDEPBACKSLASH@ 293 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 294 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl_test.obj `if test -f 'avltree/avl_test.c'; then $(CYGPATH_W) 'avltree/avl_test.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl_test.c'; fi` 295 296 avl0.o: avltree/avl0.c 297 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl0.o -MD -MP -MF $(DEPDIR)/avl0.Tpo -c -o avl0.o `test -f 'avltree/avl0.c' || echo '$(srcdir)/'`avltree/avl0.c 298 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl0.Tpo $(DEPDIR)/avl0.Po 299 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl0.c' object='avl0.o' libtool=no @AMDEPBACKSLASH@ 300 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 301 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl0.o `test -f 'avltree/avl0.c' || echo '$(srcdir)/'`avltree/avl0.c 302 303 avl0.obj: avltree/avl0.c 304 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl0.obj -MD -MP -MF $(DEPDIR)/avl0.Tpo -c -o avl0.obj `if test -f 'avltree/avl0.c'; then $(CYGPATH_W) 'avltree/avl0.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl0.c'; fi` 305 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl0.Tpo $(DEPDIR)/avl0.Po 306 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl0.c' object='avl0.obj' libtool=no @AMDEPBACKSLASH@ 307 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 308 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl0.obj `if test -f 'avltree/avl0.c'; then $(CYGPATH_W) 'avltree/avl0.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl0.c'; fi` 309 310 avl1.o: avltree/avl1.c 311 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl1.o -MD -MP -MF $(DEPDIR)/avl1.Tpo -c -o avl1.o `test -f 'avltree/avl1.c' || echo '$(srcdir)/'`avltree/avl1.c 312 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl1.Tpo $(DEPDIR)/avl1.Po 313 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl1.c' object='avl1.o' libtool=no @AMDEPBACKSLASH@ 314 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 315 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl1.o `test -f 'avltree/avl1.c' || echo '$(srcdir)/'`avltree/avl1.c 316 317 avl1.obj: avltree/avl1.c 318 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl1.obj -MD -MP -MF $(DEPDIR)/avl1.Tpo -c -o avl1.obj `if test -f 'avltree/avl1.c'; then $(CYGPATH_W) 'avltree/avl1.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl1.c'; fi` 319 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl1.Tpo $(DEPDIR)/avl1.Po 320 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl1.c' object='avl1.obj' libtool=no @AMDEPBACKSLASH@ 321 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 322 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl1.obj `if test -f 'avltree/avl1.c'; then $(CYGPATH_W) 'avltree/avl1.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl1.c'; fi` 323 324 avl2.o: avltree/avl2.c 325 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl2.o -MD -MP -MF $(DEPDIR)/avl2.Tpo -c -o avl2.o `test -f 'avltree/avl2.c' || echo '$(srcdir)/'`avltree/avl2.c 326 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl2.Tpo $(DEPDIR)/avl2.Po 327 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl2.c' object='avl2.o' libtool=no @AMDEPBACKSLASH@ 328 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 329 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl2.o `test -f 'avltree/avl2.c' || echo '$(srcdir)/'`avltree/avl2.c 330 331 avl2.obj: avltree/avl2.c 332 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl2.obj -MD -MP -MF $(DEPDIR)/avl2.Tpo -c -o avl2.obj `if test -f 'avltree/avl2.c'; then $(CYGPATH_W) 'avltree/avl2.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl2.c'; fi` 333 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl2.Tpo $(DEPDIR)/avl2.Po 334 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl2.c' object='avl2.obj' libtool=no @AMDEPBACKSLASH@ 335 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 336 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl2.obj `if test -f 'avltree/avl2.c'; then $(CYGPATH_W) 'avltree/avl2.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl2.c'; fi` 337 338 avl3.o: avltree/avl3.c 339 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl3.o -MD -MP -MF $(DEPDIR)/avl3.Tpo -c -o avl3.o `test -f 'avltree/avl3.c' || echo '$(srcdir)/'`avltree/avl3.c 340 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl3.Tpo $(DEPDIR)/avl3.Po 341 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl3.c' object='avl3.o' libtool=no @AMDEPBACKSLASH@ 342 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 343 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl3.o `test -f 'avltree/avl3.c' || echo '$(srcdir)/'`avltree/avl3.c 344 345 avl3.obj: avltree/avl3.c 346 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl3.obj -MD -MP -MF $(DEPDIR)/avl3.Tpo -c -o avl3.obj `if test -f 'avltree/avl3.c'; then $(CYGPATH_W) 'avltree/avl3.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl3.c'; fi` 347 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl3.Tpo $(DEPDIR)/avl3.Po 348 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl3.c' object='avl3.obj' libtool=no @AMDEPBACKSLASH@ 349 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 350 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl3.obj `if test -f 'avltree/avl3.c'; then $(CYGPATH_W) 'avltree/avl3.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl3.c'; fi` 351 352 avl4.o: avltree/avl4.c 353 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl4.o -MD -MP -MF $(DEPDIR)/avl4.Tpo -c -o avl4.o `test -f 'avltree/avl4.c' || echo '$(srcdir)/'`avltree/avl4.c 354 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl4.Tpo $(DEPDIR)/avl4.Po 355 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl4.c' object='avl4.o' libtool=no @AMDEPBACKSLASH@ 356 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 357 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl4.o `test -f 'avltree/avl4.c' || echo '$(srcdir)/'`avltree/avl4.c 358 359 avl4.obj: avltree/avl4.c 360 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl4.obj -MD -MP -MF $(DEPDIR)/avl4.Tpo -c -o avl4.obj `if test -f 'avltree/avl4.c'; then $(CYGPATH_W) 'avltree/avl4.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl4.c'; fi` 361 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl4.Tpo $(DEPDIR)/avl4.Po 362 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl4.c' object='avl4.obj' libtool=no @AMDEPBACKSLASH@ 363 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 364 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl4.obj `if test -f 'avltree/avl4.c'; then $(CYGPATH_W) 'avltree/avl4.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl4.c'; fi` 365 366 avl-private.o: avltree/avl-private.c 367 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl-private.o -MD -MP -MF $(DEPDIR)/avl-private.Tpo -c -o avl-private.o `test -f 'avltree/avl-private.c' || echo '$(srcdir)/'`avltree/avl-private.c 368 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl-private.Tpo $(DEPDIR)/avl-private.Po 369 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl-private.c' object='avl-private.o' libtool=no @AMDEPBACKSLASH@ 370 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 371 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl-private.o `test -f 'avltree/avl-private.c' || echo '$(srcdir)/'`avltree/avl-private.c 372 373 avl-private.obj: avltree/avl-private.c 374 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT avl-private.obj -MD -MP -MF $(DEPDIR)/avl-private.Tpo -c -o avl-private.obj `if test -f 'avltree/avl-private.c'; then $(CYGPATH_W) 'avltree/avl-private.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl-private.c'; fi` 375 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/avl-private.Tpo $(DEPDIR)/avl-private.Po 376 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avltree/avl-private.c' object='avl-private.obj' libtool=no @AMDEPBACKSLASH@ 377 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 378 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o avl-private.obj `if test -f 'avltree/avl-private.c'; then $(CYGPATH_W) 'avltree/avl-private.c'; else $(CYGPATH_W) '$(srcdir)/avltree/avl-private.c'; fi` 246 379 247 380 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) -
src/examples/Members.c
r1b5c81ed rf80e0218 3 3 float ?=?( float*, float ); 4 4 forall( dtype DT ) DT * ?=?( DT**, DT* ); 5 forall( type T) lvalue T *?( T* );5 forall(otype T) lvalue T *?( T* ); 6 6 char *__builtin_memcpy(); 7 7 -
src/examples/Misc.c
r1b5c81ed rf80e0218 1 // interesting corner cases 2 1 3 int a; 2 4 int b; -
src/examples/Rank2.c
r1b5c81ed rf80e0218 3 3 4 4 void a() { 5 forall( type T ) void f( T );6 void g( forall( type U ) void p( U ) );5 forall( otype T ) void f( T ); 6 void g( forall( otype U ) void p( U ) ); 7 7 g( f ); 8 8 } … … 10 10 void g() { 11 11 void h( int *null ); 12 forall( type T ) T id( T );12 forall( otype T ) T id( T ); 13 13 forall( dtype T ) T *0; 14 14 int 0; -
src/examples/abstype.c
r1b5c81ed rf80e0218 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed May 27 18:10:01 201513 // Update Count : 412 // Last Modified On : Tue Jun 14 14:27:48 2016 13 // Update Count : 9 14 14 // 15 15 16 type T | { T x( T ); };16 otype T | { T x( T ); }; 17 17 18 18 T y( T t ) { … … 21 21 } 22 22 23 forall( type T) lvalue T *?( T* );24 int ?++( int * );25 int ?=?( int *, int );26 forall( dtype DT) DT* ?=?( DT **, DT* );23 forall( otype T ) lvalue T *?( T * ); 24 int ?++( int * ); 25 int ?=?( int *, int ); 26 forall( dtype DT ) DT * ?=?( DT **, DT * ); 27 27 28 type U = int*;28 otype U = int *; 29 29 30 30 U x( U u ) { -
src/examples/alloc.c
r1b5c81ed rf80e0218 11 11 // Created On : Wed Feb 3 07:56:22 2016 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Wed Feb 17 11:43:23201614 // Update Count : 4013 // Last Modified On : Fri Mar 11 17:42:08 2016 14 // Update Count : 59 15 15 // 16 16 17 forall( otype T ) T * malloc( char fill ); 18 forall( dtype T ) T *?=?( T **, void * ); 19 void *malloc( unsigned long int ); 20 #if 0 17 21 #include <fstream> 18 22 #include <stdlib> … … 25 29 int * bar( int * p, int c ) { return p; } 26 30 int * baz( int * p, int c ) { return p; } 31 #endif 27 32 28 33 int main( void ) { 34 #if 0 29 35 size_t size = 10; 30 36 int * p; 31 37 struct S { int x; double y; } * s; 38 #endif 32 39 40 #if 0 33 41 p = malloc( sizeof(*p) ); // C malloc, type unsafe 34 42 printf( "here1\n" ); … … 37 45 printf( "here2\n" ); 38 46 free( p ); 39 p = malloc( (char)'\0' ); // CFA malloc, type safe 47 #endif 48 // int * p; 49 // p = malloc( (char)'\0' ); // CFA malloc, type safe 50 (int *)malloc( (char)'\0' ); // CFA malloc, type safe 51 (void *)malloc( (char)'\0' ); // CFA malloc, type safe 52 #if 0 40 53 printf( "here3\n" ); 41 54 p = malloc( p, 1000 ); // CFA remalloc, type safe … … 60 73 printf( "here9\n" ); 61 74 free( p ); 62 #if 0 75 63 76 float * fp = malloc() + 1; 64 77 fprintf( stderr, "%p %p\n", fp, fp - 1 ); -
src/examples/includes.c
r1b5c81ed rf80e0218 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 23:28:02 201613 // Update Count : 3 2812 // Last Modified On : Wed Apr 13 22:30:02 2016 13 // Update Count : 370 14 14 // 15 15 … … 24 24 #if 1 25 25 #define _GNU_SOURCE 26 #include <aio.h>27 #include <a.out.h>28 #include <aliases.h>29 #include <alloca.h>30 #include <ansidecl.h>31 #include <ar.h>32 #include <argp.h>26 //#include <aio.h> 27 //#include <a.out.h> 28 //#include <aliases.h> 29 //#include <alloca.h> 30 //#include <ansidecl.h> 31 //#include <ar.h> 32 //#include <argp.h> 33 33 #include <argz.h> 34 #include <assert.h>34 //#include <assert.h> 35 35 #include <bfd.h> 36 #if 0 36 37 #include <bfdlink.h> 37 38 #include <byteswap.h> … … 56 57 #include <err.h> 57 58 #include <errno.h> 58 #if 059 59 #include <error.h> 60 #endif61 60 #include <eti.h> 62 61 #include <evdns.h> 63 62 #include <event.h> 64 63 #include <evhttp.h> 64 #endif 65 65 #if 0 66 66 #include <evrpc.h> … … 129 129 130 130 //#define _GNU_SOURCE 131 #include <error.h> 131 #include <bfd.h> 132 //#include <error.h> 132 133 133 134 #endif // 0 -
src/examples/sum.c
r1b5c81ed rf80e0218 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // sum.c -- 7 // sum.c -- test resolvers ability to deal with many variables with the same name and to use the minimum number of casts 8 // necessary to disambiguate overloaded variable names. 8 9 // 9 10 // Author : Peter A. Buhr 10 11 // Created On : Wed May 27 17:56:53 2015 11 12 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 4 15:06:47201613 // Update Count : 19613 // Last Modified On : Thu May 26 09:25:42 2016 14 // Update Count : 201 14 15 // 15 16 … … 48 49 } // for 49 50 sout | "sum from" | low | "to" | High | "is" 50 | (int)sum( size, a ) | " " | ", check" | (int)s | endl;51 | (int)sum( size, a ) | ", check" | (int)s | endl; 51 52 52 53 int s = 0, a[size], v = low; … … 56 57 } // for 57 58 sout | "sum from" | low | "to" | High | "is" 58 | sum( size, (int *)a ) | " " | ", check" | (int)s | endl;59 | sum( size, (int *)a ) | ", check" | (int)s | endl; 59 60 60 61 float s = 0.0, a[size], v = low / 10.0; … … 64 65 } // for 65 66 sout | "sum from" | low / 10.0 | "to" | High / 10.0 | "is" 66 | sum( size, (float *)a ) | " " | ", check" | (float)s | endl;67 | sum( size, (float *)a ) | ", check" | (float)s | endl; 67 68 68 69 double s = 0, a[size], v = low / 10.0; … … 72 73 } // for 73 74 sout | "sum from" | low / 10.0 | "to" | High / 10.0 | "is" 74 | sum( size, (double *)a ) | " " | ", check" | (double)s | endl;75 | sum( size, (double *)a ) | ", check" | (double)s | endl; 75 76 76 77 struct S { int i, j; } 0 = { 0, 0 }, 1 = { 1, 1 }; 77 S ?+?( S t1, S t2 ) { S s = { t1.i + t2.i, t1.j + t2.j }; return s; }78 S ?+?( S t1, S t2 ) { return (S){ t1.i + t2.i, t1.j + t2.j }; } 78 79 S ?+=?( S *t1, S t2 ) { *t1 = *t1 + t2; return *t1; } 79 80 S ++?( S *t ) { *t += 1; return *t; } … … 87 88 } // for 88 89 sout | "sum from" | low | "to" | High | "is" 89 | sum( size, (S *)a ) | " " | ", check" | (S)s | endl;90 | sum( size, (S *)a ) | ", check" | (S)s | endl; 90 91 } // main 91 92
Note:
See TracChangeset
for help on using the changeset viewer.