`gfortran` defines `__pic__/__PIC__/__pie__/__PIE__` macros according to `-fpic/PIC/pie/PIE` options, so I think `flang` should do the same. Reference: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fpic