Remember- "suicide is a permanent solution to a temporary problem."
If your friend is talking about thoughts of suicide, you are not betraying them if you tell a responsible adult. Even if you promised not to tell, your friend needs your help, and you would rather have them temporarily angry at you than gone forever.