dtc/tests/over-determined.dts
Uwe Kleine-König 4d12fac793 tests: Check for duplication in __local_fixups__ and __fixups__
Typically the info contained in __local_fixups__ and __fixups__ is
autogenerated from phandles used in the tree. However before commit
915daadbb6 ("Start with empty __local_fixups__ and __fixups__ nodes")
compiling a dts that has both the __local_fixups__ and/or __fixups__ and
phandles that result in entries in these nodes, the fixups were
duplicated:

	$ cat test.dts
	/dts-v1/;
	/plugin/;

	/ {
		important: node {
			property = <&somenode>, "string";
			phandle = <0x01>;
			self = <&important>;
		};

		__fixups__ {
			somenode = "/node:property:0";
		};

		__local_fixups__ {
			node {
				self = <0x00>;
			};
		};

		__symbols__ {
			important = "/node";
		};
	};

	$ dtc -v
	Version: DTC 1.7.2

	$ dtc -O dts test2.dts
	/dts-v1/;

	/ {

		important: node {
			property = <&somenode>, "string";
			phandle = <0x01>;
			self = <&important>;
		};

		__fixups__ {
			somenode = "/node:property:0", "/node:property:0";
		};

		__local_fixups__ {

			node {
				self = <0x00>, <0x00>;
			};
		};

		__symbols__ {
			important = "/node";
		};
	};

Add a test that ensures this issue isn't reintroduced later.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
2025-07-02 11:56:06 +02:00

23 lines
246 B
Text

/dts-v1/;
/plugin/;
/ {
labelfornodea: nodea {
property = <&labelfornodea>;
};
nodeb {
property = <&nonexisting>;
};
__fixups__ {
nonexisting = "/nodeb:property:0";
};
__local_fixups__ {
nodea {
property = <0>;
};
};
};