kit

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

a.c (353B)


      1 /* SHT_FINI_ARRAY: destructor sets g_dtor_ran; test_post_fini checks it.
      2  * test_main returns 0 immediately; the harness calls dtors then test_post_fini.
      3  */
      4 static int g_dtor_ran = 0;
      5 
      6 static void __attribute__((destructor)) fini(void) { g_dtor_ran = 1; }
      7 
      8 int test_main(void) { return 0; }
      9 int test_post_fini(void) { return g_dtor_ran == 1 ? 0 : 1; }