arduino mega 2560 not working properly

For testing i have serial 3 pins with each other rx is connected to tx.