diff options
author | cushon <cushon@google.com> | 2018-09-11 11:29:21 -0700 |
---|---|---|
committer | Liam Miller-Cushon <cushon@google.com> | 2018-09-11 16:14:30 -0700 |
commit | c7e09853f03720d95d6d413ce500aa9885a804be (patch) | |
tree | 87e53837a03ef22fe59911b79c6f19955f74a24b /javatests | |
parent | f9e413bbcae622b3d2c609a73ff626682d330ffc (diff) | |
download | turbine-c7e09853f03720d95d6d413ce500aa9885a804be.tar.gz |
Improve parsing of type-annotated c-style array declarations
MOE_MIGRATED_REVID=212488586
Diffstat (limited to 'javatests')
-rw-r--r-- | javatests/com/google/turbine/lower/LowerIntegrationTest.java | 1 | ||||
-rw-r--r-- | javatests/com/google/turbine/lower/testdata/type_anno_c_array.test | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/javatests/com/google/turbine/lower/LowerIntegrationTest.java b/javatests/com/google/turbine/lower/LowerIntegrationTest.java index 6496756..ba126c8 100644 --- a/javatests/com/google/turbine/lower/LowerIntegrationTest.java +++ b/javatests/com/google/turbine/lower/LowerIntegrationTest.java @@ -303,6 +303,7 @@ public class LowerIntegrationTest { // TODO(cushon): support for source level 9 in integration tests // "B74332665.test", "memberimport.test", + "type_anno_c_array.test", }; List<Object[]> tests = ImmutableList.copyOf(testCases).stream().map(x -> new Object[] {x}).collect(toList()); diff --git a/javatests/com/google/turbine/lower/testdata/type_anno_c_array.test b/javatests/com/google/turbine/lower/testdata/type_anno_c_array.test new file mode 100644 index 0000000..c8ac275 --- /dev/null +++ b/javatests/com/google/turbine/lower/testdata/type_anno_c_array.test @@ -0,0 +1,28 @@ +=== Test.java === +import java.lang.annotation.Target; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE_USE) +@interface A {} + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE_USE) +@interface B {} + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE_USE) +@interface C {} + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE_USE) +@interface D {} + +class Test { + static final int as @A [] = {}; + static final int bs @A [] @B [] = {}; + static final int @C [] cs @A [] @B [] = {}; + static final int @C [] @D [] ds @A [] @B [] = {}; +} |