aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/bugs164/pr266165/AlwaysWeave.java11
-rw-r--r--tests/bugs164/pr266165/AlwaysWeave2.java10
-rw-r--r--tests/bugs164/pr266165/NeverWeave.java11
-rw-r--r--tests/bugs164/pr266165/NeverWeave2.java9
-rw-r--r--tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java16
-rw-r--r--tests/src/org/aspectj/systemtest/ajc164/ajc164.xml20
6 files changed, 77 insertions, 0 deletions
diff --git a/tests/bugs164/pr266165/AlwaysWeave.java b/tests/bugs164/pr266165/AlwaysWeave.java
new file mode 100644
index 000000000..2e8ba650a
--- /dev/null
+++ b/tests/bugs164/pr266165/AlwaysWeave.java
@@ -0,0 +1,11 @@
+aspect A {
+
+ public static final boolean enabled = true;
+
+ before(): execution(* AlwaysWeave.*(..)) && if(enabled) {}
+
+}
+
+public class AlwaysWeave {
+ public void foo() {}
+}
diff --git a/tests/bugs164/pr266165/AlwaysWeave2.java b/tests/bugs164/pr266165/AlwaysWeave2.java
new file mode 100644
index 000000000..3c158f59f
--- /dev/null
+++ b/tests/bugs164/pr266165/AlwaysWeave2.java
@@ -0,0 +1,10 @@
+aspect A {
+
+
+ before(): execution(* AlwaysWeave2.*(..)) && if(true) {}
+
+}
+
+public class AlwaysWeave2 {
+ public void foo() {}
+}
diff --git a/tests/bugs164/pr266165/NeverWeave.java b/tests/bugs164/pr266165/NeverWeave.java
new file mode 100644
index 000000000..85f5bbcd6
--- /dev/null
+++ b/tests/bugs164/pr266165/NeverWeave.java
@@ -0,0 +1,11 @@
+aspect A {
+
+ public static final boolean enabled = false;
+
+ before(): execution(* NeverWeave.*(..)) && if(enabled) {}
+
+}
+
+public class NeverWeave {
+ public void foo() {}
+}
diff --git a/tests/bugs164/pr266165/NeverWeave2.java b/tests/bugs164/pr266165/NeverWeave2.java
new file mode 100644
index 000000000..4b77a1b29
--- /dev/null
+++ b/tests/bugs164/pr266165/NeverWeave2.java
@@ -0,0 +1,9 @@
+aspect A {
+
+ before(): execution(* NeverWeave2.*(..)) && if(false) {}
+
+}
+
+public class NeverWeave2 {
+ public void foo() {}
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java b/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java
index 6e6542370..674700f6d 100644
--- a/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java
@@ -32,6 +32,22 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+ public void testOptimizingIf_pr266165_1() {
+ runTest("optimizing if for constant reference - 1");
+ }
+
+ public void testOptimizingIf_pr266165_2() {
+ runTest("optimizing if for constant reference - 2");
+ }
+
+ public void testOptimizingIf_pr266165_3() {
+ runTest("optimizing if for constant reference - 3");
+ }
+
+ public void testOptimizingIf_pr266165_4() {
+ runTest("optimizing if for constant reference - 4");
+ }
+
// public void testAnnoInherited_pr265695() {
// runTest("anno inherited");
// }
diff --git a/tests/src/org/aspectj/systemtest/ajc164/ajc164.xml b/tests/src/org/aspectj/systemtest/ajc164/ajc164.xml
index c2a62e69f..29bb149d8 100644
--- a/tests/src/org/aspectj/systemtest/ajc164/ajc164.xml
+++ b/tests/src/org/aspectj/systemtest/ajc164/ajc164.xml
@@ -1,6 +1,26 @@
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
<suite>
+
+ <ajc-test dir="bugs164/pr266165" title="optimizing if for constant reference - 1">
+ <compile files="NeverWeave.java" options="-1.5 -Xlint:ignore -showWeaveInfo"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs164/pr266165" title="optimizing if for constant reference - 2">
+ <compile files="AlwaysWeave.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs164/pr266165" title="optimizing if for constant reference - 3">
+ <compile files="NeverWeave2.java" options="-1.5 -Xlint:ignore -showWeaveInfo"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs164/pr266165" title="optimizing if for constant reference - 4">
+ <compile files="AlwaysWeave2.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point"/>
+ </compile>
+ </ajc-test>
<ajc-test dir="bugs164/pr265695" title="anno inherited">
<compile files="Asp.aj" options="-showWeaveInfo -1.5">