summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/NamingAnnotationTest.scala
diff options
context:
space:
mode:
authorRichard Lin2019-03-25 23:49:14 -0700
committerGitHub2019-03-25 23:49:14 -0700
commit50bbf973b4d631e14bd3cf40fa9dfe39a5c3d2e4 (patch)
treed08b04849dbbb31fdf8b9a80983ae0ee87265f25 /src/test/scala/chiselTests/NamingAnnotationTest.scala
parent1f8a5862c9b1642757af9f2dc0a34532c0a342a6 (diff)
Allow naming annotation to work outside builder context (#1051)
Diffstat (limited to 'src/test/scala/chiselTests/NamingAnnotationTest.scala')
-rw-r--r--src/test/scala/chiselTests/NamingAnnotationTest.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/NamingAnnotationTest.scala b/src/test/scala/chiselTests/NamingAnnotationTest.scala
index 9fdf0695..aae9123e 100644
--- a/src/test/scala/chiselTests/NamingAnnotationTest.scala
+++ b/src/test/scala/chiselTests/NamingAnnotationTest.scala
@@ -154,6 +154,11 @@ object NonNamedHelper {
val myVal = NamedFunction()
myVal
}
+
+ @chiselName
+ def NonBuilderFunction(): Int = { // scalastyle:ignore method.name
+ 1 + 1
+ }
}
@chiselName
@@ -215,4 +220,8 @@ class NamingAnnotationSpec extends ChiselPropSpec {
property("NonNamedFunction should elaborate") {
elaborate { new NonNamedFunction }
}
+
+ property("NonBuilderFunction should run outside a Builder context") {
+ NonNamedHelper.NonBuilderFunction() should be (2)
+ }
}