Skip to content

Commit

Permalink
Add lambda methods test in debuginfotest
Browse files Browse the repository at this point in the history
Catches JDK-8281266
  • Loading branch information
zakkak committed Jun 27, 2023
1 parent 9649b63 commit 5d78bdd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion substratevm/mx.substratevm/testhello.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,14 @@ def test():
checker = Checker("info func greet", rexp)
checker.check(exec_string)

# look up lambda method
exec_string = execute("info func Hello$$Lambda")
rexp = [r'All functions matching regular expression "Hello\$\$Lambda":',
r"File hello/Hello\.java:",
r"%sjava\.lang\.Object \*hello\.Hello\$\$Lambda\$%s[\./][^:]+::get\(hello\.Hello\$\$Lambda\$%s[\./]%s \*\);"%(maybe_spaces_pattern, digits_pattern, digits_pattern, wildcard_pattern)]
checker = Checker("info func Hello$$Lambda", rexp)
checker.check(exec_string)

# step into method call
execute("step")

Expand Down Expand Up @@ -453,7 +461,6 @@ def test():
# print details of Hello type
exec_string = execute("ptype 'hello.Hello'")
rexp = [r"type = class hello\.Hello : public java\.lang\.Object {",
# ptype lists inlined methods although they are not listed with info func
r"%sprivate:"%spaces_pattern,
r"%sstatic void inlineA\(void\);"%spaces_pattern,
r"%sstatic void inlineCallChain\(void\);"%spaces_pattern,
Expand All @@ -466,6 +473,7 @@ def test():
r"%sstatic void inlineReceiveConstants\(byte, int, long, java\.lang\.String \*, float, double\);"%spaces_pattern,
r"%sstatic void inlineTailRecursion\(int\);"%spaces_pattern,
r"%sstatic void inlineTo\(int\);"%spaces_pattern,
r"%sstatic java\.lang\.String \* lambda\$static\$%s\(void\);"%(spaces_pattern, digits_pattern),
r"%spublic:"%spaces_pattern,
r"%sstatic void main\(java\.lang\.String\[\] \*\);"%spaces_pattern,
r"%sprivate:"%spaces_pattern,
Expand Down
2 changes: 2 additions & 0 deletions substratevm/src/com.oracle.svm.test/src/hello/Hello.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,6 @@ private static void inlineReceiveConstants(byte b, int i, long l, String s, floa
System.out.println(String.format("q = %g\n", q));
System.out.println(String.format("t = %s\n", t));
}

final static java.util.function.Supplier<String> lambda = () -> "lambdaText";
}

0 comments on commit 5d78bdd

Please sign in to comment.