aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.rocm/precise-memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.rocm/precise-memory.cpp')
-rw-r--r--gdb/testsuite/gdb.rocm/precise-memory.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.rocm/precise-memory.cpp b/gdb/testsuite/gdb.rocm/precise-memory.cpp
index 769b58a..a42c0ba 100644
--- a/gdb/testsuite/gdb.rocm/precise-memory.cpp
+++ b/gdb/testsuite/gdb.rocm/precise-memory.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2021-2024 Free Software Foundation, Inc.
+/* Copyright 2021-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -31,7 +31,17 @@
__global__ void
kernel ()
{
- __builtin_amdgcn_s_sleep (1);
+
+ /* Simple kernel which loads from address 0 to trigger a pagefault.
+ When precise memory is not enabled, it is expected that the memory fault
+ is reported after the s_nop instruction. With precise-memory, the
+ exception should be reported on the s_nop. */
+ asm volatile ("s_mov_b64 [s10, s11], 0\n"
+ "s_load_dword s12, [s10, s11]\n"
+ "s_nop 0"
+ :
+ :
+ : "s10", "s11", "s12");
}
int