From 0ec4d84349a69b1c62a17d70e369abb91a35ce51 Mon Sep 17 00:00:00 2001 From: albertchen-sifive Date: Wed, 8 Aug 2018 15:17:13 -0700 Subject: Use LinkedHashSet in propagateAnnotations (#855) Fixes #780 --- src/test/scala/firrtlTests/AnnotationTests.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/test/scala/firrtlTests') diff --git a/src/test/scala/firrtlTests/AnnotationTests.scala b/src/test/scala/firrtlTests/AnnotationTests.scala index b2aeda77..10414786 100644 --- a/src/test/scala/firrtlTests/AnnotationTests.scala +++ b/src/test/scala/firrtlTests/AnnotationTests.scala @@ -625,4 +625,22 @@ class JsonAnnotationTests extends AnnotationTests with BackendCompilationUtiliti if msg.contains("JObject") => } } + + object DoNothingTransform extends Transform { + override def inputForm: CircuitForm = UnknownForm + override def outputForm: CircuitForm = UnknownForm + + protected def execute(state: CircuitState): CircuitState = state + } + + "annotation order" should "should be preserved" in { + val annos = Seq(anno("a"), anno("b"), anno("c"), anno("d"), anno("e")) + val input: String = + """circuit Top : + | module Top : + | input a : UInt<1> + | node b = c""".stripMargin + val cr = DoNothingTransform.runTransform(CircuitState(parse(input), ChirrtlForm, annos)) + cr.annotations.toSeq shouldEqual annos + } } -- cgit v1.2.3