diff options
Diffstat (limited to 'libacc/tests')
| -rw-r--r-- | libacc/tests/data/float.c | 6 | ||||
| -rw-r--r-- | libacc/tests/data/flops.c | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/libacc/tests/data/float.c b/libacc/tests/data/float.c index b955238..df0de93 100644 --- a/libacc/tests/data/float.c +++ b/libacc/tests/data/float.c @@ -32,9 +32,13 @@ void testVars(float arg0, float arg1, double arg2, double arg3) { printf("args: %g %g %g %g\n", arg0, arg1, arg2, arg3); printf("locals: %g %g %g %g\n", local0, local1, local2, local3); + + printf("cast rval: %g %g\n", * (float*) & f1, * (double*) & d1); + * (float*) & f0 = 1.1f; * (double*) & d0 = 3.3; - printf("pointer tests: %g %g %g %g\n", f0, f1, d0, d1); + printf("cast lval: %g %g %g %g\n", f0, f1, d0, d1); + } int main() { diff --git a/libacc/tests/data/flops.c b/libacc/tests/data/flops.c index 347c665..dc36e93 100644 --- a/libacc/tests/data/flops.c +++ b/libacc/tests/data/flops.c @@ -106,10 +106,21 @@ void comparisonOps() { comparisonOpsdi(); } +int branch(double d) { + if (d) { + return 1; + } + return 0; +} + +void testBranching() { + printf("branching: %d %d %d\n", branch(-1.0), branch(0.0), branch(1.0)); +} int main() { unaryOps(); binaryOps(); comparisonOps(); + testBranching(); return 0; } |
