Extension properties in class: don't put receiver on stack for GETFIELD/PUTFIELD instruction
#KT-3031 Fixed
This commit is contained in:
+39
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2010-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.codegen.extension;
|
||||
|
||||
import org.jetbrains.jet.ConfigurationKind;
|
||||
import org.jetbrains.jet.codegen.CodegenTestCase;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public abstract class AbstractExtensionPropertiesTest extends CodegenTestCase {
|
||||
|
||||
private static final String REDUNDANT_PATH_PREFIX = "compiler/testData/codegen";
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_AND_ANNOTATIONS);
|
||||
}
|
||||
|
||||
protected void doTest(String path) throws IOException {
|
||||
String relativePath = path.substring(REDUNDANT_PATH_PREFIX.length());
|
||||
blackBoxFile(relativePath);
|
||||
}
|
||||
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright 2010-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.jet.codegen.extension;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import java.io.File;
|
||||
import org.jetbrains.jet.JetTestUtils;
|
||||
import org.jetbrains.jet.test.InnerTestClasses;
|
||||
import org.jetbrains.jet.test.TestMetadata;
|
||||
|
||||
import org.jetbrains.jet.codegen.extension.AbstractExtensionPropertiesTest;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */
|
||||
@TestMetadata("compiler/testData/codegen/extensionProperties")
|
||||
public class ExtensionPropertiesTestGenerated extends AbstractExtensionPropertiesTest {
|
||||
public void testAllFilesPresentInExtensionProperties() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/extensionProperties"), "kt", true);
|
||||
}
|
||||
|
||||
@TestMetadata("inClass.kt")
|
||||
public void testInClass() throws Exception {
|
||||
doTest("compiler/testData/codegen/extensionProperties/inClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inClassLongTypeInReceiver.kt")
|
||||
public void testInClassLongTypeInReceiver() throws Exception {
|
||||
doTest("compiler/testData/codegen/extensionProperties/inClassLongTypeInReceiver.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inClassWithEmptySetter.kt")
|
||||
public void testInClassWithEmptySetter() throws Exception {
|
||||
doTest("compiler/testData/codegen/extensionProperties/inClassWithEmptySetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inClassWithGetter.kt")
|
||||
public void testInClassWithGetter() throws Exception {
|
||||
doTest("compiler/testData/codegen/extensionProperties/inClassWithGetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inClassWithPrivateGetter.kt")
|
||||
public void testInClassWithPrivateGetter() throws Exception {
|
||||
doTest("compiler/testData/codegen/extensionProperties/inClassWithPrivateGetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inClassWithPrivateSetter.kt")
|
||||
public void testInClassWithPrivateSetter() throws Exception {
|
||||
doTest("compiler/testData/codegen/extensionProperties/inClassWithPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inClassWithSetter.kt")
|
||||
public void testInClassWithSetter() throws Exception {
|
||||
doTest("compiler/testData/codegen/extensionProperties/inClassWithSetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("topLevel.kt")
|
||||
public void testTopLevel() throws Exception {
|
||||
doTest("compiler/testData/codegen/extensionProperties/topLevel.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("topLevelLongTypeInReceiver.kt")
|
||||
public void testTopLevelLongTypeInReceiver() throws Exception {
|
||||
doTest("compiler/testData/codegen/extensionProperties/topLevelLongTypeInReceiver.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("topLevelSetterLongTypeInReceiver.kt")
|
||||
public void testTopLevelSetterLongTypeInReceiver() throws Exception {
|
||||
doTest("compiler/testData/codegen/extensionProperties/topLevelSetterLongTypeInReceiver.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("topLevelWithGetter.kt")
|
||||
public void testTopLevelWithGetter() throws Exception {
|
||||
doTest("compiler/testData/codegen/extensionProperties/topLevelWithGetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("topLevelWithSetter.kt")
|
||||
public void testTopLevelWithSetter() throws Exception {
|
||||
doTest("compiler/testData/codegen/extensionProperties/topLevelWithSetter.kt");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user