fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i;
  5.  
  6. for(i = 1; i < 100000; ++i) {
  7. int expected = (i & -i);
  8. int actual = (int)(1U << __builtin_ctz((unsigned)i));
  9. if(expected != actual) printf("Does not work for %d {%d != %d}\n", i, expected, actual);
  10. }
  11. printf("rest all are working\n");
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
rest all are working