Combine garlic and rosemary with gnocchi, cherry tomatoes, salt, and black pepper in the baking dish. Drizzle olive oil over the mixture.