Cannot get a digital square wave on oscilloscope from the GPIO of the Raspberry Pi?
There are a couple of issues with your code that can be easily fixed.  First, you are calling wiringPiSetup which means you will need to refer to the pins by their WiringPi designation which can be found on this page:

https://projects.drogon.net/raspberry-pi/wiringpi/pins/

You are then setting pin 7 (wiringPi designation) to be an output which is actually GPIO 4 (physical pin 7) and not the CE1 pin as you mentioned.  CE1 would actually be wiringPi pin 11.

The next problem is in the while loop.  You are doing a digitalWrite on wiringPi pin 4 (not 7 as you configured) and are always setting it low so it would never toggle high even if configured correctly.  The following code should be what you are looking for but is not tested. This assumes you want to use CE1 which is normally used for SPI but should work with WiringPi as an general I/O pin:

  if (wiringPiSetup () == -1)
    exit (1) ;

  pinMode(11, OUTPUT);

  while(1) {
    digitalWrite(11, 0);
    digitalWrite(11, 1);
  }