- Timestamp:
- Mar 8, 2017, 3:22:50 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, stuck-waitfor-destruct, with_gc
- Children:
- 031a2c95, 0e7ea335
- Parents:
- 87c3bef (diff), 6363ad1 (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/tests
- Files:
-
- 4 edited
-
.expect/tupleAssign.txt (modified) (1 diff)
-
Makefile.am (modified) (1 diff)
-
Makefile.in (modified) (2 diffs)
-
tupleAssign.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.expect/tupleAssign.txt
r87c3bef rbe8bd88 1 u=5 v=6 x=10 y=11 z=[100, 200] 1 2 u=5 v=6 x=10 y=11 z=[100, 200] 2 3 u=11 v=10 x=11 y=10 z=[11, 10] 4 u=11 v=10 x=11 y=10 z=[11, 10] 5 u=10 v=11 z=[10, 11] 3 6 u=10 v=11 z=[10, 11] 4 7 u=123 v=456 z=[111, 222] 5 d=-2153.12 i=-2153 c=-105 t=[-2153, -2153.12, -2153] 6 d=-2153.12 i=-2153 c=-105 t=[-2153, -2153.12, -2153] 8 u=123 v=456 z=[111, 222] 9 d=94.12 i=94 c=^ t=[94, 94.12, 94] 10 d=94.12 i=94 c=^ t=[94, 94.12, 94] 11 d=-94.12 i=-94 c=¢ t=[-94, -94.12, -94] 12 d=-94.12 i=-94 c=¢ t=[-94, -94.12, -94] -
src/tests/Makefile.am
r87c3bef rbe8bd88 30 30 EXTRA_FLAGS = 31 31 CFLAGS = -g -Wall -Wno-unused-function @CFA_FLAGS@ ${EXTRA_FLAGS} 32 CC = @CFA_BINDIR@/ cfa32 CC = @CFA_BINDIR@/@CFA_NAME@ 33 33 34 34 .PHONY : list -
src/tests/Makefile.in
r87c3bef rbe8bd88 113 113 AWK = @AWK@ 114 114 BACKEND_CC = @BACKEND_CC@ 115 CC = @CFA_BINDIR@/ cfa115 CC = @CFA_BINDIR@/@CFA_NAME@ 116 116 CCAS = @CCAS@ 117 117 CCASDEPMODE = @CCASDEPMODE@ … … 123 123 CFA_INCDIR = @CFA_INCDIR@ 124 124 CFA_LIBDIR = @CFA_LIBDIR@ 125 CFA_NAME = @CFA_NAME@ 125 126 CFA_PREFIX = @CFA_PREFIX@ 126 127 CFLAGS = -g -Wall -Wno-unused-function @CFA_FLAGS@ ${EXTRA_FLAGS} -
src/tests/tupleAssign.c
r87c3bef rbe8bd88 9 9 // Author : Rob Schluntz 10 10 // Created On : Tue Nov 15 17:24:32 2016 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Tue Nov 15 17:27:28 201613 // Update Count : 3 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 6 21:23:58 2017 13 // Update Count : 34 14 14 // 15 16 #include <fstream> 15 17 16 18 int main() { … … 21 23 22 24 // swap x, y and store the new [x, y] in [u, v] and in z; 23 printf("u=%d v=%d x=%d y=%d z=[%d, %d]\n", u, v, x, y, z); 25 printf( "u=%d v=%d x=%d y=%d z=[%d, %d]\n", u, v, x, y, z ); 26 sout | "u=" | u | "v=" | v | "x=" | x | "y=" | y | "z=[" | z | "]" | endl; 24 27 z = [u, v] = [x, y] = [y, x]; 25 printf("u=%d v=%d x=%d y=%d z=[%d, %d]\n", u, v, x, y, z); 28 printf( "u=%d v=%d x=%d y=%d z=[%d, %d]\n", u, v, x, y, z ); 29 sout | "u=" | u | "v=" | v | "x=" | x | "y=" | y | "z=[" | z | "]" | endl; 26 30 27 31 // shuffle elements -- v = z.0, z.0 = z.1, z.1 = u, u = v 28 32 [v, z, u] = [z, u, v]; 29 printf("u=%d v=%d z=[%d, %d]\n", u, v, z); 33 printf( "u=%d v=%d z=[%d, %d]\n", u, v, z ); 34 sout | "u=" | u | "v=" | v | "z=[" | z | "]" | endl; 30 35 31 36 // multiple assignment with tuple expression on right 32 37 z = [111, 222]; 33 38 [u, v] = [123, 456]; 34 printf("u=%d v=%d z=[%d, %d]\n", u, v, z); 39 printf( "u=%d v=%d z=[%d, %d]\n", u, v, z ); 40 sout | "u=" | u | "v=" | v | "z=[" | z | "]" | endl; 35 41 } 36 37 42 { 38 43 // test mass assignment … … 48 53 // no conversion from X to integral types, so this serves as a santiy 49 54 // check that as long as this compiles, ?=?(_, x) is not generated. 50 [t, x, d, i, c, x] = (double)-2153.12; 51 printf("d=%lg i=%d c=%d t=[%d, %lg, %d]\n", d, i, (int)c, t); 52 [x, c, i, d, x, t] = (double)-2153.12; 53 printf("d=%lg i=%d c=%d t=[%d, %lg, %d]\n", d, i, (int)c, t); 55 [t, x, d, i, c, x] = (double)94.12; 56 printf( "d=%lg i=%d c=%c t=[%d, %lg, %d]\n", d, i, (int)c, t ); 57 sout | "d=" | d | "i=" | i | "c=" | c | ' ' | "t=[" | t | "]" | endl; 58 [x, c, i, d, x, t] = (double)-94.12; 59 printf( "d=%lg i=%d c=%c t=[%d, %lg, %d]\n", d, i, c, t ); 60 sout | "d=" | d | "i=" | i | "c=" | c | ' ' | "t=[" | t | "]" | endl; 54 61 } 55 62 }
Note:
See TracChangeset
for help on using the changeset viewer.