================ @@ -0,0 +1,82 @@ +! RUN: %flang_fc1 -emit-fir -o - %s | FileCheck --check-prefix=CHECK-UNINT %s +! RUN: %flang_fc1 -emit-fir -finit-logical=true -o - %s | FileCheck --check-prefix=CHECK-TRUE %s +! RUN: %flang_fc1 -emit-fir -finit-logical=false -o - %s | FileCheck --check-prefix=CHECK-FALSE %s + +subroutine logical_scalar +!CHECK-UNINT-NOT: {{.}} = fir.convert %true : (i1) -> !fir.logical<4> +!CHECK-UNINT-NOT: {{.*}} = fir.convert %false : (i1) -> !fir.logical<4> + +!CHECK-TRUE: {{.}} = fir.convert %true : (i1) -> !fir.logical<4> +!CHECK-TRUE-NOT: {{.*}} = fir.convert %false : (i1) -> !fir.logical<4> + +!CHECK-FALSE: {{.*}} = fir.convert %false : (i1) -> !fir.logical<4> +!CHECK-FALSE-NOT: {{.}} = fir.convert %true : (i1) -> !fir.logical<4> ---------------- kiranchandramohan wrote:
It is probably better to test that the variable is assigned the relevant value. https://github.com/llvm/llvm-project/pull/150939 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits