Subject: [PATCH 09/11] dtc: add a testcase with labels

From: Milton Miller <[email-masked]>
Date: Sat, 7 Jul 2007 01:18:53 -0500 (CDT)

Create a source file with labels for use as a testcase 
to check parsing dts files.

Signed-off-by: Milton Miller <[email-masked]>
--- 
I started with the existing test01.dts and added labels and
a labeled subnode.

The labels could instead be added to that file if desired,
but that would mean the output of the compiler would not
match the input when writing dts from dts or dtb input.

I haven't studied how to use the new testsuite to check
the result.  Initially I was going to suggest diff on the
asm output, but with the libfdt library we could write a
test to change the property and reserve contents then
use the library to fetch and compare.

Index: dtc/tests/label01.dts
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ dtc/tests/label01.dts	2007-06-14 22:17:39.000000000 -0500
@@ -0,0 +1,60 @@
+/memreserve/ 1000000000000000 0000000002000000;
+memrsv2: /memreserve/ 2000000000000000-20ffffffffffffff;
+/memreserve/ 0-13;
+
+/ {
+	model = "MyBoardName";
+	compatible = "MyBoardName", "MyBoardFamilyName";
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	cpus {
+		linux,phandle = <1>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		PowerPC,970@0 {
+			name = "PowerPC,970";
+			device_type = "cpu";
+			reg = <0>;
+			clock-frequency = <5f5e1000>;
+			timebase-frequency = <1FCA055>;
+			linux,boot-cpu;
+			i-cache-size = <10000>;
+			d-cache-size = <8000>;
+		};
+
+		PowerPC,970@1 {
+			name = "PowerPC,970";
+			device_type = "cpu";
+			reg = <1>;
+			clock-frequency = <5f5e1000>;
+			timebase-frequency = <1FCA055>;
+			i-cache-size = <10000>;
+			d-cache-size = <8000>;
+		};
+
+	};
+
+	node: randomnode {
+		prop: string = data: "\xff\0stuffstuff\t\t\t\n\n\n" data_end: ;
+		blob = [byte: 0a 0b 0c 0d de ea ad be ef byte_end: ];
+		ref = < cell: &/memory@0 cell_end: >;
+		mixed = "abc", pre: [1234] post: , gap: < aligned: a b c>;
+		subnode: child {
+		};
+		/* subnode_end: is auto-generated by node emit */
+	};
+	/* node_end: is auto-generated by node emit */
+
+	memory@0 {
+		device_type = "memory";
+		memreg: reg = <00000000 00000000 00000000 20000000>;
+	};
+
+	chosen {
+		bootargs = "root=/dev/sda2";
+		linux,platform = <00000600>;
+	};
+
+};
+