Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- validation/var-undef-partial.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 validation/var-undef-partial.c diff --git a/validation/var-undef-partial.c b/validation/var-undef-partial.c new file mode 100644 index 000000000..2b6658342 --- /dev/null +++ b/validation/var-undef-partial.c @@ -0,0 +1,21 @@ +int foo(int a, int b) +{ + int var = 0; + int r; + + if (a) + var = 1; + if (b) + r = var; + + return r; // undef if !b +} + +/* + * check-name: variable partially undefined + * check-description: trigger a bug in symbol/memop simplification + * check-description: sparse-llvm is used here as semantic checker of sparse's IR + * check-command: sparse-llvm -Wno-decl $file + * check-known-to-fail + * check-output-ignore + */ -- 2.14.0 -- 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