Obligatory madd is based on the sukun created only at a pause.

Alif, Waw and Ya: Types of Madd and Special Hamzah Rules