kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

builtin_29_return_address.c (319B)


      1 /* __builtin_return_address(0): the current function's return address, read
      2  * from the spilled frame record. A real frame's return address is never null. */
      3 __attribute__((noinline)) static void* ra0(void) {
      4   return __builtin_return_address(0);
      5 }
      6 
      7 int test_main(void) {
      8   void* r = ra0();
      9   return r != 0 ? 42 : 1;
     10 }