Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update uses of Linker.Option.critical() in tests #18458

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public void test_printfFromDefaultLibWithMemAddr_LinkerOption_1() throws Throwab
public void test_validateTrivialOption_1() throws Throwable {
FunctionDescriptor fd = FunctionDescriptor.of(JAVA_INT, JAVA_INT);
MemorySegment functionSymbol = nativeLibLookup.find("validateTrivialOption").get();
MethodHandle mh = linker.downcallHandle(functionSymbol, fd, Linker.Option.critical());
MethodHandle mh = linker.downcallHandle(functionSymbol, fd, Linker.Option.critical(false));
int result = (int)mh.invokeExact(111);
Assert.assertEquals(result, 111);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public void test_printfFromDefaultLibWithMemAddr_LinkerOption_2() throws Throwab
public void test_validateTrivialOption_2() throws Throwable {
FunctionDescriptor fd = FunctionDescriptor.of(JAVA_INT, JAVA_INT);
MemorySegment functionSymbol = nativeLibLookup.find("validateTrivialOption").get();
MethodHandle mh = linker.downcallHandle(fd, Linker.Option.critical());
MethodHandle mh = linker.downcallHandle(fd, Linker.Option.critical(false));
int result = (int)mh.invokeExact(functionSymbol, 111);
Assert.assertEquals(result, 111);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public void test_InvalidLinkerOptions_isTrivial_1() throws Throwable {

try (Arena arena = Arena.ofConfined()) {
MemorySegment upcallFuncAddr = linker.upcallStub(UpcallMethodHandles.MH_add2IntStructs_returnStruct,
FunctionDescriptor.of(structLayout, structLayout, structLayout), arena, Linker.Option.critical());
FunctionDescriptor.of(structLayout, structLayout, structLayout), arena, Linker.Option.critical(false));
fail("Failed to throw out IllegalArgumentException in the case of the invalid linker option for upcall.");
}
}
Expand All @@ -305,7 +305,7 @@ public void test_InvalidLinkerOptions_isTrivial_1() throws Throwable {
public void test_InvalidLinkerOptions_isTrivial_2() throws Throwable {
FunctionDescriptor fd = FunctionDescriptor.of(JAVA_INT, JAVA_INT, ADDRESS);
MemorySegment functionSymbol = nativeLibLookup.find("captureTrivialOptionByUpcallMH").get();
MethodHandle mh = linker.downcallHandle(functionSymbol, fd, Linker.Option.critical());
MethodHandle mh = linker.downcallHandle(functionSymbol, fd, Linker.Option.critical(false));

try (Arena arena = Arena.ofConfined()) {
MemorySegment upcallFuncAddr = linker.upcallStub(UpcallMethodHandles.MH_captureTrivialOption,
Expand Down