A BMD test (Bone Mineral Density test) is used to diagnose osteoporosis, which is a condition of weakened bones.