--- /dev/null
+#!/bin/sh -eu
+# A target must not be rebuilt when a dependency of a dependency of a dependency does not change.
+>all.do printf 'redo-ifchange a\n'
+>a.do printf 'redo-ifchange b\ndate +%s\n'
+>b.do printf 'redo-ifchange c\ndate +%s\n'
+>c.do printf 'redo-ifchange d\ndate +%s\n'
+>d printf '1'
+
+redo
+<a read -r timestamp_a1
+<b read -r timestamp_b1
+<c read -r timestamp_c1
+
+sleep 1
+>d printf '1'
+
+redo
+<a read -r timestamp_a2
+<b read -r timestamp_b2
+<c read -r timestamp_c2
+
+test ${timestamp_a2} -eq ${timestamp_a1}
+test ${timestamp_b2} -eq ${timestamp_b1}
+test ${timestamp_c2} -eq ${timestamp_c1}