A integer-to-float cast of a constant is currently simplified away as if it is an integer-to-integer cast. That's bad. Create a testcase for it. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- validation/optim/fpcast-constant.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 validation/optim/fpcast-constant.c diff --git a/validation/optim/fpcast-constant.c b/validation/optim/fpcast-constant.c new file mode 100644 index 000000000..47feffe5f --- /dev/null +++ b/validation/optim/fpcast-constant.c @@ -0,0 +1,14 @@ +static double foo(double a, int p) +{ + return a * ((p & 0) + 2); +} + +/* + * check-name: fpcast-constant + * check-command: test-linearize $file + * check-known-to-fail + * + * check-output-ignore + * check-output-contains: fpcast\\. + * check-output-excludes: fmul\\..*\\$2 + */ -- 2.17.1 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html