if [ "${grub_platform}" = "pc" ] -a [ -e @MEMTEST_DIR@/memtest ]; then
	# Legacy 16-bit memtest
	menuentry "Memory Diagnostic Tool (@MEMTEST_VERSION@)" --hotkey=m {
		linux16 @MEMTEST_DIR@/memtest
	}
elif [ "${grub_platform}" = "pc" ] -a [ -e @MEMTEST_DIR@/memtest.bin ]; then
	menuentry "Memory Diagnostic Tool (@MEMTEST_VERSION@)" --hotkey=m {
		linux @MEMTEST_DIR@/memtest.bin
	}
elif [ "${grub_platform}" = "efi" ] -a [ -e @MEMTEST_DIR@/memtest.efi ]; then
	menuentry "Memory Diagnostic Tool (@MEMTEST_VERSION@)" --hotkey=m {
		linux @MEMTEST_DIR@/memtest.efi
	}
fi
