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.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.rocm/precise-memory.cpp b/gdb/testsuite/gdb.rocm/precise-memory.cpp
index 769b58a..7a8c37e 100644
--- a/gdb/testsuite/gdb.rocm/precise-memory.cpp
+++ b/gdb/testsuite/gdb.rocm/precise-memory.cpp
@@ -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