[llvm-branch-commits] [flang] [Flang] Move integration Lit tests to the right directory, NFC (PR #215536)

Sergio Afonso via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Aug 11 05:20:46 PDT 2026


https://github.com/skatrak created https://github.com/llvm/llvm-project/pull/215536

Flang unit tests that involve multiple stages of the compiler are intended to be placed in flang/test/Integration. However, many existing unit tests meeting this condition are currently located in the Lower subdirectory.

This patch moves all tests in Lower that emit LLVM IR from Fortran or run the FIR MLIR lowering pipeline via `tco` to Integration, and adds the corresponding notice at the top of each file.

Assisted-by: Claude Opus 4.8.

>From 1a51bb26075152cdab78c9c444391d85ac533fd8 Mon Sep 17 00:00:00 2001
From: Sergio Afonso <Sergio.AfonsoFumero at amd.com>
Date: Tue, 11 Aug 2026 13:03:15 +0100
Subject: [PATCH] [Flang] Move integration Lit tests to the right directory,
 NFC

Flang unit tests that involve multiple stages of the compiler are
intended to be placed in flang/test/Integration. However, many existing
unit tests meeting this condition are currently located in the Lower
subdirectory.

This patch moves all tests in Lower that emit LLVM IR from Fortran or
run the FIR MLIR lowering pipeline via `tco` to Integration, and adds the
corresponding notice at the top of each file.

Assisted-by: Claude Opus 4.8.
---
 .../Arm/arm-sve-vector-bits-vscale-range.f90  |  8 +++++++
 .../HLFIR/common-block-bindc-conflicts.f90    |  8 +++++++
 .../elemental-user-procedure-stacksave.f90    |  8 +++++++
 .../HLFIR/unroll-loops.fir                    |  8 +++++++
 .../HLFIR/where-implied-do-mask.f90           |  8 +++++++
 .../{Lower => Integration}/Intrinsics/fma.f90 |  8 +++++++
 .../MIF/coarray_allocation4.f90               |  9 +++++++-
 .../MIF/coarray_allocation5.f90               |  8 +++++++
 .../MIF/coarray_dealloc_not_alloc.f90         | 21 +++++++++++++++++++
 .../OpenMP/atomic-read-complex.f90            |  8 +++++++
 .../OpenMP/atomic-write-complex.f90           |  8 +++++++
 ...are-target-deferred-marking-reductions.f90 |  8 +++++++
 .../declare-target-deferred-marking.f90       |  8 +++++++
 ...arget-implicit-func-and-subr-cap-enter.f90 |  8 +++++++
 ...lare-target-implicit-func-and-subr-cap.f90 |  8 +++++++
 .../declare-target-implicit-tarop-cap.f90     |  8 +++++++
 .../declare-target-named-main-interface.f90   |  8 +++++++
 ...privatization-allocatable-firstprivate.f90 |  8 +++++++
 ...rivatization-lower-allocatable-to-llvm.f90 |  8 +++++++
 .../OpenMP/math-amdgpu.f90                    |  8 +++++++
 .../OpenMP/math-nvptx.f90                     |  8 +++++++
 .../test/Integration/OpenMP/missing-inode.f90 | 16 ++++++++++++++
 .../OpenMP/parallel-reduction-mixed.f90       |  8 +++++++
 .../OpenMP/target-data-if-false.f90           |  8 +++++++
 .../OpenMP/target-data-skip-mapper-calls.f90  |  8 +++++++
 .../PowerPC/ppc-intrinsics.f90                |  8 +++++++
 .../ppc-mma-accumulator-move-clear.f90        |  8 +++++++
 .../PowerPC/ppc-mma-assemble-disassemble.f90  |  8 +++++++
 .../PowerPC/ppc-mma-outer-product-1.f90       |  8 +++++++
 .../PowerPC/ppc-mma-outer-product-2.f90       |  8 +++++++
 .../PowerPC/ppc-pwr10-vec-intrinsics.f90      |  8 +++++++
 .../PowerPC/ppc-vec-abs.f90                   |  8 +++++++
 .../PowerPC/ppc-vec-add-and-mul-sub-xor.f90   |  9 +++++++-
 .../PowerPC/ppc-vec-any.f90                   |  9 +++++++-
 .../PowerPC/ppc-vec-cmp.f90                   |  9 +++++++-
 .../PowerPC/ppc-vec-convert.f90               |  9 +++++++-
 .../PowerPC/ppc-vec-cvf-elem-order.f90        |  8 +++++++
 .../PowerPC/ppc-vec-extract-elem-order.f90    |  8 +++++++
 .../PowerPC/ppc-vec-extract.f90               |  8 +++++++
 .../PowerPC/ppc-vec-insert-elem-order.f90     |  8 +++++++
 .../PowerPC/ppc-vec-insert.f90                |  8 +++++++
 .../PowerPC/ppc-vec-load-elem-order.f90       |  8 +++++++
 .../PowerPC/ppc-vec-load.f90                  |  8 +++++++
 .../PowerPC/ppc-vec-max-min-madd-nmsub.f90    |  8 +++++++
 .../PowerPC/ppc-vec-merge-elem-order.f90      |  8 +++++++
 .../PowerPC/ppc-vec-merge.f90                 |  8 +++++++
 .../PowerPC/ppc-vec-perm-elem-order.f90       |  8 +++++++
 .../PowerPC/ppc-vec-perm.f90                  |  8 +++++++
 .../PowerPC/ppc-vec-sel.f90                   |  8 +++++++
 .../PowerPC/ppc-vec-shift-be-le.f90           |  8 +++++++
 .../PowerPC/ppc-vec-shift.f90                 |  8 +++++++
 .../PowerPC/ppc-vec-splat-elem-order.f90      |  8 +++++++
 .../PowerPC/ppc-vec-splat.f90                 |  8 +++++++
 .../PowerPC/ppc-vec-store-elem-order.f90      |  8 +++++++
 .../PowerPC/ppc-vec-store.f90                 |  8 +++++++
 .../PowerPC/ppc-vector-types.f90              |  8 +++++++
 .../RISCV/riscv-target-abi.f90                |  8 +++++++
 .../RISCV/riscv-vector-bits-vscale-range.f90  |  8 +++++++
 .../allocatable-polymorphic.f90               |  8 +++++++
 .../array-wide-char.f90                       |  8 +++++++
 .../{Lower => Integration}/common-block.f90   |  8 +++++++
 flang/test/Integration/complex-part.f90       | 19 +++++++++++++++++
 flang/test/Integration/const-arg-glob.f90     | 21 +++++++++++++++++++
 .../dense-array-any-rank.f90                  |  8 +++++++
 .../derived-types-bindc.f90                   |  8 +++++++
 .../forall/character-1.f90                    |  8 +++++++
 .../intrinsic-procedure-wrappers.f90          | 18 ++++++++++++++++
 .../large-data-threshold.f90                  |  8 +++++++
 flang/test/{Lower => Integration}/mcmodel.f90 |  8 +++++++
 .../real-descriptors.f90                      |  8 +++++++
 .../safe-trampoline.f90                       |  8 +++++++
 flang/test/Integration/tune-cpu-llvm.f90      | 16 ++++++++++++++
 .../Lower/MIF/coarray_dealloc_not_alloc.f90   | 13 ------------
 flang/test/Lower/OpenMP/missing-inode.f90     |  8 -------
 flang/test/Lower/complex-part.f90             | 12 -----------
 flang/test/Lower/const-arg-glob.f90           | 13 ------------
 .../Lower/intrinsic-procedure-wrappers.f90    | 10 ---------
 flang/test/Lower/tune-cpu-llvm.f90            |  8 -------
 78 files changed, 639 insertions(+), 69 deletions(-)
 rename flang/test/{Lower => Integration}/Arm/arm-sve-vector-bits-vscale-range.f90 (84%)
 rename flang/test/{Lower => Integration}/HLFIR/common-block-bindc-conflicts.f90 (77%)
 rename flang/test/{Lower => Integration}/HLFIR/elemental-user-procedure-stacksave.f90 (57%)
 rename flang/test/{Lower => Integration}/HLFIR/unroll-loops.fir (83%)
 rename flang/test/{Lower => Integration}/HLFIR/where-implied-do-mask.f90 (52%)
 rename flang/test/{Lower => Integration}/Intrinsics/fma.f90 (64%)
 rename flang/test/{Lower => Integration}/MIF/coarray_allocation4.f90 (90%)
 rename flang/test/{Lower => Integration}/MIF/coarray_allocation5.f90 (75%)
 create mode 100644 flang/test/Integration/MIF/coarray_dealloc_not_alloc.f90
 rename flang/test/{Lower => Integration}/OpenMP/atomic-read-complex.f90 (67%)
 rename flang/test/{Lower => Integration}/OpenMP/atomic-write-complex.f90 (67%)
 rename flang/test/{Lower => Integration}/OpenMP/declare-target-deferred-marking-reductions.f90 (72%)
 rename flang/test/{Lower => Integration}/OpenMP/declare-target-deferred-marking.f90 (84%)
 rename flang/test/{Lower => Integration}/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90 (94%)
 rename flang/test/{Lower => Integration}/OpenMP/declare-target-implicit-func-and-subr-cap.f90 (95%)
 rename flang/test/{Lower => Integration}/OpenMP/declare-target-implicit-tarop-cap.f90 (89%)
 rename flang/test/{Lower => Integration}/OpenMP/declare-target-named-main-interface.f90 (64%)
 rename flang/test/{Lower => Integration}/OpenMP/delayed-privatization-allocatable-firstprivate.f90 (80%)
 rename flang/test/{Lower => Integration}/OpenMP/delayed-privatization-lower-allocatable-to-llvm.f90 (55%)
 rename flang/test/{Lower => Integration}/OpenMP/math-amdgpu.f90 (90%)
 rename flang/test/{Lower => Integration}/OpenMP/math-nvptx.f90 (93%)
 create mode 100644 flang/test/Integration/OpenMP/missing-inode.f90
 rename flang/test/{Lower => Integration}/OpenMP/parallel-reduction-mixed.f90 (79%)
 rename flang/test/{Lower => Integration}/OpenMP/target-data-if-false.f90 (51%)
 rename flang/test/{Lower => Integration}/OpenMP/target-data-skip-mapper-calls.f90 (66%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-intrinsics.f90 (89%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-mma-accumulator-move-clear.f90 (72%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-mma-assemble-disassemble.f90 (98%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-mma-outer-product-1.f90 (99%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-mma-outer-product-2.f90 (98%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-pwr10-vec-intrinsics.f90 (97%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-abs.f90 (81%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-add-and-mul-sub-xor.f90 (97%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-any.f90 (90%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-cmp.f90 (97%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-convert.f90 (98%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-cvf-elem-order.f90 (66%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-extract-elem-order.f90 (72%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-extract.f90 (96%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-insert-elem-order.f90 (74%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-insert.f90 (96%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-load-elem-order.f90 (98%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-load.f90 (98%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-max-min-madd-nmsub.f90 (96%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-merge-elem-order.f90 (70%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-merge.f90 (95%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-perm-elem-order.f90 (75%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-perm.f90 (97%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-sel.f90 (94%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-shift-be-le.f90 (99%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-shift.f90 (98%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-splat-elem-order.f90 (70%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-splat.f90 (98%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-store-elem-order.f90 (89%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vec-store.f90 (97%)
 rename flang/test/{Lower => Integration}/PowerPC/ppc-vector-types.f90 (91%)
 rename flang/test/{Lower => Integration}/RISCV/riscv-target-abi.f90 (53%)
 rename flang/test/{Lower => Integration}/RISCV/riscv-vector-bits-vscale-range.f90 (85%)
 rename flang/test/{Lower => Integration}/allocatable-polymorphic.f90 (99%)
 rename flang/test/{Lower => Integration}/array-wide-char.f90 (74%)
 rename flang/test/{Lower => Integration}/common-block.f90 (81%)
 create mode 100644 flang/test/Integration/complex-part.f90
 create mode 100644 flang/test/Integration/const-arg-glob.f90
 rename flang/test/{Lower => Integration}/dense-array-any-rank.f90 (81%)
 rename flang/test/{Lower => Integration}/derived-types-bindc.f90 (71%)
 rename flang/test/{Lower => Integration}/forall/character-1.f90 (73%)
 create mode 100644 flang/test/Integration/intrinsic-procedure-wrappers.f90
 rename flang/test/{Lower => Integration}/large-data-threshold.f90 (69%)
 rename flang/test/{Lower => Integration}/mcmodel.f90 (69%)
 rename flang/test/{Lower => Integration}/real-descriptors.f90 (88%)
 rename flang/test/{Lower => Integration}/safe-trampoline.f90 (85%)
 create mode 100644 flang/test/Integration/tune-cpu-llvm.f90
 delete mode 100644 flang/test/Lower/MIF/coarray_dealloc_not_alloc.f90
 delete mode 100644 flang/test/Lower/OpenMP/missing-inode.f90
 delete mode 100644 flang/test/Lower/complex-part.f90
 delete mode 100644 flang/test/Lower/const-arg-glob.f90
 delete mode 100644 flang/test/Lower/intrinsic-procedure-wrappers.f90
 delete mode 100644 flang/test/Lower/tune-cpu-llvm.f90

diff --git a/flang/test/Lower/Arm/arm-sve-vector-bits-vscale-range.f90 b/flang/test/Integration/Arm/arm-sve-vector-bits-vscale-range.f90
similarity index 84%
rename from flang/test/Lower/Arm/arm-sve-vector-bits-vscale-range.f90
rename to flang/test/Integration/Arm/arm-sve-vector-bits-vscale-range.f90
index 9e09a41198626..92300935ea441 100644
--- a/flang/test/Lower/Arm/arm-sve-vector-bits-vscale-range.f90
+++ b/flang/test/Integration/Arm/arm-sve-vector-bits-vscale-range.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! REQUIRES: aarch64-registered-target
 ! RUN: %flang_fc1 -triple aarch64-none-linux-gnu -target-feature +sve -mvscale-min=1 -mvscale-max=1  -emit-llvm -o - %s | FileCheck %s -D#VBITS=1
 ! RUN: %flang_fc1 -triple aarch64-none-linux-gnu -target-feature +sve -mvscale-min=2 -mvscale-max=2  -emit-llvm -o - %s | FileCheck %s -D#VBITS=2
diff --git a/flang/test/Lower/HLFIR/common-block-bindc-conflicts.f90 b/flang/test/Integration/HLFIR/common-block-bindc-conflicts.f90
similarity index 77%
rename from flang/test/Lower/HLFIR/common-block-bindc-conflicts.f90
rename to flang/test/Integration/HLFIR/common-block-bindc-conflicts.f90
index 07259539d851d..d03d033be0e14 100644
--- a/flang/test/Lower/HLFIR/common-block-bindc-conflicts.f90
+++ b/flang/test/Integration/HLFIR/common-block-bindc-conflicts.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! Test the mixing BIND(C) and non BIND(C) common blocks.
 
 ! RUN: %flang_fc1 -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=UNDERSCORING
diff --git a/flang/test/Lower/HLFIR/elemental-user-procedure-stacksave.f90 b/flang/test/Integration/HLFIR/elemental-user-procedure-stacksave.f90
similarity index 57%
rename from flang/test/Lower/HLFIR/elemental-user-procedure-stacksave.f90
rename to flang/test/Integration/HLFIR/elemental-user-procedure-stacksave.f90
index 839342f2da6d8..c14b57a98ba0f 100644
--- a/flang/test/Lower/HLFIR/elemental-user-procedure-stacksave.f90
+++ b/flang/test/Integration/HLFIR/elemental-user-procedure-stacksave.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! Check that stack save and restore needed for elemental function result
 ! allocation inside loops are not emitted directly in lowering, but inserted if
 ! needed in the stack-reclaim pass.
diff --git a/flang/test/Lower/HLFIR/unroll-loops.fir b/flang/test/Integration/HLFIR/unroll-loops.fir
similarity index 83%
rename from flang/test/Lower/HLFIR/unroll-loops.fir
rename to flang/test/Integration/HLFIR/unroll-loops.fir
index 4ea90b2f2f23f..2d9090fccbc46 100644
--- a/flang/test/Lower/HLFIR/unroll-loops.fir
+++ b/flang/test/Integration/HLFIR/unroll-loops.fir
@@ -1,3 +1,11 @@
+//===----------------------------------------------------------------------===//
+// This directory can be used to add Integration tests involving multiple
+// stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+// contain executable tests. We should only add tests here sparingly and only
+// if there is no other way to test. Repeat this message in each test that is
+// added to this directory and sub-directories.
+//===----------------------------------------------------------------------===//
+
 // DEFINE: %{triple} =
 // DEFINE: %{check-unroll} = %flang_fc1 -emit-llvm -O1 -vectorize-loops -funroll-loops -mllvm -force-vector-width=2 -triple %{triple} -o- %s | FileCheck %s --check-prefixes=CHECK,UNROLL
 // DEFINE: %{check-nounroll} = %flang_fc1 -emit-llvm -O1 -vectorize-loops -mllvm -force-vector-width=2 -triple %{triple} -o- %s | FileCheck %s --check-prefixes=CHECK,NO-UNROLL
diff --git a/flang/test/Lower/HLFIR/where-implied-do-mask.f90 b/flang/test/Integration/HLFIR/where-implied-do-mask.f90
similarity index 52%
rename from flang/test/Lower/HLFIR/where-implied-do-mask.f90
rename to flang/test/Integration/HLFIR/where-implied-do-mask.f90
index 395192c9a7c52..2600f5c59f538 100644
--- a/flang/test/Lower/HLFIR/where-implied-do-mask.f90
+++ b/flang/test/Integration/HLFIR/where-implied-do-mask.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: bbc -emit-hlfir -o - %s | FileCheck %s
 ! RUN: %flang_fc1 -emit-llvm -o /dev/null %s
 
diff --git a/flang/test/Lower/Intrinsics/fma.f90 b/flang/test/Integration/Intrinsics/fma.f90
similarity index 64%
rename from flang/test/Lower/Intrinsics/fma.f90
rename to flang/test/Integration/Intrinsics/fma.f90
index 0f06e81b1d5c5..44c374c1c343c 100644
--- a/flang/test/Lower/Intrinsics/fma.f90
+++ b/flang/test/Integration/Intrinsics/fma.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: bbc -emit-fir %s -o - | FileCheck --check-prefix=CHECK-FIR %s
 ! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck --check-prefix=CHECK-LLVMIR %s
 
diff --git a/flang/test/Lower/MIF/coarray_allocation4.f90 b/flang/test/Integration/MIF/coarray_allocation4.f90
similarity index 90%
rename from flang/test/Lower/MIF/coarray_allocation4.f90
rename to flang/test/Integration/MIF/coarray_allocation4.f90
index 450fad07f9933..c98ae9dd01612 100644
--- a/flang/test/Lower/MIF/coarray_allocation4.f90
+++ b/flang/test/Integration/MIF/coarray_allocation4.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-hlfir -fcoarray %s -o - 2>&1 | FileCheck %s
 ! RUN: %flang_fc1 -emit-llvm -fcoarray %s -o - 2>&1 | FileCheck %s --check-prefix=LLVM
 
@@ -73,4 +81,3 @@ program main
 
 ! CHECK:  fir.global internal @_QFtest_coarray_saveEn : f32
 ! CHECK:  fir.global internal @_QFtest_coarray_saveEp : f32
-
diff --git a/flang/test/Lower/MIF/coarray_allocation5.f90 b/flang/test/Integration/MIF/coarray_allocation5.f90
similarity index 75%
rename from flang/test/Lower/MIF/coarray_allocation5.f90
rename to flang/test/Integration/MIF/coarray_allocation5.f90
index c1a7958b67454..03b37768759d4 100644
--- a/flang/test/Lower/MIF/coarray_allocation5.f90
+++ b/flang/test/Integration/MIF/coarray_allocation5.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-hlfir -fcoarray %s -o - | FileCheck %s
 ! RUN: %flang_fc1 -emit-llvm -fcoarray %s -o - 2>&1 | FileCheck %s --check-prefix=LLVM
 
diff --git a/flang/test/Integration/MIF/coarray_dealloc_not_alloc.f90 b/flang/test/Integration/MIF/coarray_dealloc_not_alloc.f90
new file mode 100644
index 0000000000000..a58ec693ac5ba
--- /dev/null
+++ b/flang/test/Integration/MIF/coarray_dealloc_not_alloc.f90
@@ -0,0 +1,21 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
+! RUN: %flang_fc1 -emit-llvm -fcoarray %s -o - 2>&1 | FileCheck %s --check-prefix=LLVM
+
+! LLVM: @_QFB1Ekk_coarray_handle = linkonce global %_QM__fortran_builtinsT__builtin_prif_coarray_handle_type zeroinitializer{{.*}}
+
+! LLVM-LABEL:  @_QQmain()
+! LLVM:  call void @_QMprifPprif_deallocate_coarray(ptr @_QFB1Ekk_coarray_handle, ptr null, ptr null, ptr null)
+
+
+block
+integer :: kk
+allocatable :: kk(:)[:]
+endblock
+end
diff --git a/flang/test/Lower/OpenMP/atomic-read-complex.f90 b/flang/test/Integration/OpenMP/atomic-read-complex.f90
similarity index 67%
rename from flang/test/Lower/OpenMP/atomic-read-complex.f90
rename to flang/test/Integration/OpenMP/atomic-read-complex.f90
index cd20c5d0316b7..9b8dc463c4351 100644
--- a/flang/test/Lower/OpenMP/atomic-read-complex.f90
+++ b/flang/test/Integration/OpenMP/atomic-read-complex.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! Test lowering of atomic read to LLVM IR for complex types.
 ! This is a regression test for issue #165184.
 
diff --git a/flang/test/Lower/OpenMP/atomic-write-complex.f90 b/flang/test/Integration/OpenMP/atomic-write-complex.f90
similarity index 67%
rename from flang/test/Lower/OpenMP/atomic-write-complex.f90
rename to flang/test/Integration/OpenMP/atomic-write-complex.f90
index 4e975bf2c9c6a..ef7629917cd90 100644
--- a/flang/test/Lower/OpenMP/atomic-write-complex.f90
+++ b/flang/test/Integration/OpenMP/atomic-write-complex.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! Test lowering of atomic write to LLVM IR for complex types.
 ! This is a regression test for issue #165184.
 
diff --git a/flang/test/Lower/OpenMP/declare-target-deferred-marking-reductions.f90 b/flang/test/Integration/OpenMP/declare-target-deferred-marking-reductions.f90
similarity index 72%
rename from flang/test/Lower/OpenMP/declare-target-deferred-marking-reductions.f90
rename to flang/test/Integration/OpenMP/declare-target-deferred-marking-reductions.f90
index 4741de56ff704..124ec4b8ffbd7 100644
--- a/flang/test/Lower/OpenMP/declare-target-deferred-marking-reductions.f90
+++ b/flang/test/Integration/OpenMP/declare-target-deferred-marking-reductions.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 !RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 %s -o - | tco -test-gen | FileCheck %s
 !RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -fopenmp-is-device %s -o - | tco -test-gen | FileCheck %s
 
diff --git a/flang/test/Lower/OpenMP/declare-target-deferred-marking.f90 b/flang/test/Integration/OpenMP/declare-target-deferred-marking.f90
similarity index 84%
rename from flang/test/Lower/OpenMP/declare-target-deferred-marking.f90
rename to flang/test/Integration/OpenMP/declare-target-deferred-marking.f90
index 9fdfcdae3e7e1..8be7efd2619f1 100644
--- a/flang/test/Lower/OpenMP/declare-target-deferred-marking.f90
+++ b/flang/test/Integration/OpenMP/declare-target-deferred-marking.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 !RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 %s -o - | tco -test-gen | FileCheck %s --check-prefixes ALL,HOST
 !RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -fopenmp-is-device %s -o - | tco -test-gen | FileCheck %s --check-prefixes ALL
 
diff --git a/flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90 b/flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90
similarity index 94%
rename from flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90
rename to flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90
index 0d16e5bc1b0d1..225a8f4bec855 100644
--- a/flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90
+++ b/flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 !RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 %s -o - | tco -test-gen | FileCheck %s
 !RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -fopenmp-is-target-device %s -o - | tco -test-gen | FileCheck %s  --check-prefix=DEVICE
 !RUN: bbc -emit-hlfir -fopenmp -fopenmp-version=52 %s -o - | tco -test-gen | FileCheck %s
diff --git a/flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap.f90 b/flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap.f90
similarity index 95%
rename from flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap.f90
rename to flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap.f90
index dbce61c44e85b..36954739a916d 100644
--- a/flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap.f90
+++ b/flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 !RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=50 %s -o - | tco -test-gen | FileCheck %s
 !RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=50 -fopenmp-is-target-device %s -o - | tco -test-gen | FileCheck %s  --check-prefix=DEVICE
 !RUN: bbc -emit-hlfir -fopenmp -fopenmp-version=50 %s -o - | tco -test-gen | FileCheck %s
diff --git a/flang/test/Lower/OpenMP/declare-target-implicit-tarop-cap.f90 b/flang/test/Integration/OpenMP/declare-target-implicit-tarop-cap.f90
similarity index 89%
rename from flang/test/Lower/OpenMP/declare-target-implicit-tarop-cap.f90
rename to flang/test/Integration/OpenMP/declare-target-implicit-tarop-cap.f90
index f89484d988d2d..0d527df426a2d 100644
--- a/flang/test/Lower/OpenMP/declare-target-implicit-tarop-cap.f90
+++ b/flang/test/Integration/OpenMP/declare-target-implicit-tarop-cap.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 !RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 %s -o - | tco -test-gen | FileCheck %s
 !RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -fopenmp-is-device %s -o - | tco -test-gen | FileCheck %s  --check-prefix=DEVICE
 !RUN: bbc -emit-hlfir -fopenmp -fopenmp-version=52 %s -o - | tco -test-gen | FileCheck %s
diff --git a/flang/test/Lower/OpenMP/declare-target-named-main-interface.f90 b/flang/test/Integration/OpenMP/declare-target-named-main-interface.f90
similarity index 64%
rename from flang/test/Lower/OpenMP/declare-target-named-main-interface.f90
rename to flang/test/Integration/OpenMP/declare-target-named-main-interface.f90
index 19d245225d53d..5303260e5e45e 100644
--- a/flang/test/Lower/OpenMP/declare-target-named-main-interface.f90
+++ b/flang/test/Integration/OpenMP/declare-target-named-main-interface.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 !RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - | tco -test-gen | FileCheck %s
 !RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-is-target-device %s -o - | tco -test-gen | FileCheck %s
 
diff --git a/flang/test/Lower/OpenMP/delayed-privatization-allocatable-firstprivate.f90 b/flang/test/Integration/OpenMP/delayed-privatization-allocatable-firstprivate.f90
similarity index 80%
rename from flang/test/Lower/OpenMP/delayed-privatization-allocatable-firstprivate.f90
rename to flang/test/Integration/OpenMP/delayed-privatization-allocatable-firstprivate.f90
index e21425280d3b8..281feb02f4e6e 100644
--- a/flang/test/Lower/OpenMP/delayed-privatization-allocatable-firstprivate.f90
+++ b/flang/test/Integration/OpenMP/delayed-privatization-allocatable-firstprivate.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! Test delayed privatization for allocatables: `firstprivate`.
 
 ! RUN: split-file %s %t
diff --git a/flang/test/Lower/OpenMP/delayed-privatization-lower-allocatable-to-llvm.f90 b/flang/test/Integration/OpenMP/delayed-privatization-lower-allocatable-to-llvm.f90
similarity index 55%
rename from flang/test/Lower/OpenMP/delayed-privatization-lower-allocatable-to-llvm.f90
rename to flang/test/Integration/OpenMP/delayed-privatization-lower-allocatable-to-llvm.f90
index effc356590e9a..c5eb4c9a99f68 100644
--- a/flang/test/Lower/OpenMP/delayed-privatization-lower-allocatable-to-llvm.f90
+++ b/flang/test/Integration/OpenMP/delayed-privatization-lower-allocatable-to-llvm.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! Tests the OMPIRBuilder can handle multiple privatization regions that contain
 ! multiple BBs (for example, for allocatables).
 
diff --git a/flang/test/Lower/OpenMP/math-amdgpu.f90 b/flang/test/Integration/OpenMP/math-amdgpu.f90
similarity index 90%
rename from flang/test/Lower/OpenMP/math-amdgpu.f90
rename to flang/test/Integration/OpenMP/math-amdgpu.f90
index 55a14f7d31378..78c0882e362e1 100644
--- a/flang/test/Lower/OpenMP/math-amdgpu.f90
+++ b/flang/test/Integration/OpenMP/math-amdgpu.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 !REQUIRES: amdgpu-registered-target
 !RUN: %flang_fc1 -triple amdgcn-amd-amdhsa -emit-llvm -fopenmp -fopenmp-is-target-device %s -o - | FileCheck %s
 
diff --git a/flang/test/Lower/OpenMP/math-nvptx.f90 b/flang/test/Integration/OpenMP/math-nvptx.f90
similarity index 93%
rename from flang/test/Lower/OpenMP/math-nvptx.f90
rename to flang/test/Integration/OpenMP/math-nvptx.f90
index 8569e26b759e8..9b4359e4d6375 100644
--- a/flang/test/Lower/OpenMP/math-nvptx.f90
+++ b/flang/test/Integration/OpenMP/math-nvptx.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 !REQUIRES: nvptx-registered-target
 !RUN: %flang_fc1 -triple nvptx64-nvidia-cuda -emit-llvm -fopenmp -fopenmp-is-target-device %s -o - | FileCheck %s
 
diff --git a/flang/test/Integration/OpenMP/missing-inode.f90 b/flang/test/Integration/OpenMP/missing-inode.f90
new file mode 100644
index 0000000000000..641b10760f316
--- /dev/null
+++ b/flang/test/Integration/OpenMP/missing-inode.f90
@@ -0,0 +1,16 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
+! RUN: %flang_fc1 -emit-llvm -fopenmp -fopenmp-version=51 -fopenmp-targets=amdgcn-amd-amdhsa -o - %s | FileCheck %s
+program missing_inode
+#line "/this_path_should_not_exist_on_any_system_out_there/and_if_it_does_it_will_break_the/tes.f90" 700
+    ! CHECK:  define internal void @__omp_offloading_{{[0-9a-f]+}}_{{[0-9a-f]+}}__QQmain_l701
+    !$omp target
+        call some_routine()
+    !$omp end target
+end program missing_inode
diff --git a/flang/test/Lower/OpenMP/parallel-reduction-mixed.f90 b/flang/test/Integration/OpenMP/parallel-reduction-mixed.f90
similarity index 79%
rename from flang/test/Lower/OpenMP/parallel-reduction-mixed.f90
rename to flang/test/Integration/OpenMP/parallel-reduction-mixed.f90
index cf3f73b17060d..8f25a6a92d7e8 100644
--- a/flang/test/Lower/OpenMP/parallel-reduction-mixed.f90
+++ b/flang/test/Integration/OpenMP/parallel-reduction-mixed.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 !! Make sure that mixture of by-ref and by-val reductions work all the way
 !! to LLVM-IR code.
 
diff --git a/flang/test/Lower/OpenMP/target-data-if-false.f90 b/flang/test/Integration/OpenMP/target-data-if-false.f90
similarity index 51%
rename from flang/test/Lower/OpenMP/target-data-if-false.f90
rename to flang/test/Integration/OpenMP/target-data-if-false.f90
index ac0f675ddc806..5e8526638247b 100644
--- a/flang/test/Lower/OpenMP/target-data-if-false.f90
+++ b/flang/test/Integration/OpenMP/target-data-if-false.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 !RUN: %flang_fc1 -emit-llvm -fopenmp %openmp_flags -fopenmp-version=52 %s -o - | FileCheck %s
 
 !Check that this doesn't crash.
diff --git a/flang/test/Lower/OpenMP/target-data-skip-mapper-calls.f90 b/flang/test/Integration/OpenMP/target-data-skip-mapper-calls.f90
similarity index 66%
rename from flang/test/Lower/OpenMP/target-data-skip-mapper-calls.f90
rename to flang/test/Integration/OpenMP/target-data-skip-mapper-calls.f90
index e2302873bd68e..477c09aa614d4 100644
--- a/flang/test/Lower/OpenMP/target-data-skip-mapper-calls.f90
+++ b/flang/test/Integration/OpenMP/target-data-skip-mapper-calls.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 !RUN: %flang_fc1 -emit-llvm -fopenmp %s -o - | FileCheck %s --check-prefix=NORT
 !RUN: %flang_fc1 -emit-llvm -fopenmp %s -o - | FileCheck %s --check-prefix=LLVM
 
diff --git a/flang/test/Lower/PowerPC/ppc-intrinsics.f90 b/flang/test/Integration/PowerPC/ppc-intrinsics.f90
similarity index 89%
rename from flang/test/Lower/PowerPC/ppc-intrinsics.f90
rename to flang/test/Integration/PowerPC/ppc-intrinsics.f90
index 8973b15015557..afa622afa2a16 100644
--- a/flang/test/Lower/PowerPC/ppc-intrinsics.f90
+++ b/flang/test/Integration/PowerPC/ppc-intrinsics.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-mma-accumulator-move-clear.f90 b/flang/test/Integration/PowerPC/ppc-mma-accumulator-move-clear.f90
similarity index 72%
rename from flang/test/Lower/PowerPC/ppc-mma-accumulator-move-clear.f90
rename to flang/test/Integration/PowerPC/ppc-mma-accumulator-move-clear.f90
index de8e09e43dfd7..7764c6d177a46 100644
--- a/flang/test/Lower/PowerPC/ppc-mma-accumulator-move-clear.f90
+++ b/flang/test/Integration/PowerPC/ppc-mma-accumulator-move-clear.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -target-cpu pwr10 -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-mma-assemble-disassemble.f90 b/flang/test/Integration/PowerPC/ppc-mma-assemble-disassemble.f90
similarity index 98%
rename from flang/test/Lower/PowerPC/ppc-mma-assemble-disassemble.f90
rename to flang/test/Integration/PowerPC/ppc-mma-assemble-disassemble.f90
index 894c262782046..fc657fefed868 100644
--- a/flang/test/Lower/PowerPC/ppc-mma-assemble-disassemble.f90
+++ b/flang/test/Integration/PowerPC/ppc-mma-assemble-disassemble.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -target-cpu pwr10 -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-mma-outer-product-1.f90 b/flang/test/Integration/PowerPC/ppc-mma-outer-product-1.f90
similarity index 99%
rename from flang/test/Lower/PowerPC/ppc-mma-outer-product-1.f90
rename to flang/test/Integration/PowerPC/ppc-mma-outer-product-1.f90
index 73e483f308a49..629bc7fb364c3 100644
--- a/flang/test/Lower/PowerPC/ppc-mma-outer-product-1.f90
+++ b/flang/test/Integration/PowerPC/ppc-mma-outer-product-1.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -target-cpu pwr10 -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-mma-outer-product-2.f90 b/flang/test/Integration/PowerPC/ppc-mma-outer-product-2.f90
similarity index 98%
rename from flang/test/Lower/PowerPC/ppc-mma-outer-product-2.f90
rename to flang/test/Integration/PowerPC/ppc-mma-outer-product-2.f90
index a00fe78c2e9fc..6affc676219b5 100644
--- a/flang/test/Lower/PowerPC/ppc-mma-outer-product-2.f90
+++ b/flang/test/Integration/PowerPC/ppc-mma-outer-product-2.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -target-cpu pwr10 -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-pwr10-vec-intrinsics.f90 b/flang/test/Integration/PowerPC/ppc-pwr10-vec-intrinsics.f90
similarity index 97%
rename from flang/test/Lower/PowerPC/ppc-pwr10-vec-intrinsics.f90
rename to flang/test/Integration/PowerPC/ppc-pwr10-vec-intrinsics.f90
index c7d633eb95abb..00ffc87dd8fd1 100644
--- a/flang/test/Lower/PowerPC/ppc-pwr10-vec-intrinsics.f90
+++ b/flang/test/Integration/PowerPC/ppc-pwr10-vec-intrinsics.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -target-cpu pwr10 -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-vec-abs.f90 b/flang/test/Integration/PowerPC/ppc-vec-abs.f90
similarity index 81%
rename from flang/test/Lower/PowerPC/ppc-vec-abs.f90
rename to flang/test/Integration/PowerPC/ppc-vec-abs.f90
index c17b1db07b0ce..95fb84162b099 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-abs.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-abs.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-vec-add-and-mul-sub-xor.f90 b/flang/test/Integration/PowerPC/ppc-vec-add-and-mul-sub-xor.f90
similarity index 97%
rename from flang/test/Lower/PowerPC/ppc-vec-add-and-mul-sub-xor.f90
rename to flang/test/Integration/PowerPC/ppc-vec-add-and-mul-sub-xor.f90
index c90b4f64bf33a..8df8c22d2e3e8 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-add-and-mul-sub-xor.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-add-and-mul-sub-xor.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
@@ -526,4 +534,3 @@ subroutine vec_xor_testf64(arg1, arg2)
 ! LLVMIR: %[[r:.*]] = xor <2 x i64> %[[bc1]], %[[bc2]]
 ! LLVMIR: %{{[0-9]+}} = bitcast <2 x i64> %[[r]] to <2 x double>
 end subroutine vec_xor_testf64
-
diff --git a/flang/test/Lower/PowerPC/ppc-vec-any.f90 b/flang/test/Integration/PowerPC/ppc-vec-any.f90
similarity index 90%
rename from flang/test/Lower/PowerPC/ppc-vec-any.f90
rename to flang/test/Integration/PowerPC/ppc-vec-any.f90
index a25960d8b5ce5..80aeaf5715e0c 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-any.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-any.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
@@ -114,4 +122,3 @@ subroutine vec_any_ge_test_r8(arg1, arg2)
 ! LLVMIR: %[[arg2:.*]] = load <2 x double>, ptr %{{.*}}, align 16
 ! LLVMIR: %{{[0-9]+}} = call i32 @llvm.ppc.vsx.xvcmpgedp.p(i32 1, <2 x double> %[[arg1]], <2 x double> %[[arg2]])
 end subroutine vec_any_ge_test_r8
-
diff --git a/flang/test/Lower/PowerPC/ppc-vec-cmp.f90 b/flang/test/Integration/PowerPC/ppc-vec-cmp.f90
similarity index 97%
rename from flang/test/Lower/PowerPC/ppc-vec-cmp.f90
rename to flang/test/Integration/PowerPC/ppc-vec-cmp.f90
index e48a62d619983..573f6d5eb51db 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-cmp.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-cmp.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! RUN: %flang_fc1 -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
@@ -471,4 +479,3 @@ subroutine vec_cmplt_test_r8(arg1, arg2)
 ! LLVMIR: %[[arg2:.*]] = load <2 x double>, ptr %{{.*}}, align 16
 ! LLVMIR: %{{[0-9]+}} = call <2 x i64> @llvm.ppc.vsx.xvcmpgtdp(<2 x double> %[[arg2]], <2 x double> %[[arg1]])
 end subroutine vec_cmplt_test_r8
-
diff --git a/flang/test/Lower/PowerPC/ppc-vec-convert.f90 b/flang/test/Integration/PowerPC/ppc-vec-convert.f90
similarity index 98%
rename from flang/test/Lower/PowerPC/ppc-vec-convert.f90
rename to flang/test/Integration/PowerPC/ppc-vec-convert.f90
index 1ee8e3b9a839e..67d846e390068 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-convert.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-convert.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-LE" %s
 ! RUN: %flang_fc1 -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-BE" %s
 ! REQUIRES: target=powerpc{{.*}}
@@ -1339,4 +1347,3 @@ subroutine vec_cvf_test_r8r4(arg1)
 ! LLVMIR-BE: %[[r:.*]] = call contract <2 x double> @llvm.ppc.vsx.xvcvspdp(<4 x float> %[[arg]])
 ! LLVMIR-BE: store <2 x double> %[[call]], ptr %{{.*}}, align 16
 end subroutine vec_cvf_test_r8r4
-
diff --git a/flang/test/Lower/PowerPC/ppc-vec-cvf-elem-order.f90 b/flang/test/Integration/PowerPC/ppc-vec-cvf-elem-order.f90
similarity index 66%
rename from flang/test/Lower/PowerPC/ppc-vec-cvf-elem-order.f90
rename to flang/test/Integration/PowerPC/ppc-vec-cvf-elem-order.f90
index 3efc83f266bd9..3e637bf73c074 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-cvf-elem-order.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-cvf-elem-order.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -fno-ppc-native-vector-element-order -triple ppc64le-unknown-linux -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-vec-extract-elem-order.f90 b/flang/test/Integration/PowerPC/ppc-vec-extract-elem-order.f90
similarity index 72%
rename from flang/test/Lower/PowerPC/ppc-vec-extract-elem-order.f90
rename to flang/test/Integration/PowerPC/ppc-vec-extract-elem-order.f90
index d7d14581b4b7f..be1ac00ec0204 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-extract-elem-order.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-extract-elem-order.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -fno-ppc-native-vector-element-order -triple ppc64le-unknown-linux -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-vec-extract.f90 b/flang/test/Integration/PowerPC/ppc-vec-extract.f90
similarity index 96%
rename from flang/test/Lower/PowerPC/ppc-vec-extract.f90
rename to flang/test/Integration/PowerPC/ppc-vec-extract.f90
index 32c0dcfd66013..2e2e6087c879f 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-extract.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-extract.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-LE" %s
 ! RUN: %flang_fc1 -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-BE" %s
 ! REQUIRES: target=powerpc{{.*}}
diff --git a/flang/test/Lower/PowerPC/ppc-vec-insert-elem-order.f90 b/flang/test/Integration/PowerPC/ppc-vec-insert-elem-order.f90
similarity index 74%
rename from flang/test/Lower/PowerPC/ppc-vec-insert-elem-order.f90
rename to flang/test/Integration/PowerPC/ppc-vec-insert-elem-order.f90
index b30065d74e46b..72f1b8c8c8234 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-insert-elem-order.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-insert-elem-order.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -fno-ppc-native-vector-element-order -triple ppc64le-unknown-linux -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-vec-insert.f90 b/flang/test/Integration/PowerPC/ppc-vec-insert.f90
similarity index 96%
rename from flang/test/Lower/PowerPC/ppc-vec-insert.f90
rename to flang/test/Integration/PowerPC/ppc-vec-insert.f90
index 26bc7fc114cec..328544f172c7d 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-insert.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-insert.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-LE" %s
 ! RUN: %flang_fc1 -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-BE" %s
 ! REQUIRES: target=powerpc{{.*}}
diff --git a/flang/test/Lower/PowerPC/ppc-vec-load-elem-order.f90 b/flang/test/Integration/PowerPC/ppc-vec-load-elem-order.f90
similarity index 98%
rename from flang/test/Lower/PowerPC/ppc-vec-load-elem-order.f90
rename to flang/test/Integration/PowerPC/ppc-vec-load-elem-order.f90
index 3f2224dd229b6..607131bee09d9 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-load-elem-order.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-load-elem-order.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -fno-ppc-native-vector-element-order -triple ppc64le-unknown-linux -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-vec-load.f90 b/flang/test/Integration/PowerPC/ppc-vec-load.f90
similarity index 98%
rename from flang/test/Lower/PowerPC/ppc-vec-load.f90
rename to flang/test/Integration/PowerPC/ppc-vec-load.f90
index 8b004c3da0e26..5dfd289ee670b 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-load.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-load.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-LE","LLVM" %s
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -target-cpu pwr9 -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR_P9","LLVM" %s
 ! RUN: %flang_fc1 -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-BE","LLVM" %s
diff --git a/flang/test/Lower/PowerPC/ppc-vec-max-min-madd-nmsub.f90 b/flang/test/Integration/PowerPC/ppc-vec-max-min-madd-nmsub.f90
similarity index 96%
rename from flang/test/Lower/PowerPC/ppc-vec-max-min-madd-nmsub.f90
rename to flang/test/Integration/PowerPC/ppc-vec-max-min-madd-nmsub.f90
index 3ff1595f2e040..fd188052a53ef 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-max-min-madd-nmsub.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-max-min-madd-nmsub.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-vec-merge-elem-order.f90 b/flang/test/Integration/PowerPC/ppc-vec-merge-elem-order.f90
similarity index 70%
rename from flang/test/Lower/PowerPC/ppc-vec-merge-elem-order.f90
rename to flang/test/Integration/PowerPC/ppc-vec-merge-elem-order.f90
index 41e90f7893ca3..60c5ef916deb4 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-merge-elem-order.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-merge-elem-order.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -fno-ppc-native-vector-element-order -triple ppc64le-unknown-linux -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-vec-merge.f90 b/flang/test/Integration/PowerPC/ppc-vec-merge.f90
similarity index 95%
rename from flang/test/Lower/PowerPC/ppc-vec-merge.f90
rename to flang/test/Integration/PowerPC/ppc-vec-merge.f90
index 983da1b9df00d..fced46d4678ca 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-merge.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-merge.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-vec-perm-elem-order.f90 b/flang/test/Integration/PowerPC/ppc-vec-perm-elem-order.f90
similarity index 75%
rename from flang/test/Lower/PowerPC/ppc-vec-perm-elem-order.f90
rename to flang/test/Integration/PowerPC/ppc-vec-perm-elem-order.f90
index 9ac9d7f1fd3d5..11f031a2ff326 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-perm-elem-order.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-perm-elem-order.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -fno-ppc-native-vector-element-order -triple ppc64le-unknwon-linux -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-vec-perm.f90 b/flang/test/Integration/PowerPC/ppc-vec-perm.f90
similarity index 97%
rename from flang/test/Lower/PowerPC/ppc-vec-perm.f90
rename to flang/test/Integration/PowerPC/ppc-vec-perm.f90
index 0bb96cc5b14e4..8b3db64cff416 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-perm.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-perm.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-LE" %s
 ! RUN: %flang_fc1 -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-BE" %s
 ! REQUIRES: target=powerpc{{.*}}
diff --git a/flang/test/Lower/PowerPC/ppc-vec-sel.f90 b/flang/test/Integration/PowerPC/ppc-vec-sel.f90
similarity index 94%
rename from flang/test/Lower/PowerPC/ppc-vec-sel.f90
rename to flang/test/Integration/PowerPC/ppc-vec-sel.f90
index 5636923ae60ea..5b2494ff18f80 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-sel.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-sel.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! RUN: %flang_fc1 -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
diff --git a/flang/test/Lower/PowerPC/ppc-vec-shift-be-le.f90 b/flang/test/Integration/PowerPC/ppc-vec-shift-be-le.f90
similarity index 99%
rename from flang/test/Lower/PowerPC/ppc-vec-shift-be-le.f90
rename to flang/test/Integration/PowerPC/ppc-vec-shift-be-le.f90
index 829030d2b2f79..e8eaeedea7fdb 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-shift-be-le.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-shift-be-le.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -triple ppc64le-unknown-linux -o - | FileCheck --check-prefixes="LLVMIR","LLVM" %s
 !
 ! RUN: %flang_fc1 -emit-llvm %s -triple ppc64-unknown-aix -o - | FileCheck --check-prefixes="BE-LLVMIR","LLVM" %s
diff --git a/flang/test/Lower/PowerPC/ppc-vec-shift.f90 b/flang/test/Integration/PowerPC/ppc-vec-shift.f90
similarity index 98%
rename from flang/test/Lower/PowerPC/ppc-vec-shift.f90
rename to flang/test/Integration/PowerPC/ppc-vec-shift.f90
index c8bae93a362fa..040a30bd86da6 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-shift.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-shift.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! RUN: %flang_fc1 -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
diff --git a/flang/test/Lower/PowerPC/ppc-vec-splat-elem-order.f90 b/flang/test/Integration/PowerPC/ppc-vec-splat-elem-order.f90
similarity index 70%
rename from flang/test/Lower/PowerPC/ppc-vec-splat-elem-order.f90
rename to flang/test/Integration/PowerPC/ppc-vec-splat-elem-order.f90
index c1c7c7391b919..9904545627866 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-splat-elem-order.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-splat-elem-order.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -fno-ppc-native-vector-element-order -triple ppc64le-unknown-linux -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-vec-splat.f90 b/flang/test/Integration/PowerPC/ppc-vec-splat.f90
similarity index 98%
rename from flang/test/Lower/PowerPC/ppc-vec-splat.f90
rename to flang/test/Integration/PowerPC/ppc-vec-splat.f90
index 55614c75d1ad8..81ff96524b140 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-splat.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-splat.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-LE" %s
 ! RUN: %flang_fc1 -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR","LLVMIR-BE" %s
 ! REQUIRES: target=powerpc{{.*}}
diff --git a/flang/test/Lower/PowerPC/ppc-vec-store-elem-order.f90 b/flang/test/Integration/PowerPC/ppc-vec-store-elem-order.f90
similarity index 89%
rename from flang/test/Lower/PowerPC/ppc-vec-store-elem-order.f90
rename to flang/test/Integration/PowerPC/ppc-vec-store-elem-order.f90
index 5b41d7d616c33..2162f6c44f71e 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-store-elem-order.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-store-elem-order.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -fno-ppc-native-vector-element-order -triple ppc64le-unknown-linux -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-vec-store.f90 b/flang/test/Integration/PowerPC/ppc-vec-store.f90
similarity index 97%
rename from flang/test/Lower/PowerPC/ppc-vec-store.f90
rename to flang/test/Integration/PowerPC/ppc-vec-store.f90
index 16289d6565141..a2746e757dc3e 100644
--- a/flang/test/Lower/PowerPC/ppc-vec-store.f90
+++ b/flang/test/Integration/PowerPC/ppc-vec-store.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/PowerPC/ppc-vector-types.f90 b/flang/test/Integration/PowerPC/ppc-vector-types.f90
similarity index 91%
rename from flang/test/Lower/PowerPC/ppc-vector-types.f90
rename to flang/test/Integration/PowerPC/ppc-vector-types.f90
index 3d57f9520167f..6e80ea89b0584 100644
--- a/flang/test/Lower/PowerPC/ppc-vector-types.f90
+++ b/flang/test/Integration/PowerPC/ppc-vector-types.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-LLVM
 ! REQUIRES: target=powerpc{{.*}}
 
diff --git a/flang/test/Lower/RISCV/riscv-target-abi.f90 b/flang/test/Integration/RISCV/riscv-target-abi.f90
similarity index 53%
rename from flang/test/Lower/RISCV/riscv-target-abi.f90
rename to flang/test/Integration/RISCV/riscv-target-abi.f90
index 1077655d9272e..f3763cbb7acbf 100644
--- a/flang/test/Lower/RISCV/riscv-target-abi.f90
+++ b/flang/test/Integration/RISCV/riscv-target-abi.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! REQUIRES: riscv-registered-target
 ! RUN: %flang_fc1 -triple riscv64-none-linux-gnu -mabi=lp64  -emit-llvm -o - %s | FileCheck %s --check-prefix=LP64
 ! RUN: %flang_fc1 -triple riscv64-none-linux-gnu -mabi=lp64f  -emit-llvm -o - %s | FileCheck %s --check-prefix=LP64F
diff --git a/flang/test/Lower/RISCV/riscv-vector-bits-vscale-range.f90 b/flang/test/Integration/RISCV/riscv-vector-bits-vscale-range.f90
similarity index 85%
rename from flang/test/Lower/RISCV/riscv-vector-bits-vscale-range.f90
rename to flang/test/Integration/RISCV/riscv-vector-bits-vscale-range.f90
index d7fc6ad0a62c3..be9bf680f7651 100644
--- a/flang/test/Lower/RISCV/riscv-vector-bits-vscale-range.f90
+++ b/flang/test/Integration/RISCV/riscv-vector-bits-vscale-range.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! REQUIRES: riscv-registered-target
 ! RUN: %flang_fc1 -triple riscv64-none-linux-gnu -target-feature +v -mvscale-min=1 -mvscale-max=1  -emit-llvm -o - %s | FileCheck %s -D#VBITS=2
 ! RUN: %flang_fc1 -triple riscv64-none-linux-gnu -target-feature +v -mvscale-min=2 -mvscale-max=2  -emit-llvm -o - %s | FileCheck %s -D#VBITS=2
diff --git a/flang/test/Lower/allocatable-polymorphic.f90 b/flang/test/Integration/allocatable-polymorphic.f90
similarity index 99%
rename from flang/test/Lower/allocatable-polymorphic.f90
rename to flang/test/Integration/allocatable-polymorphic.f90
index 8a0cb1bbc7033..65b9c75b19eb4 100644
--- a/flang/test/Lower/allocatable-polymorphic.f90
+++ b/flang/test/Integration/allocatable-polymorphic.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: bbc -emit-hlfir %s -o - | FileCheck %s
 ! RUN: bbc -emit-hlfir %s -o - | tco | FileCheck %s --check-prefix=LLVM
 
diff --git a/flang/test/Lower/array-wide-char.f90 b/flang/test/Integration/array-wide-char.f90
similarity index 74%
rename from flang/test/Lower/array-wide-char.f90
rename to flang/test/Integration/array-wide-char.f90
index 6794589ca6c6e..8fca458117c86 100644
--- a/flang/test/Lower/array-wide-char.f90
+++ b/flang/test/Integration/array-wide-char.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: bbc -emit-hlfir %s -o - | tco | FileCheck %s
 
 character(LEN=128, KIND=4), PARAMETER :: conarr(3) = &
diff --git a/flang/test/Lower/common-block.f90 b/flang/test/Integration/common-block.f90
similarity index 81%
rename from flang/test/Lower/common-block.f90
rename to flang/test/Integration/common-block.f90
index 45810d3d00e29..5ffdd7df886d2 100644
--- a/flang/test/Lower/common-block.f90
+++ b/flang/test/Integration/common-block.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! REQUIRES: flang-supports-f128-math
 ! RUN: bbc %s -o - | tco | FileCheck %s
 ! RUN: %flang -emit-llvm -S -mmlir -disable-external-name-interop %s -o - | FileCheck %s
diff --git a/flang/test/Integration/complex-part.f90 b/flang/test/Integration/complex-part.f90
new file mode 100644
index 0000000000000..0049a2411f64e
--- /dev/null
+++ b/flang/test/Integration/complex-part.f90
@@ -0,0 +1,19 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
+! RUN: bbc %s -o - | tco | FileCheck %s
+! RUN: %flang -emit-llvm -S -mmlir -disable-external-name-interop %s -o - | FileCheck %s
+
+  COMPLEX c
+  c%RE = 3.14
+  CALL sub(c)
+END
+
+! Verify that the offset in the struct does not regress from i32.
+! CHECK-LABEL: define void @_QQmain()
+! CHECK: getelementptr { float, float }, ptr %{{[0-9]+}}, i32 0, i32 0
diff --git a/flang/test/Integration/const-arg-glob.f90 b/flang/test/Integration/const-arg-glob.f90
new file mode 100644
index 0000000000000..e54ea57e750c8
--- /dev/null
+++ b/flang/test/Integration/const-arg-glob.f90
@@ -0,0 +1,21 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
+! RUN: %flang_fc1 -emit-llvm -O2 -mllvm --enable-constant-argument-globalisation %s -o - | FileCheck %s
+
+! CHECK: @_global_const_{{.*}} = internal constant i32 2
+! CHECK: call void @take_int_(ptr nonnull @_global_const_{{.*}})
+
+subroutine test()
+  interface
+  subroutine take_int(n)
+    integer :: n
+  end subroutine
+  end interface
+  call take_int(2)
+end
diff --git a/flang/test/Lower/dense-array-any-rank.f90 b/flang/test/Integration/dense-array-any-rank.f90
similarity index 81%
rename from flang/test/Lower/dense-array-any-rank.f90
rename to flang/test/Integration/dense-array-any-rank.f90
index 0e11d8e46e516..6681613dd377a 100644
--- a/flang/test/Lower/dense-array-any-rank.f90
+++ b/flang/test/Integration/dense-array-any-rank.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: bbc -emit-fir -o - %s | FileCheck --check-prefixes="CHECK-FIR" %s
 ! RUN: %flang_fc1 -emit-llvm -o - %s | FileCheck --check-prefixes="CHECK-LLVMIR" %s
 
diff --git a/flang/test/Lower/derived-types-bindc.f90 b/flang/test/Integration/derived-types-bindc.f90
similarity index 71%
rename from flang/test/Lower/derived-types-bindc.f90
rename to flang/test/Integration/derived-types-bindc.f90
index c3c007dc82133..c56b392cfcb60 100644
--- a/flang/test/Lower/derived-types-bindc.f90
+++ b/flang/test/Integration/derived-types-bindc.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! Test padding for BIND(C) derived types lowering for AIX target
 ! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck %s
 
diff --git a/flang/test/Lower/forall/character-1.f90 b/flang/test/Integration/forall/character-1.f90
similarity index 73%
rename from flang/test/Lower/forall/character-1.f90
rename to flang/test/Integration/forall/character-1.f90
index 414e48332f0ad..9630cfb828fd3 100644
--- a/flang/test/Lower/forall/character-1.f90
+++ b/flang/test/Integration/forall/character-1.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefix=HLFIR
 ! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck %s --check-prefix=LLVM
 ! Test from Fortran source through to LLVM IR.
diff --git a/flang/test/Integration/intrinsic-procedure-wrappers.f90 b/flang/test/Integration/intrinsic-procedure-wrappers.f90
new file mode 100644
index 0000000000000..e519b9535ef3f
--- /dev/null
+++ b/flang/test/Integration/intrinsic-procedure-wrappers.f90
@@ -0,0 +1,18 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
+! RUN: bbc -outline-intrinsics %s -o - | tco --disable-llvm --mlir-print-ir-after=fir-to-llvm-ir 2>&1 | FileCheck %s
+
+! Test properties of intrinsic function wrappers
+
+! Test that intrinsic wrappers have internal linkage
+function foo(x)
+  foo = acos(x)
+end function
+
+! CHECK: llvm.func internal @fir.acos.contract.f32.f32
diff --git a/flang/test/Lower/large-data-threshold.f90 b/flang/test/Integration/large-data-threshold.f90
similarity index 69%
rename from flang/test/Lower/large-data-threshold.f90
rename to flang/test/Integration/large-data-threshold.f90
index 51ddd429d770a..0c79b3b4c81e8 100644
--- a/flang/test/Lower/large-data-threshold.f90
+++ b/flang/test/Integration/large-data-threshold.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! REQUIRES: x86-registered-target
 
 ! RUN: %flang_fc1 -triple x86_64-unknown-unknown -emit-llvm %s -o - -mcmodel=medium | FileCheck %s --check-prefix=IR-DEFAULT
diff --git a/flang/test/Lower/mcmodel.f90 b/flang/test/Integration/mcmodel.f90
similarity index 69%
rename from flang/test/Lower/mcmodel.f90
rename to flang/test/Integration/mcmodel.f90
index 971dc3b9056fe..0743c305adff1 100644
--- a/flang/test/Lower/mcmodel.f90
+++ b/flang/test/Integration/mcmodel.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! REQUIRES:  aarch64-registered-target && x86-registered-target
 
 ! RUN: %flang_fc1 -triple aarch64 -emit-llvm -mcmodel=tiny %s -o - | FileCheck %s -check-prefix=CHECK-TINY
diff --git a/flang/test/Lower/real-descriptors.f90 b/flang/test/Integration/real-descriptors.f90
similarity index 88%
rename from flang/test/Lower/real-descriptors.f90
rename to flang/test/Integration/real-descriptors.f90
index c38d4f198dfb7..39380595a3428 100644
--- a/flang/test/Lower/real-descriptors.f90
+++ b/flang/test/Integration/real-descriptors.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: bbc %s -o - | tco | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
 
 ! CHECK-LABEL: define void {{.*}}test_reals
diff --git a/flang/test/Lower/safe-trampoline.f90 b/flang/test/Integration/safe-trampoline.f90
similarity index 85%
rename from flang/test/Lower/safe-trampoline.f90
rename to flang/test/Integration/safe-trampoline.f90
index ff28df107af82..68c053a6afc07 100644
--- a/flang/test/Lower/safe-trampoline.f90
+++ b/flang/test/Integration/safe-trampoline.f90
@@ -1,3 +1,11 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
 ! RUN: %flang_fc1 -fsafe-trampoline -emit-llvm -o - %s | FileCheck %s
 !
 ! Test that -fsafe-trampoline generates calls to the runtime
diff --git a/flang/test/Integration/tune-cpu-llvm.f90 b/flang/test/Integration/tune-cpu-llvm.f90
new file mode 100644
index 0000000000000..97ed395085dc6
--- /dev/null
+++ b/flang/test/Integration/tune-cpu-llvm.f90
@@ -0,0 +1,16 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
+! RUN: %if x86-registered-target %{ %flang -target x86_64-linux-gnu -mtune=pentium4 -S -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,CHECK-X86 %}
+! RUN: %if aarch64-registered-target %{ %flang -target aarch64-linux-gnu -mtune=neoverse-n1 -S -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,CHECK-ARM %}
+
+!ALL: attributes #{{[0-9]+}} = {
+!CHECK-X86-SAME: "tune-cpu"="pentium4"
+!CHECK-ARM-SAME: "tune-cpu"="neoverse-n1"
+subroutine a
+end subroutine a
diff --git a/flang/test/Lower/MIF/coarray_dealloc_not_alloc.f90 b/flang/test/Lower/MIF/coarray_dealloc_not_alloc.f90
deleted file mode 100644
index 44e31704c0055..0000000000000
--- a/flang/test/Lower/MIF/coarray_dealloc_not_alloc.f90
+++ /dev/null
@@ -1,13 +0,0 @@
-! RUN: %flang_fc1 -emit-llvm -fcoarray %s -o - 2>&1 | FileCheck %s --check-prefix=LLVM
-
-! LLVM: @_QFB1Ekk_coarray_handle = linkonce global %_QM__fortran_builtinsT__builtin_prif_coarray_handle_type zeroinitializer{{.*}}
-
-! LLVM-LABEL:  @_QQmain()
-! LLVM:  call void @_QMprifPprif_deallocate_coarray(ptr @_QFB1Ekk_coarray_handle, ptr null, ptr null, ptr null)
-
-
-block
-integer :: kk
-allocatable :: kk(:)[:]
-endblock
-end
diff --git a/flang/test/Lower/OpenMP/missing-inode.f90 b/flang/test/Lower/OpenMP/missing-inode.f90
deleted file mode 100644
index 01e662557cfe6..0000000000000
--- a/flang/test/Lower/OpenMP/missing-inode.f90
+++ /dev/null
@@ -1,8 +0,0 @@
-! RUN: %flang_fc1 -emit-llvm -fopenmp -fopenmp-version=51 -fopenmp-targets=amdgcn-amd-amdhsa -o - %s | FileCheck %s
-program missing_inode
-#line "/this_path_should_not_exist_on_any_system_out_there/and_if_it_does_it_will_break_the/tes.f90" 700
-    ! CHECK:  define internal void @__omp_offloading_{{[0-9a-f]+}}_{{[0-9a-f]+}}__QQmain_l701
-    !$omp target
-        call some_routine()
-    !$omp end target
-end program missing_inode
\ No newline at end of file
diff --git a/flang/test/Lower/complex-part.f90 b/flang/test/Lower/complex-part.f90
deleted file mode 100644
index 48f58a6fe28db..0000000000000
--- a/flang/test/Lower/complex-part.f90
+++ /dev/null
@@ -1,12 +0,0 @@
-! RUN: bbc %s -o - | tco | FileCheck %s
-! RUN: %flang -emit-llvm -S -mmlir -disable-external-name-interop %s -o - | FileCheck %s
-
-  COMPLEX c
-  c%RE = 3.14
-  CALL sub(c)
-END
-
-! Verify that the offset in the struct does not regress from i32.
-! CHECK-LABEL: define void @_QQmain()
-! CHECK: getelementptr { float, float }, ptr %{{[0-9]+}}, i32 0, i32 0
-
diff --git a/flang/test/Lower/const-arg-glob.f90 b/flang/test/Lower/const-arg-glob.f90
deleted file mode 100644
index 8892e84d5a6eb..0000000000000
--- a/flang/test/Lower/const-arg-glob.f90
+++ /dev/null
@@ -1,13 +0,0 @@
-! RUN: %flang_fc1 -emit-llvm -O2 -mllvm --enable-constant-argument-globalisation %s -o - | FileCheck %s
-
-! CHECK: @_global_const_{{.*}} = internal constant i32 2
-! CHECK: call void @take_int_(ptr nonnull @_global_const_{{.*}})
-
-subroutine test()
-  interface
-  subroutine take_int(n)
-    integer :: n
-  end subroutine
-  end interface
-  call take_int(2)
-end
diff --git a/flang/test/Lower/intrinsic-procedure-wrappers.f90 b/flang/test/Lower/intrinsic-procedure-wrappers.f90
deleted file mode 100644
index 210cfb4134301..0000000000000
--- a/flang/test/Lower/intrinsic-procedure-wrappers.f90
+++ /dev/null
@@ -1,10 +0,0 @@
-! RUN: bbc -outline-intrinsics %s -o - | tco --disable-llvm --mlir-print-ir-after=fir-to-llvm-ir 2>&1 | FileCheck %s
-
-! Test properties of intrinsic function wrappers
-
-! Test that intrinsic wrappers have internal linkage
-function foo(x)
-  foo = acos(x)
-end function
-
-! CHECK: llvm.func internal @fir.acos.contract.f32.f32
diff --git a/flang/test/Lower/tune-cpu-llvm.f90 b/flang/test/Lower/tune-cpu-llvm.f90
deleted file mode 100644
index 6cf7d91ad76b4..0000000000000
--- a/flang/test/Lower/tune-cpu-llvm.f90
+++ /dev/null
@@ -1,8 +0,0 @@
-! RUN: %if x86-registered-target %{ %flang -target x86_64-linux-gnu -mtune=pentium4 -S -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,CHECK-X86 %}
-! RUN: %if aarch64-registered-target %{ %flang -target aarch64-linux-gnu -mtune=neoverse-n1 -S -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,CHECK-ARM %}
-
-!ALL: attributes #{{[0-9]+}} = {
-!CHECK-X86-SAME: "tune-cpu"="pentium4"
-!CHECK-ARM-SAME: "tune-cpu"="neoverse-n1"
-subroutine a
-end subroutine a



More information about the llvm-branch-commits mailing list