24 changes: 12 additions & 12 deletions clang/test/Driver/cuda-phases.cu
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//
// Test CUDA NVPTX phases.
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=sm_30 %s 2>&1 \
// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 %s 2>&1 \
// RUN: | FileCheck -check-prefixes=BIN %s
//
// BIN-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]])
Expand All @@ -34,7 +34,7 @@
// Test single gpu architecture up to the assemble phase.
//
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=sm_30 %s -S 2>&1 \
// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 %s -S 2>&1 \
// RUN: | FileCheck -check-prefixes=ASM %s
// ASM-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH:sm_30]])
// ASM-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
Expand All @@ -50,7 +50,7 @@
// Test two gpu architectures with complete compilation.
//
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s 2>&1 \
// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s 2>&1 \
// RUN: | FileCheck -check-prefixes=BIN2 %s
// BIN2-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]])
// BIN2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
Expand Down Expand Up @@ -79,7 +79,7 @@
// Test two gpu architecturess up to the assemble phase.
//
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s -S 2>&1 \
// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s -S 2>&1 \
// RUN: | FileCheck -check-prefixes=ASM2 %s
// ASM2-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH1:sm_30]])
// ASM2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH1]])
Expand All @@ -101,7 +101,7 @@
// compilation mode.
//
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=sm_30 %s --cuda-host-only 2>&1 \
// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 %s --cuda-host-only 2>&1 \
// RUN: | FileCheck -check-prefixes=HBIN %s
// HBIN-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]])
// HBIN-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
Expand All @@ -115,7 +115,7 @@
// compilation mode.
//
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=sm_30 %s --cuda-host-only -S 2>&1 \
// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 %s --cuda-host-only -S 2>&1 \
// RUN: | FileCheck -check-prefixes=HASM %s
// HASM-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]])
// HASM-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
Expand All @@ -128,7 +128,7 @@
// compilation mode.
//
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-host-only 2>&1 \
// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-host-only 2>&1 \
// RUN: | FileCheck -check-prefixes=HBIN2 %s
// HBIN2-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]])
// HBIN2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
Expand All @@ -143,7 +143,7 @@
// compilation mode.
//
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-host-only -S \
// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-host-only -S \
// RUN: 2>&1 | FileCheck -check-prefixes=HASM2 %s
// HASM2-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]])
// HASM2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
Expand All @@ -156,7 +156,7 @@
// compilation mode.
//
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=sm_30 %s --cuda-device-only 2>&1 \
// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 %s --cuda-device-only 2>&1 \
// RUN: | FileCheck -check-prefixes=DBIN %s
// DBIN-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH:sm_30]])
// DBIN-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
Expand All @@ -170,7 +170,7 @@
// compilation mode.
//
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=sm_30 %s --cuda-device-only -S 2>&1 \
// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 %s --cuda-device-only -S 2>&1 \
// RUN: | FileCheck -check-prefixes=DASM %s
// DASM-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH:sm_30]])
// DASM-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
Expand All @@ -184,7 +184,7 @@
// compilation mode.
//
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-device-only 2>&1 \
// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-device-only 2>&1 \
// RUN: | FileCheck -check-prefixes=DBIN2 %s
// DBIN2-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH:sm_30]])
// DBIN2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
Expand All @@ -204,7 +204,7 @@
// compilation mode.
//
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-device-only -S \
// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-device-only -S \
// RUN: 2>&1 | FileCheck -check-prefixes=DASM2 %s
// DASM2-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH:sm_30]])
// DASM2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
Expand Down
10 changes: 5 additions & 5 deletions clang/test/Driver/hip-binding.hip
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

// RUN: %clang -ccc-print-bindings --target=x86_64-linux-gnu \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
// RUN: -c 2>&1 | FileCheck -check-prefix=NRDCS %s
// RUN: --no-offload-new-driver -c 2>&1 | FileCheck -check-prefix=NRDCS %s
// RUN: %clang -ccc-print-bindings --target=x86_64-linux-gnu --offload-new-driver \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
// RUN: -c 2>&1 | FileCheck -check-prefix=NRDCS %s
// RUN: --no-offload-new-driver -c 2>&1 | FileCheck -check-prefix=NRDCS %s
// NRDCS: # "amdgcn-amd-amdhsa" - "clang", inputs: ["[[IN:.*hip-binding.hip]]"], output: "[[OBJ1:.*o]]"
// NRDCS: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[OBJ1]]"], output: "[[IMG1:.*]]"
// NRDCS: # "amdgcn-amd-amdhsa" - "clang", inputs: ["[[IN:.*hip-binding.hip]]"], output: "[[OBJ2:.*o]]"
Expand All @@ -16,7 +16,7 @@

// RUN: %clang -ccc-print-bindings --target=x86_64-linux-gnu \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
// RUN: -c -fgpu-rdc 2>&1 | FileCheck -check-prefix=RDCS %s
// RUN: --no-offload-new-driver -c -fgpu-rdc 2>&1 | FileCheck -check-prefix=RDCS %s
// RDCS: # "amdgcn-amd-amdhsa" - "clang", inputs: ["[[IN:.*hip-binding.hip]]"], output: "[[BC1:.*bc]]"
// RDCS: # "amdgcn-amd-amdhsa" - "clang", inputs: ["[[IN:.*hip-binding.hip]]"], output: "[[BC2:.*bc]]"
// RDCS: # "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[IN]]"], output: "[[HOSTOBJ:.*o]]"
Expand All @@ -32,7 +32,7 @@

// RUN: touch %t.o
// RUN: %clang --hip-link -ccc-print-bindings --target=x86_64-linux-gnu \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -fgpu-rdc %t.o\
// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -fgpu-rdc %t.o\
// RUN: 2>&1 | FileCheck %s

// CHECK: # "x86_64-unknown-linux-gnu" - "offload bundler", inputs: ["[[IN:.*o]]"], outputs: ["[[HOSTOBJ:.*o]]", "{{.*o}}", "{{.*o}}"]
Expand All @@ -46,7 +46,7 @@
// CHECK: # "x86_64-unknown-linux-gnu" - "GNU::Linker", inputs: ["[[HOSTOBJ]]", "[[FATBINOBJ]]"], output: "a.out"

// RUN: %clang --hip-link -ccc-print-bindings --target=x86_64-linux-gnu \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t.o\
// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t.o\
// RUN: 2>&1 | FileCheck -check-prefix=NORDC %s

// NORDC-NOT: offload bundler
Expand Down
8 changes: 4 additions & 4 deletions clang/test/Driver/hip-cuid-hash.hip
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
// Check CUID generated by hash.
// The same CUID is generated for the same file with the same options.

// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu \
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1

// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu \
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1

Expand All @@ -17,11 +17,11 @@
// Check CUID generated by hash.
// Different CUID's are generated for the same file with different options.

// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -DX=1 \
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -DX=1 --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1

// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -DX=2 \
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -DX=2 --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
// RUN: %S/Inputs/../Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1

Expand Down
5 changes: 5 additions & 0 deletions clang/test/Driver/hip-cuid.hip
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

// RUN: not %clang -### -x hip \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: --no-offload-new-driver \
// RUN: --offload-arch=gfx900 \
// RUN: --offload-arch=gfx906 \
// RUN: -c -nogpuinc -nogpulib -fuse-cuid=invalid \
Expand All @@ -16,6 +17,7 @@

// RUN: %clang -### -x hip \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: --no-offload-new-driver \
// RUN: --offload-arch=gfx900 \
// RUN: --offload-arch=gfx906 \
// RUN: -c -nogpuinc -nogpulib -fuse-cuid=random \
Expand All @@ -27,6 +29,7 @@

// RUN: %clang -### -x hip \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: --no-offload-new-driver \
// RUN: --offload-arch=gfx900 \
// RUN: --offload-arch=gfx906 \
// RUN: -c -nogpuinc -nogpulib -cuid=xyz_123 \
Expand All @@ -38,6 +41,7 @@

// RUN: %clang -### -x hip \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: --no-offload-new-driver \
// RUN: --offload-arch=gfx900 \
// RUN: --offload-arch=gfx906 \
// RUN: -c -nogpuinc -nogpulib -fuse-cuid=random -cuid=xyz_123 \
Expand All @@ -49,6 +53,7 @@

// RUN: %clang -### -x hip \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: --no-offload-new-driver \
// RUN: --offload-arch=gfx900 \
// RUN: --offload-arch=gfx906 \
// RUN: -c -nogpuinc -nogpulib -fuse-cuid=hash \
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/hip-dependent-options.hip
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: not %clang -### --target=x86_64-linux-gnu \
// RUN: not %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -c -fhip-emit-relocatable -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
Expand All @@ -7,7 +7,7 @@

// RELOCRDC: error: option '-fhip-emit-relocatable' cannot be specified with '-fgpu-rdc'

// RUN: not %clang -### --target=x86_64-linux-gnu \
// RUN: not %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -c -fhip-emit-relocatable -nogpuinc -nogpulib \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
Expand Down
22 changes: 11 additions & 11 deletions clang/test/Driver/hip-device-compile.hip
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,55 @@
// Output unbundled bitcode.
// RUN: %clang -c -emit-llvm --cuda-device-only -### --target=x86_64-linux-gnu \
// RUN: --rocm-path=%S/Inputs/rocm -o a.bc -x hip --cuda-gpu-arch=gfx900 --no-gpu-bundle-output \
// RUN: --hip-device-lib=lib1.bc \
// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,BC,NBUN %s

// Output bundled bitcode.
// RUN: %clang -c -emit-llvm --cuda-device-only -### --target=x86_64-linux-gnu \
// RUN: --rocm-path=%S/Inputs/rocm -o a.bc -x hip --cuda-gpu-arch=gfx900 --no-gpu-bundle-output \
// RUN: --hip-device-lib=lib1.bc \
// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu --gpu-bundle-output \
// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,BCBUN %s

// Output unbundled LLVM IR.
// RUN: %clang -c -S -emit-llvm --cuda-device-only -### --target=x86_64-linux-gnu \
// RUN: --rocm-path=%S/Inputs/rocm -o a.ll -x hip --cuda-gpu-arch=gfx900 --no-gpu-bundle-output \
// RUN: --hip-device-lib=lib1.bc \
// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,LL,NBUN %s

// Output bundled LLVM IR.
// RUN: %clang -c -S -emit-llvm --cuda-device-only -### --target=x86_64-linux-gnu \
// RUN: --rocm-path=%S/Inputs/rocm -o a.ll -x hip --cuda-gpu-arch=gfx900 --no-gpu-bundle-output \
// RUN: --hip-device-lib=lib1.bc \
// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu --gpu-bundle-output \
// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,LLBUN %s

// Output unbundled assembly.
// RUN: %clang -c -S --cuda-device-only -### --target=x86_64-linux-gnu \
// RUN: --rocm-path=%S/Inputs/rocm -o a.s -x hip --cuda-gpu-arch=gfx900 --no-gpu-bundle-output \
// RUN: --hip-device-lib=lib1.bc \
// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,ASM,NBUN %s

// Output relocatable.
// RUN: %clang -c --cuda-device-only -### --target=x86_64-linux-gnu \
// RUN: --rocm-path=%S/Inputs/rocm -o a.o -x hip --cuda-gpu-arch=gfx900 -fhip-emit-relocatable \
// RUN: --hip-device-lib=lib1.bc \
// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,NBUN,RELOC %s

// Output bundled assembly.
// RUN: %clang -c -S --cuda-device-only -### --target=x86_64-linux-gnu \
// RUN: --rocm-path=%S/Inputs/rocm -o a.s -x hip --cuda-gpu-arch=gfx900 --no-gpu-bundle-output \
// RUN: --hip-device-lib=lib1.bc \
// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu --gpu-bundle-output \
// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,ASMBUN %s
Expand Down Expand Up @@ -96,31 +96,31 @@
// Output bundled code objects.
// RUN: %clang -c --cuda-device-only -### --target=x86_64-linux-gnu \
// RUN: --rocm-path=%S/Inputs/rocm -o a.o -x hip --cuda-gpu-arch=gfx900 \
// RUN: --hip-device-lib=lib1.bc \
// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: 2>&1 | FileCheck -check-prefixes=OBJ,OBJ-BUN %s

// Output unbundled code objects.
// RUN: %clang -c --cuda-device-only -### --target=x86_64-linux-gnu \
// RUN: --rocm-path=%S/Inputs/rocm -o a.o -x hip --cuda-gpu-arch=gfx900 \
// RUN: --hip-device-lib=lib1.bc \
// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu --no-gpu-bundle-output \
// RUN: 2>&1 | FileCheck -check-prefixes=OBJ,OBJ-UBUN %s

// Output bundled code objects.
// RUN: %clang --cuda-device-only -### --target=x86_64-linux-gnu \
// RUN: --rocm-path=%S/Inputs/rocm -o a.o -x hip --cuda-gpu-arch=gfx900 \
// RUN: --hip-device-lib=lib1.bc \
// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: 2>&1 | FileCheck -check-prefixes=OBJ,OBJ-BUN %s

// Output unbundled code objects.
// RUN: %clang --cuda-device-only -### --target=x86_64-linux-gnu \
// RUN: --rocm-path=%S/Inputs/rocm -o a.o -x hip --cuda-gpu-arch=gfx900 \
// RUN: --hip-device-lib=lib1.bc \
// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu --no-gpu-bundle-output \
// RUN: 2>&1 | FileCheck -check-prefixes=OBJ,OBJ-UBUN %s
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/hip-link-bc-to-bc.hip
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// RUN: %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx906 --hip-link \
// RUN: -nogpulib -nogpuinc -emit-llvm -fgpu-rdc --cuda-device-only \
// RUN: %t/bundle1.bc %t/bundle2.bc \
// RUN: --no-offload-new-driver %t/bundle1.bc %t/bundle2.bc \
// RUN: 2>&1 | FileCheck -check-prefix=BITCODE %s

// BITCODE: "{{.*}}clang-offload-bundler" "-type=bc" "-targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-gfx906" "-input={{.*}}bundle1.bc" "-output=[[B1HOST:.*\.bc]]" "-output=[[B1DEV1:.*\.bc]]" "-unbundle" "-allow-missing-bundles"
Expand All @@ -24,7 +24,7 @@

// RUN: %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx906 --hip-link \
// RUN: -nogpulib -nogpuinc -emit-llvm -fgpu-rdc --cuda-device-only \
// RUN: %t/bundle.bc -L%t -lhipbundle \
// RUN: --no-offload-new-driver %t/bundle.bc -L%t -lhipbundle \
// RUN: 2>&1 | FileCheck -check-prefix=ARCHIVE %s

// ARCHIVE: "{{.*}}clang-offload-bundler" "-type=bc" "-targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-gfx906" "-input={{.*}}bundle.bc" "-output=[[HOST:.*\.bc]]" "-output=[[DEV1:.*\.bc]]" "-unbundle" "-allow-missing-bundles"
Expand Down
22 changes: 11 additions & 11 deletions clang/test/Driver/hip-link-bundle-archive.hip
Original file line number Diff line number Diff line change
Expand Up @@ -9,64 +9,64 @@
// RUN: touch %t/dummy.bc
// RUN: llvm-ar cr %t/libhipBundled.a %t/dummy.bc
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lhipBundled \
// RUN: 2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-L %s

// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 -nogpuinc \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:libhipBundled.a \
// RUN: 2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-LA %s

// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc %t/libhipBundled.a \
// RUN: 2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-A %s

// RUN: llvm-ar cr %t/libhipBundled.a.5.2 %t/dummy.bc
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc %t/libhipBundled.a.5.2 \
// RUN: 2>&1 | FileCheck -check-prefixes=GNU,GNU2,GNU-A %s

// Check if a file is not an archive, it is not unbundled.

// RUN: touch %t/libNonArchive.a
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lNonArchive \
// RUN: 2>&1 | FileCheck -check-prefixes=NONARCHIVE %s
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:libNonArchive.a \
// RUN: 2>&1 | FileCheck -check-prefixes=NONARCHIVE %s
// RUN: not %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t libNonArchive.a \
// RUN: 2>&1 | FileCheck -check-prefixes=NONARCHIVE %s

// Check if a file does not exist, it is not unbundled.

// RUN: not %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc %t/NoneExist.a \
// RUN: 2>&1 | FileCheck -check-prefixes=NONE %s

// Check unbundling archive for MSVC.

// RUN: llvm-ar cr %t/hipBundled2.lib %t/dummy.bc
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --target=x86_64-pc-windows-msvc -fuse-ld= \
// RUN: --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lhipBundled2 \
// RUN: 2>&1 | FileCheck -check-prefix=MSVC %s

// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --target=x86_64-pc-windows-msvc -fuse-ld= \
// RUN: --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:hipBundled2.lib \
// RUN: 2>&1 | FileCheck -check-prefix=MSVC %s

// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --target=x86_64-pc-windows-msvc -fuse-ld= \
// RUN: --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc %t/hipBundled2.lib \
// RUN: 2>&1 | FileCheck -check-prefix=MSVC %s

Expand Down
8 changes: 4 additions & 4 deletions clang/test/Driver/hip-link-save-temps.hip
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
// RUN: touch %t/obj2.o
// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
// RUN: --hip-link -o executable -fgpu-rdc --cuda-gpu-arch=gfx900 \
// RUN: --offload-arch=gfx906 %t/obj1.o %t/obj2.o 2>&1 | \
// RUN: --no-offload-new-driver --offload-arch=gfx906 %t/obj1.o %t/obj2.o 2>&1 | \
// RUN: FileCheck -check-prefixes=CHECK,OUT %s

// -fgpu-rdc link without output
// RUN: touch %t/obj1.o
// RUN: touch %t/obj2.o
// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
// RUN: --hip-link -fgpu-rdc --cuda-gpu-arch=gfx900 \
// RUN: --no-offload-new-driver --hip-link -fgpu-rdc --cuda-gpu-arch=gfx900 \
// RUN: --offload-arch=gfx906 %t/obj1.o %t/obj2.o 2>&1 | \
// RUN: FileCheck -check-prefixes=CHECK,NOUT %s

Expand All @@ -23,7 +23,7 @@
// RUN: touch %t/obj2.o
// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
// RUN: --hip-link -o libTest.a -fgpu-rdc --cuda-gpu-arch=gfx900 \
// RUN: --emit-static-lib \
// RUN: --no-offload-new-driver --emit-static-lib \
// RUN: --offload-arch=gfx906 %t/obj1.o %t/obj2.o 2>&1 | \
// RUN: FileCheck -check-prefixes=CHECK,SLO %s

Expand All @@ -32,7 +32,7 @@
// RUN: touch %t/obj2.o
// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
// RUN: --hip-link -fgpu-rdc --cuda-gpu-arch=gfx900 \
// RUN: --emit-static-lib \
// RUN: --no-offload-new-driver --emit-static-lib \
// RUN: --offload-arch=gfx906 %t/obj1.o %t/obj2.o 2>&1 | \
// RUN: FileCheck -check-prefixes=CHECK,SLNO %s

Expand Down
3 changes: 1 addition & 2 deletions clang/test/Driver/hip-link-shared-library.hip
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: touch %t.o
// RUN: %clang --hip-link -ccc-print-bindings --target=x86_64-linux-gnu \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t.o %S/Inputs/in.so \
// RUN: -fgpu-rdc 2>&1 | FileCheck %s
// RUN: --no-offload-new-driver -fgpu-rdc 2>&1 | FileCheck %s

// CHECK: # "x86_64-unknown-linux-gnu" - "offload bundler", inputs: ["[[IN:.*o]]"], outputs: ["[[HOSTOBJ:.*o]]", "{{.*o}}", "{{.*o}}"]
// CHECK: # "amdgcn-amd-amdhsa" - "offload bundler", inputs: ["[[IN]]"], outputs: ["{{.*o}}", "[[DOBJ1:.*o]]", "[[DOBJ2:.*o]]"]
Expand All @@ -12,4 +12,3 @@
// CHECK: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[IMG1]]", "[[IMG2]]"], output: "[[FATBINOBJ:.*o]]"
// CHECK-NOT: offload bundler
// CHECK: # "x86_64-unknown-linux-gnu" - "GNU::Linker", inputs: ["[[HOSTOBJ]]", "{{.*}}/Inputs/in.so", "[[FATBINOBJ]]"], output: "a.out"

6 changes: 3 additions & 3 deletions clang/test/Driver/hip-link-static-library.hip
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// RUN: touch %t.o
// RUN: %clang --hip-link -ccc-print-bindings --target=x86_64-linux-gnu \
// RUN: --emit-static-lib \
// RUN: --no-offload-new-driver --emit-static-lib \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -fgpu-rdc %t.o\
// RUN: 2>&1 | FileCheck %s

Expand All @@ -18,15 +18,15 @@
// CHECK: # "x86_64-unknown-linux-gnu" - "GNU::StaticLibTool", inputs: ["[[HOSTOBJ]]", "[[FATBINOBJ]]"], output: "a.out"

// RUN: %clang --hip-link -ccc-print-bindings --target=x86_64-linux-gnu \
// RUN: --emit-static-lib \
// RUN: --no-offload-new-driver --emit-static-lib \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t.o\
// RUN: 2>&1 | FileCheck -check-prefix=NORDC %s

// NORDC-NOT: offload bundler
// NORDC: # "x86_64-unknown-linux-gnu" - "GNU::StaticLibTool", inputs: ["{{.*o}}"], output: "a.out"

// RUN: %clang --hip-link -### --target=x86_64-linux-gnu \
// RUN: --emit-static-lib -lgcc \
// RUN: --no-offload-new-driver --emit-static-lib -lgcc \
// RUN: -Wl,--enable-new-dtags -Wl,--rpath=/opt \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -fgpu-rdc %t.o\
// RUN: 2>&1 | FileCheck -check-prefix=NOFLAG %s
Expand Down
6 changes: 3 additions & 3 deletions clang/test/Driver/hip-offload-compress-zlib.hip
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// RUN: rm -rf %t.bc
// RUN: %clang -c -v --target=x86_64-linux-gnu \
// RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \
// RUN: -fgpu-rdc -nogpuinc -nogpulib \
// RUN: --no-offload-new-driver -fgpu-rdc -nogpuinc -nogpulib \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: --offload-compress --offload-device-only --gpu-bundle-output \
// RUN: -o %t.bc \
Expand All @@ -22,7 +22,7 @@

// RUN: %clang --hip-link -### -v --target=x86_64-linux-gnu \
// RUN: --offload-arch=gfx1100 --offload-arch=gfx1101 \
// RUN: -fgpu-rdc -nogpulib \
// RUN: --no-offload-new-driver -fgpu-rdc -nogpulib \
// RUN: %t.bc --offload-device-only \
// RUN: 2>&1 | FileCheck -check-prefix=UNBUNDLE %s

Expand All @@ -35,7 +35,7 @@

// RUN: %clang -c -### -v --target=x86_64-linux-gnu \
// RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \
// RUN: -nogpuinc -nogpulib \
// RUN: --no-offload-new-driver -nogpuinc -nogpulib \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: --offload-compress \
// RUN: 2>&1 | FileCheck -check-prefix=CO %s
Expand Down
6 changes: 3 additions & 3 deletions clang/test/Driver/hip-offload-compress-zstd.hip
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// RUN: rm -rf %t.bc
// RUN: %clang -c -v --target=x86_64-linux-gnu \
// RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \
// RUN: -fgpu-rdc -nogpuinc -nogpulib \
// RUN: --no-offload-new-driver -fgpu-rdc -nogpuinc -nogpulib \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: --offload-compress --offload-device-only --gpu-bundle-output \
// RUN: -o %t.bc \
Expand All @@ -22,7 +22,7 @@

// RUN: %clang --hip-link -### -v --target=x86_64-linux-gnu \
// RUN: --offload-arch=gfx1100 --offload-arch=gfx1101 \
// RUN: -fgpu-rdc -nogpulib \
// RUN: --no-offload-new-driver -fgpu-rdc -nogpulib \
// RUN: %t.bc --offload-device-only \
// RUN: 2>&1 | FileCheck -check-prefix=UNBUNDLE %s

Expand All @@ -35,7 +35,7 @@

// RUN: %clang -c -### -v --target=x86_64-linux-gnu \
// RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \
// RUN: -nogpuinc -nogpulib \
// RUN: --no-offload-new-driver -nogpuinc -nogpulib \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: --offload-compress \
// RUN: 2>&1 | FileCheck -check-prefix=CO %s
Expand Down
26 changes: 13 additions & 13 deletions clang/test/Driver/hip-output-file-name.hip
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// REQUIRES: amdgpu-registered-target

// Output bundled code objects for combined compilation.
// RUN: %clang -### -c --target=x86_64-linux-gnu -fgpu-rdc \
// RUN: %clang -### -c --target=x86_64-linux-gnu -fgpu-rdc --no-offload-new-driver \
// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
// RUN: 2>&1 | FileCheck %s

Expand All @@ -13,42 +13,42 @@
// is used to bundle the final output.

// Output bundled PPE for one GPU for mixed compliation.
// RUN: %clang -### -E --target=x86_64-linux-gnu \
// RUN: %clang -### -E --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 %s \
// RUN: 2>&1 | FileCheck -check-prefixes=DASH %s

// Output unbundled PPE for one GPU for device only compilation.
// RUN: %clang -### -E --offload-device-only --target=x86_64-linux-gnu \
// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 %s \
// RUN: --no-offload-new-driver -nogpulib -nogpuinc --offload-arch=gfx803 %s \
// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s

// Output bundled PPE for two GPUs for mixed compilation.
// RUN: %clang -### -E --target=x86_64-linux-gnu \
// RUN: %clang -### -E --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
// RUN: 2>&1 | FileCheck -check-prefixes=DASH %s

// Output bundled PPE for two GPUs for mixed compilation with -save-temps.
// RUN: %clang -### -E -save-temps --target=x86_64-linux-gnu \
// RUN: %clang -### -E -save-temps --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
// RUN: 2>&1 | FileCheck -check-prefixes=DASH %s

// Output unbundled PPE for two GPUs for device only compilation.
// RUN: %clang -### -E --offload-device-only --target=x86_64-linux-gnu \
// RUN: %clang -### -E --offload-device-only --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s

// Output bundled PPE for two GPUs for device only compilation with --gpu-bundle-output.
// RUN: %clang -### -E --offload-device-only --target=x86_64-linux-gnu \
// RUN: %clang -### -E --offload-device-only --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s --gpu-bundle-output \
// RUN: 2>&1 | FileCheck -check-prefixes=DASH %s

// Output unbundled PPE for two GPUs for device only compilation with --no-gpu-bundle-output.
// RUN: %clang -### -E --offload-device-only --target=x86_64-linux-gnu \
// RUN: %clang -### -E --offload-device-only --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s --no-gpu-bundle-output \
// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s

// Output unbundled PPE for host only compilation.
// RUN: %clang -### -E --offload-host-only --target=x86_64-linux-gnu \
// RUN: %clang -### -E --offload-host-only --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s

Expand All @@ -60,22 +60,22 @@
// Check -E with -o.

// Output bundled PPE for two GPUs for mixed compilation.
// RUN: %clang -### -E -o test.cui --target=x86_64-linux-gnu \
// RUN: %clang -### -E -o test.cui --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
// RUN: 2>&1 | FileCheck -check-prefixes=OUT %s

// Output bundled PPE for two GPUs for mixed compilation.
// RUN: %clang -### -E -o test.cui -save-temps --target=x86_64-linux-gnu \
// RUN: %clang -### -E -o test.cui -save-temps --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
// RUN: 2>&1 | FileCheck -check-prefixes=OUT %s

// Output bundled PPE for two GPUs for device only compilation with --gpu-bundle-output.
// RUN: %clang -### -E -o test.cui --offload-device-only --target=x86_64-linux-gnu \
// RUN: %clang -### -E -o test.cui --offload-device-only --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 --gpu-bundle-output %s \
// RUN: 2>&1 | FileCheck -check-prefixes=OUT %s

// Output unbundled PPE for two GPUs for device only compilation.
// RUN: %clang -### -E -o test.cui --offload-host-only --target=x86_64-linux-gnu \
// RUN: %clang -### -E -o test.cui --offload-host-only --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-OUT %s

Expand Down
14 changes: 7 additions & 7 deletions clang/test/Driver/hip-partial-link.hip
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// REQUIRES: x86-registered-target, amdgpu-registered-target, lld, system-linux

// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu \
// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc \
// RUN: -nogpulib -fgpu-rdc -I%S/Inputs %s -o %t.1.o

// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -DLIB \
// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -DLIB --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc \
// RUN: -nogpulib -fgpu-rdc -I%S/Inputs %s -o %t.2.o

// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -DMAIN \
// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -DMAIN --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc \
// RUN: -nogpulib -fgpu-rdc -I%S/Inputs %s -o %t.main.o

Expand All @@ -24,7 +24,7 @@

// Link %t.1.o and %t.2.o by -r and then link with %t.main.o

// RUN: %clang -v --target=x86_64-unknown-linux-gnu \
// RUN: %clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
// RUN: --hip-link -fgpu-rdc --offload-arch=gfx906 \
// RUN: -r -fuse-ld=lld -nostdlib %t.1.o %t.2.o -o %t.lib.o \
// RUN: 2>&1 | FileCheck -check-prefix=LD-R %s
Expand All @@ -46,15 +46,15 @@
// OBJ: D __hip_gpubin_handle_[[ID1]]
// OBJ: D __hip_gpubin_handle_[[ID2]]

// RUN: %clang -v --target=x86_64-unknown-linux-gnu \
// RUN: %clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
// RUN: --hip-link -no-hip-rt -fgpu-rdc --offload-arch=gfx906 \
// RUN: -fuse-ld=lld -nostdlib -r %t.main.o %t.lib.o -o %t.final.o \
// RUN: 2>&1 | FileCheck -check-prefix=LINK-O %s
// LINK-O-NOT: Found undefined HIP {{.*}}symbol

// Generate a static lib with %t.1.o and %t.2.o then link with %t.main.o

// RUN: %clang -v --target=x86_64-unknown-linux-gnu \
// RUN: %clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
// RUN: --hip-link -fgpu-rdc --offload-arch=gfx906 \
// RUN: --emit-static-lib -fuse-ld=lld -nostdlib %t.1.o %t.2.o -o %t.a \
// RUN: 2>&1 | FileCheck -check-prefix=STATIC %s
Expand All @@ -68,7 +68,7 @@
// STATIC: "{{.*}}/llvm-mc" -triple x86_64-unknown-linux-gnu
// STATIC: "{{.*}}/llvm-ar"

// RUN: %clang -v --target=x86_64-unknown-linux-gnu \
// RUN: %clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
// RUN: --hip-link -no-hip-rt -fgpu-rdc --offload-arch=gfx906 \
// RUN: -fuse-ld=lld -nostdlib -r %t.main.o %t.a -o %t.final.o \
// RUN: 2>&1 | FileCheck -check-prefix=LINK-A %s
Expand Down
106 changes: 53 additions & 53 deletions clang/test/Driver/hip-phases.hip

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions clang/test/Driver/hip-rdc-device-only.hip
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// REQUIRES: x86-registered-target
// REQUIRES: amdgpu-registered-target

// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -c -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
Expand All @@ -11,7 +11,7 @@
// With `-emit-llvm`, the output should be the same as the aforementioned line
// as `-fgpu-rdc` in HIP implies `-emit-llvm`.

// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -c -emit-llvm -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
Expand All @@ -21,14 +21,14 @@
// With `-fno-hip-emit-relocatable`, the output should be the same as the aforementioned line
// as `-fgpu-rdc` in HIP implies `-fno-hip-emit-relocatable`.

// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -c -fno-hip-emit-relocatable -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: %S/Inputs/hip_multiple_inputs/b.hip --gpu-bundle-output \
// RUN: 2>&1 | FileCheck -check-prefixes=COMMON,EMITBC %s

// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -S -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
Expand All @@ -38,7 +38,7 @@
// With `-emit-llvm`, the output should be the same as the aforementioned line
// as `-fgpu-rdc` in HIP implies `-emit-llvm`.

// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -S -emit-llvm -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
Expand All @@ -49,7 +49,7 @@
// output, there should 3 steps (preprocessor, compile, and backend) per source
// and per target, totally 12 steps.

// RUN: %clang -### -save-temps --target=x86_64-linux-gnu \
// RUN: %clang -### -save-temps --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -S -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
Expand All @@ -58,7 +58,7 @@

// Check output one file without bundling cause error.

// RUN: not %clang -### --target=x86_64-linux-gnu \
// RUN: not %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -S -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu -o %t.s --no-gpu-bundle-output \
Expand Down
10 changes: 5 additions & 5 deletions clang/test/Driver/hip-target-id.hip
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
// RUN: -x hip \
// RUN: --offload-arch=gfx908:xnack+:sramecc+ \
// RUN: --offload-arch=gfx908:xnack+:sramecc- \
// RUN: --rocm-path=%S/Inputs/rocm \
// RUN: --no-offload-new-driver --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck %s

// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: -x hip \
// RUN: --offload-arch=gfx908:xnack+:sramecc+ \
// RUN: --offload-arch=gfx908:xnack+:sramecc- \
// RUN: --rocm-path=%S/Inputs/rocm \
// RUN: -save-temps \
// RUN: --no-offload-new-driver -save-temps \
// RUN: %s 2>&1 | FileCheck --check-prefixes=CHECK,TMP %s

// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: -x hip \
// RUN: --offload-arch=gfx908:xnack+:sramecc+ \
// RUN: --offload-arch=gfx908:xnack+:sramecc- \
// RUN: --rocm-path=%S/Inputs/rocm \
// RUN: -fgpu-rdc \
// RUN: --no-offload-new-driver -fgpu-rdc \
// RUN: %s 2>&1 | FileCheck --check-prefixes=CHECK %s

// CHECK: [[CLANG:"[^"]*clang[^"]*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
Expand Down Expand Up @@ -55,7 +55,7 @@
// RUN: --offload-arch=fiji \
// RUN: --offload-arch=gfx803 \
// RUN: --offload-arch=fiji \
// RUN: --rocm-path=%S/Inputs/rocm \
// RUN: --no-offload-new-driver --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck -check-prefix=FIJI %s
// FIJI: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx803"

Expand All @@ -66,6 +66,6 @@
// RUN: --offload-arch=gfx908:sramecc+ \
// RUN: --offload-arch=gfx908:sramecc- \
// RUN: --offload-arch=gfx906 \
// RUN: --rocm-path=%S/Inputs/rocm \
// RUN: --no-offload-new-driver --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck -check-prefix=MULTI %s
// MULTI: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx900:xnack+,hipv4-amdgcn-amd-amdhsa--gfx900:xnack-,hipv4-amdgcn-amd-amdhsa--gfx906,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc+,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc-"
24 changes: 12 additions & 12 deletions clang/test/Driver/hip-toolchain-features.hip
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// REQUIRES: x86-registered-target
// REQUIRES: amdgpu-registered-target

// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib --no-offload-new-driver \
// RUN: -nogpuinc --offload-arch=gfx906:xnack+ --offload-arch=gfx900:xnack+ %s \
// RUN: 2>&1 | FileCheck %s -check-prefix=XNACK
// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib --no-offload-new-driver \
// RUN: -nogpuinc --offload-arch=gfx906:xnack- --offload-arch=gfx900:xnack- %s \
// RUN: 2>&1 | FileCheck %s -check-prefix=NOXNACK

Expand All @@ -14,10 +14,10 @@
// NOXNACK: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-xnack"

// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: -nogpuinc --offload-arch=gfx908:sramecc+ %s \
// RUN: -nogpuinc --offload-arch=gfx908:sramecc+ --no-offload-new-driver %s \
// RUN: 2>&1 | FileCheck %s -check-prefix=SRAM
// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: -nogpuinc --offload-arch=gfx908:sramecc- %s \
// RUN: -nogpuinc --offload-arch=gfx908:sramecc- --no-offload-new-driver %s \
// RUN: 2>&1 | FileCheck %s -check-prefix=NOSRAM

// SRAM: {{.*}}clang{{.*}}"-target-feature" "+sramecc"
Expand All @@ -26,10 +26,10 @@
// NOTSRAM: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-sramecc"

// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: -nogpuinc --offload-arch=gfx1010 %s \
// RUN: -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
// RUN: -mcumode 2>&1 | FileCheck %s -check-prefix=CUMODE
// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: -nogpuinc --offload-arch=gfx1010 %s \
// RUN: -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
// RUN: -mno-cumode 2>&1 | FileCheck %s -check-prefix=NOTCUMODE

// CUMODE: {{.*}}clang{{.*}}"-target-feature" "+cumode"
Expand All @@ -38,20 +38,20 @@
// NOTCUMODE: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-cumode"

// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: -nogpuinc --offload-arch=gfx908:xnack+:sramecc+ %s \
// RUN: -nogpuinc --offload-arch=gfx908:xnack+:sramecc+ --no-offload-new-driver %s \
// RUN: 2>&1 | FileCheck %s -check-prefix=ALL3
// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: -nogpuinc --offload-arch=gfx908:xnack-:sramecc- %s \
// RUN: -nogpuinc --offload-arch=gfx908:xnack-:sramecc- --no-offload-new-driver %s \
// RUN: 2>&1 | FileCheck %s -check-prefix=NOALL3

// ALL3: {{.*}}clang{{.*}}"-target-feature" "+sramecc" "-target-feature" "+xnack"
// NOALL3: {{.*}}clang{{.*}}"-target-feature" "-sramecc" "-target-feature" "-xnack"

// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: -nogpuinc --offload-arch=gfx1010 %s \
// RUN: -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
// RUN: -mtgsplit 2>&1 | FileCheck %s -check-prefix=TGSPLIT
// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: -nogpuinc --offload-arch=gfx1010 %s \
// RUN: -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
// RUN: -mno-tgsplit 2>&1 | FileCheck %s -check-prefix=NOTTGSPLIT

// TGSPLIT: {{.*}}clang{{.*}}"-target-feature" "+tgsplit"
Expand All @@ -60,7 +60,7 @@
// NOTTGSPLIT: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-tgsplit"

// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: -nogpuinc --offload-arch=gfx1010 %s \
// RUN: -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
// RUN: -mcumode -mcumode -mno-cumode -mwavefrontsize64 -mcumode \
// RUN: -mwavefrontsize64 -mno-wavefrontsize64 2>&1 \
// RUN: | FileCheck %s -check-prefix=DUP
Expand All @@ -71,7 +71,7 @@
// DUP: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+cumode"

// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: -nogpuinc --offload-arch=gfx1010 %s \
// RUN: -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
// RUN: -mno-wavefrontsize64 -mwavefrontsize64 2>&1 \
// RUN: | FileCheck %s -check-prefix=WAVE64
// WAVE64: {{.*}}clang{{.*}} "-target-feature" "+wavefrontsize64"
Expand Down
8 changes: 4 additions & 4 deletions clang/test/Driver/hip-toolchain-rdc-separate.hip
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
// RUN: --no-offload-new-driver -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
// RUN: 2>&1 | FileCheck %s
Expand Down Expand Up @@ -84,19 +84,19 @@

// RUN: touch %t/a.o %t/b.o
// RUN: %clang --hip-link -### --target=x86_64-linux-gnu \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
// RUN: %t/a.o %t/b.o \
// RUN: 2>&1 | FileCheck -check-prefixes=LINK,LINK-HOST-UNBUNDLE,LLD-TMP,LINK-BUNDLE,LINK-EMBED %s

// RUN: %clang --hip-link -### --target=x86_64-linux-gnu \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
// RUN: %t/a.o %t/b.o --cuda-device-only \
// RUN: 2>&1 | FileCheck -check-prefixes=LINK,LLD-TMP,LINK-BUNDLE,LINK-NOEMBED %s

// RUN: %clang --hip-link -### --target=x86_64-linux-gnu \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
// RUN: %t/a.o %t/b.o --cuda-device-only --no-gpu-bundle-output \
// RUN: 2>&1 | FileCheck -check-prefixes=LINK,LLD-FIN,LINK-NOBUNDLE,LINK-NOEMBED %s
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/hip-toolchain-rdc-static-lib.hip
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: --emit-static-lib -nogpulib \
// RUN: --no-offload-new-driver --emit-static-lib -nogpulib \
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/hip-toolchain-rdc.hip
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
// RUN: -fhip-dump-offload-linker-script \
// RUN: --no-offload-new-driver -fhip-dump-offload-linker-script \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,LNX %s
Expand All @@ -18,7 +18,7 @@
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
// RUN: -fhip-dump-offload-linker-script \
// RUN: --no-offload-new-driver -fhip-dump-offload-linker-script \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,MSVC %s
Expand Down
6 changes: 3 additions & 3 deletions clang/test/Driver/hip-unbundle-preproc.hipi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// REQUIRES: amdgpu-registered-target

// RUN: %clang -### --target=x86_64-unknown-linux-gnu \
// RUN: --offload-arch=gfx803 -nogpulib \
// RUN: --no-offload-new-driver --offload-arch=gfx803 -nogpulib \
// RUN: -x hip-cpp-output %s 2>&1 | FileCheck %s

// RUN: %clang -### --target=x86_64-unknown-linux-gnu \
// RUN: --offload-arch=gfx803 -nogpulib \
// RUN: --no-offload-new-driver --offload-arch=gfx803 -nogpulib \
// RUN: %s 2>&1 | FileCheck %s

// CHECK: {{".*clang-offload-bundler.*"}} {{.*}}"-output=[[HOST_PP:.*hipi]]" "-output=[[DEV_PP:.*hipi]]" "-unbundle"
Expand All @@ -16,7 +16,7 @@
// CHECK: {{".*ld.*"}} {{.*}}"[[HOST_O]]"

// RUN: %clang -### --target=x86_64-unknown-linux-gnu \
// RUN: --offload-arch=gfx803 -nogpulib -fgpu-rdc \
// RUN: --no-offload-new-driver --offload-arch=gfx803 -nogpulib -fgpu-rdc \
// RUN: %s 2>&1 | FileCheck -check-prefix=RDC %s

// RDC: {{".*clang-offload-bundler.*"}} {{.*}}"-output=[[HOST_PP:.*hipi]]" "-output=[[DEV_PP:.*hipi]]" "-unbundle"
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/hipspv-toolchain-rdc.hip
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// UNSUPPORTED: system-windows

// RUN: %clang -### -x hip -target x86_64-linux-gnu --offload=spirv64 \
// RUN: -fgpu-rdc --hip-path=%S/Inputs/hipspv -nohipwrapperinc \
// RUN: --no-offload-new-driver -fgpu-rdc --hip-path=%S/Inputs/hipspv -nohipwrapperinc \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
// RUN: 2>&1 | FileCheck %s
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/hipspv-toolchain.hip
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// UNSUPPORTED: system-windows

// RUN: %clang -### -target x86_64-linux-gnu --offload=spirv64 \
// RUN: --hip-path=%S/Inputs/hipspv -nohipwrapperinc %s \
// RUN: --no-offload-new-driver --hip-path=%S/Inputs/hipspv -nohipwrapperinc %s \
// RUN: 2>&1 | FileCheck %s

// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "spirv64"
Expand Down
22 changes: 11 additions & 11 deletions clang/test/Driver/lto.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// REQUIRES: nvptx-registered-target

// -flto causes a switch to llvm-bc object files.
// RUN: %clangxx --target=x86_64-unknown-linux-gnu -nocudainc -nocudalib -ccc-print-phases -c %s -flto 2> %t
// RUN: %clangxx --target=x86_64-unknown-linux-gnu --no-offload-new-driver -nocudainc -nocudalib -ccc-print-phases -c %s -flto 2> %t
// RUN: FileCheck -check-prefix=CHECK-COMPILE-ACTIONS < %t %s
//
// CHECK-COMPILE-ACTIONS: 2: compiler, {1}, ir, (host-cuda)
// CHECK-COMPILE-ACTIONS-NOT: lto-bc
// CHECK-COMPILE-ACTIONS: 12: backend, {11}, lto-bc, (host-cuda)

// RUN: %clangxx --target=x86_64-unknown-linux-gnu -nocudainc -nocudalib -ccc-print-phases %s -flto 2> %t
// RUN: %clangxx --target=x86_64-unknown-linux-gnu --no-offload-new-driver -nocudainc -nocudalib -ccc-print-phases %s -flto 2> %t
// RUN: FileCheck -check-prefix=CHECK-COMPILELINK-ACTIONS < %t %s
//
// CHECK-COMPILELINK-ACTIONS: 0: input, "{{.*}}lto.cu", cuda, (host-cuda)
Expand All @@ -29,44 +29,44 @@

// llvm-bc and llvm-ll outputs need to match regular suffixes
// (unfortunately).
// RUN: %clangxx %s --target=x86_64-unknown-linux-gnu -nocudainc -nocudalib -flto -save-temps --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda -### 2> %t
// RUN: %clangxx %s --target=x86_64-unknown-linux-gnu --no-offload-new-driver -nocudainc -nocudalib -flto -save-temps --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda -### 2> %t
// RUN: FileCheck -check-prefix=CHECK-COMPILELINK-SUFFIXES < %t %s
//
// CHECK-COMPILELINK-SUFFIXES: "-o" "[[CPP:.*lto-host.*\.cui]]" "-x" "cuda" "{{.*}}lto.cu"
// CHECK-COMPILELINK-SUFFIXES: "-o" "[[BC:.*lto-host.*\.bc]]" {{.*}}[[CPP]]"
// CHECK-COMPILELINK-SUFFIXES: "-o" "[[OBJ:.*lto-host.*\.o]]" {{.*}}[[BC]]"
// CHECK-COMPILELINK-SUFFIXES: "{{.*}}a.{{(out|exe)}}" {{.*}}[[OBJ]]"

// RUN: %clangxx --target=x86_64-unknown-linux-gnu %s -nocudainc -nocudalib -flto -S -### 2> %t
// RUN: %clangxx --target=x86_64-unknown-linux-gnu %s --no-offload-new-driver -nocudainc -nocudalib -flto -S -### 2> %t
// RUN: FileCheck -check-prefix=CHECK-COMPILE-SUFFIXES < %t %s
//
// CHECK-COMPILE-SUFFIXES: "-o" "{{.*}}lto.s" "-x" "cuda" "{{.*}}lto.cu"

// RUN: not %clangxx --target=x86_64-unknown-linux-gnu -nocudainc -nocudalib %s -emit-llvm 2>&1 \
// RUN: not %clangxx --target=x86_64-unknown-linux-gnu --no-offload-new-driver -nocudainc -nocudalib %s -emit-llvm 2>&1 \
// RUN: | FileCheck --check-prefix=LLVM-LINK %s
// LLVM-LINK: -emit-llvm cannot be used when linking

/// With ld.bfd or gold, link against LLVMgold.
// RUN: %clangxx -nocudainc -nocudalib --target=x86_64-unknown-linux-gnu --offload-arch=sm_52 --sysroot=%S/Inputs/basic_cross_linux_tree %s \
// RUN: -fuse-ld=bfd -flto=thin -### 2>&1 | FileCheck --check-prefix=LLVMGOLD %s
// RUN: --no-offload-new-driver -fuse-ld=bfd -flto=thin -### 2>&1 | FileCheck --check-prefix=LLVMGOLD %s
// RUN: %clangxx -nocudainc -nocudalib --target=x86_64-unknown-linux-gnu --offload-arch=sm_52 --sysroot=%S/Inputs/basic_cross_linux_tree %s \
// RUN: -fuse-ld=gold -flto=full -### 2>&1 | FileCheck --check-prefix=LLVMGOLD %s
// RUN: --no-offload-new-driver -fuse-ld=gold -flto=full -### 2>&1 | FileCheck --check-prefix=LLVMGOLD %s
//
// LLVMGOLD: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}"

/// lld does not need LLVMgold.
// RUN: %clangxx -nocudainc -nocudalib --target=x86_64-unknown-linux-gnu --offload-arch=sm_52 --sysroot=%S/Inputs/basic_cross_linux_tree %s \
// RUN: -fuse-ld=lld -flto=full -### 2>&1 | FileCheck --check-prefix=NO-LLVMGOLD %s
// RUN: --no-offload-new-driver -fuse-ld=lld -flto=full -### 2>&1 | FileCheck --check-prefix=NO-LLVMGOLD %s
// RUN: %clangxx -nocudainc -nocudalib --target=x86_64-unknown-linux-gnu --offload-arch=sm_52 --sysroot=%S/Inputs/basic_cross_linux_tree %s \
// RUN: -fuse-ld=gold -flto=full -fno-lto -### 2>&1 | FileCheck --check-prefix=NO-LLVMGOLD %s
// RUN: --no-offload-new-driver -fuse-ld=gold -flto=full -fno-lto -### 2>&1 | FileCheck --check-prefix=NO-LLVMGOLD %s
//
// NO-LLVMGOLD-NOT: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}"

// -flto passes along an explicit debugger tuning argument.
// RUN: %clangxx -nocudainc -nocudalib \
// RUN: %clangxx -nocudainc -nocudalib --no-offload-new-driver \
// RUN: --target=x86_64-unknown-linux -### %s -flto -glldb --offload-arch=sm_52 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2> %t
// RUN: FileCheck -check-prefix=CHECK-TUNING-LLDB < %t %s
// RUN: %clangxx -nocudainc -nocudalib \
// RUN: %clangxx -nocudainc -nocudalib --no-offload-new-driver \
// RUN: --target=x86_64-unknown-linux -### %s -flto -g --offload-arch=sm_52 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2> %t
// RUN: FileCheck -check-prefix=CHECK-NO-TUNING < %t %s
//
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/thinlto.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// REQUIRES: nvptx-registered-target

// -flto=thin causes a switch to llvm-bc object files.
// RUN: %clangxx -ccc-print-phases -nocudainc -nocudalib -c %s -flto=thin 2> %t
// RUN: %clangxx -ccc-print-phases --no-offload-new-driver -nocudainc -nocudalib -c %s -flto=thin 2> %t
// RUN: FileCheck -check-prefix=CHECK-COMPILE-ACTIONS < %t %s
//
// CHECK-COMPILE-ACTIONS: 2: compiler, {1}, ir, (host-cuda)
// CHECK-COMPILE-ACTIONS-NOT: lto-bc
// CHECK-COMPILE-ACTIONS: 12: backend, {11}, lto-bc, (host-cuda)

// RUN: %clangxx -ccc-print-phases -nocudainc -nocudalib %s -flto=thin 2> %t
// RUN: %clangxx -ccc-print-phases --no-offload-new-driver -nocudainc -nocudalib %s -flto=thin 2> %t
// RUN: FileCheck -check-prefix=CHECK-COMPILELINK-ACTIONS < %t %s
//
// CHECK-COMPILELINK-ACTIONS: 0: input, "{{.*}}thinlto.cu", cuda, (host-cuda)
Expand Down
6 changes: 3 additions & 3 deletions clang/test/Misc/target-invalid-cpu-note.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Use CHECK-NEXT instead of multiple CHECK-SAME to ensure we will fail if there is anything extra in the output.
// RUN: not %clang_cc1 -triple armv5--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix ARM
// ARM: error: unknown target CPU 'not-a-cpu'
// ARM-NEXT: note: valid target CPU values are: arm8, arm810, strongarm, strongarm110, strongarm1100, strongarm1110, arm7tdmi, arm7tdmi-s, arm710t, arm720t, arm9, arm9tdmi, arm920, arm920t, arm922t, arm940t, ep9312, arm10tdmi, arm1020t, arm9e, arm946e-s, arm966e-s, arm968e-s, arm10e, arm1020e, arm1022e, arm926ej-s, arm1136j-s, arm1136jf-s, mpcore, mpcorenovfp, arm1176jz-s, arm1176jzf-s, arm1156t2-s, arm1156t2f-s, cortex-m0, cortex-m0plus, cortex-m1, sc000, cortex-a5, cortex-a7, cortex-a8, cortex-a9, cortex-a12, cortex-a15, cortex-a17, krait, cortex-r4, cortex-r4f, cortex-r5, cortex-r7, cortex-r8, cortex-r52, sc300, cortex-m3, cortex-m4, cortex-m7, cortex-m23, cortex-m33, cortex-m35p, cortex-m55, cortex-m85, cortex-m52, cortex-a32, cortex-a35, cortex-a53, cortex-a55, cortex-a57, cortex-a72, cortex-a73, cortex-a75, cortex-a76, cortex-a76ae, cortex-a77, cortex-a78, cortex-a78c, cortex-a710, cortex-x1, cortex-x1c, neoverse-n1, neoverse-n2, neoverse-v1, cyclone, exynos-m3, exynos-m4, exynos-m5, kryo, iwmmxt, xscale, swift{{$}}
// ARM-NEXT: note: valid target CPU values are: arm8, arm810, strongarm, strongarm110, strongarm1100, strongarm1110, arm7tdmi, arm7tdmi-s, arm710t, arm720t, arm9, arm9tdmi, arm920, arm920t, arm922t, arm940t, ep9312, arm10tdmi, arm1020t, arm9e, arm946e-s, arm966e-s, arm968e-s, arm10e, arm1020e, arm1022e, arm926ej-s, arm1136j-s, arm1136jf-s, mpcore, mpcorenovfp, arm1176jz-s, arm1176jzf-s, arm1156t2-s, arm1156t2f-s, cortex-m0, cortex-m0plus, cortex-m1, sc000, cortex-a5, cortex-a7, cortex-a8, cortex-a9, cortex-a12, cortex-a15, cortex-a17, krait, cortex-r4, cortex-r4f, cortex-r5, cortex-r7, cortex-r8, cortex-r52, sc300, cortex-m3, cortex-m4, cortex-m7, cortex-m23, cortex-m33, cortex-m35p, cortex-m55, cortex-m85, cortex-m52, cortex-a32, cortex-a35, cortex-a53, cortex-a55, cortex-a57, cortex-a72, cortex-a73, cortex-a75, cortex-a76, cortex-a76ae, cortex-a77, cortex-a78, cortex-a78ae, cortex-a78c, cortex-a710, cortex-x1, cortex-x1c, neoverse-n1, neoverse-n2, neoverse-v1, cyclone, exynos-m3, exynos-m4, exynos-m5, kryo, iwmmxt, xscale, swift{{$}}

// RUN: not %clang_cc1 -triple arm64--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix AARCH64
// AARCH64: error: unknown target CPU 'not-a-cpu'
// AARCH64-NEXT: note: valid target CPU values are: cortex-a34, cortex-a35, cortex-a53, cortex-a55, cortex-a510, cortex-a520, cortex-a57, cortex-a65, cortex-a65ae, cortex-a72, cortex-a73, cortex-a75, cortex-a76, cortex-a76ae, cortex-a77, cortex-a78, cortex-a78c, cortex-a710, cortex-a715, cortex-a720, cortex-r82, cortex-x1, cortex-x1c, cortex-x2, cortex-x3, cortex-x4, neoverse-e1, neoverse-n1, neoverse-n2, neoverse-512tvb, neoverse-v1, neoverse-v2, cyclone, apple-a7, apple-a8, apple-a9, apple-a10, apple-a11, apple-a12, apple-a13, apple-a14, apple-a15, apple-a16, apple-a17, apple-m1, apple-m2, apple-m3, apple-s4, apple-s5, exynos-m3, exynos-m4, exynos-m5, falkor, saphira, kryo, thunderx2t99, thunderx3t110, thunderx, thunderxt88, thunderxt81, thunderxt83, tsv110, a64fx, carmel, ampere1, ampere1a, ampere1b, cobalt-100, grace{{$}}
// AARCH64-NEXT: note: valid target CPU values are: cortex-a34, cortex-a35, cortex-a53, cortex-a55, cortex-a510, cortex-a520, cortex-a57, cortex-a65, cortex-a65ae, cortex-a72, cortex-a73, cortex-a75, cortex-a76, cortex-a76ae, cortex-a77, cortex-a78, cortex-a78ae, cortex-a78c, cortex-a710, cortex-a715, cortex-a720, cortex-r82, cortex-x1, cortex-x1c, cortex-x2, cortex-x3, cortex-x4, neoverse-e1, neoverse-n1, neoverse-n2, neoverse-512tvb, neoverse-v1, neoverse-v2, cyclone, apple-a7, apple-a8, apple-a9, apple-a10, apple-a11, apple-a12, apple-a13, apple-a14, apple-a15, apple-a16, apple-a17, apple-m1, apple-m2, apple-m3, apple-s4, apple-s5, exynos-m3, exynos-m4, exynos-m5, falkor, saphira, kryo, thunderx2t99, thunderx3t110, thunderx, thunderxt88, thunderxt81, thunderxt83, tsv110, a64fx, carmel, ampere1, ampere1a, ampere1b, cobalt-100, grace{{$}}

// RUN: not %clang_cc1 -triple arm64--- -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix TUNE_AARCH64
// TUNE_AARCH64: error: unknown target CPU 'not-a-cpu'
// TUNE_AARCH64-NEXT: note: valid target CPU values are: cortex-a34, cortex-a35, cortex-a53, cortex-a55, cortex-a510, cortex-a520, cortex-a57, cortex-a65, cortex-a65ae, cortex-a72, cortex-a73, cortex-a75, cortex-a76, cortex-a76ae, cortex-a77, cortex-a78, cortex-a78c, cortex-a710, cortex-a715, cortex-a720, cortex-r82, cortex-x1, cortex-x1c, cortex-x2, cortex-x3, cortex-x4, neoverse-e1, neoverse-n1, neoverse-n2, neoverse-512tvb, neoverse-v1, neoverse-v2, cyclone, apple-a7, apple-a8, apple-a9, apple-a10, apple-a11, apple-a12, apple-a13, apple-a14, apple-a15, apple-a16, apple-a17, apple-m1, apple-m2, apple-m3, apple-s4, apple-s5, exynos-m3, exynos-m4, exynos-m5, falkor, saphira, kryo, thunderx2t99, thunderx3t110, thunderx, thunderxt88, thunderxt81, thunderxt83, tsv110, a64fx, carmel, ampere1, ampere1a, ampere1b, cobalt-100, grace{{$}}
// TUNE_AARCH64-NEXT: note: valid target CPU values are: cortex-a34, cortex-a35, cortex-a53, cortex-a55, cortex-a510, cortex-a520, cortex-a57, cortex-a65, cortex-a65ae, cortex-a72, cortex-a73, cortex-a75, cortex-a76, cortex-a76ae, cortex-a77, cortex-a78, cortex-a78ae, cortex-a78c, cortex-a710, cortex-a715, cortex-a720, cortex-r82, cortex-x1, cortex-x1c, cortex-x2, cortex-x3, cortex-x4, neoverse-e1, neoverse-n1, neoverse-n2, neoverse-512tvb, neoverse-v1, neoverse-v2, cyclone, apple-a7, apple-a8, apple-a9, apple-a10, apple-a11, apple-a12, apple-a13, apple-a14, apple-a15, apple-a16, apple-a17, apple-m1, apple-m2, apple-m3, apple-s4, apple-s5, exynos-m3, exynos-m4, exynos-m5, falkor, saphira, kryo, thunderx2t99, thunderx3t110, thunderx, thunderxt88, thunderxt81, thunderxt83, tsv110, a64fx, carmel, ampere1, ampere1a, ampere1b, cobalt-100, grace{{$}}

// RUN: not %clang_cc1 -triple i386--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix X86
// X86: error: unknown target CPU 'not-a-cpu'
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/InheritDefaultArguments.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t -I%t %t/Use.cppm -verify -fsyntax-only

// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t -I%t %t/Use.cppm -verify -fsyntax-only

//--- foo.h
template <typename T, typename U = int>
class Templ;
Expand Down
10 changes: 10 additions & 0 deletions clang/test/Modules/Reachability-Private.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp \
// RUN: -DTEST_BADINLINE -verify -fsyntax-only

// Test again with reduced BMI.
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/Private.cppm -emit-reduced-module-interface \
// RUN: -o %t/Private.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp \
// RUN: -DTEST_BADINLINE -verify -fsyntax-only

//--- Private.cppm
export module Private;
#ifdef TEST_BADINLINE
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/Reachability-func-default-arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
//
// RUN: %clang_cc1 -std=c++20 %t/func_default_arg.cppm -emit-module-interface -o %t/func_default_arg.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only

// RUN: %clang_cc1 -std=c++20 %t/func_default_arg.cppm -emit-reduced-module-interface -o %t/func_default_arg.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only
//
//--- func_default_arg.cppm
export module func_default_arg;
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/Reachability-func-ret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
//
// RUN: %clang_cc1 -std=c++20 %t/func_ret.cppm -emit-module-interface -o %t/func_ret.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only

// RUN: %clang_cc1 -std=c++20 %t/func_ret.cppm -emit-reduced-module-interface -o %t/func_ret.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only
//
//--- func_ret.cppm
export module func_ret;
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/Reachability-template-default-arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
//
// RUN: %clang_cc1 -std=c++20 %t/template_default_arg.cppm -emit-module-interface -o %t/template_default_arg.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify

// RUN: %clang_cc1 -std=c++20 %t/template_default_arg.cppm -emit-reduced-module-interface -o %t/template_default_arg.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify
//
//--- template_default_arg.cppm
export module template_default_arg;
Expand Down
4 changes: 4 additions & 0 deletions clang/test/Modules/Reachability-template-instantiation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
// RUN: %clang_cc1 -std=c++20 %t/Templ.cppm -emit-module-interface -o %t/Templ.pcm
// RUN: %clang_cc1 -std=c++20 %t/Use.cppm -fprebuilt-module-path=%t -emit-module-interface -o %t/Use.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t -I%t %t/Use.cpp -verify -fsyntax-only

// RUN: %clang_cc1 -std=c++20 %t/Templ.cppm -emit-reduced-module-interface -o %t/Templ.pcm
// RUN: %clang_cc1 -std=c++20 %t/Use.cppm -fprebuilt-module-path=%t -emit-reduced-module-interface -o %t/Use.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t -I%t %t/Use.cpp -verify -fsyntax-only
//
//--- Templ.h
#ifndef TEMPL_H
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/Reachability-using-templates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
//
// RUN: %clang_cc1 -std=c++20 %t/mod.templates.cppm -emit-module-interface -o %t/mod.templates.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify

// RUN: %clang_cc1 -std=c++20 %t/mod.templates.cppm -emit-reduced-module-interface -o %t/mod.templates.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify
//
//--- mod.templates.cppm
export module mod.templates;
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/Reachability-using.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
//
// RUN: %clang_cc1 -std=c++20 %t/mod.cppm -emit-module-interface -o %t/mod.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify

// RUN: %clang_cc1 -std=c++20 %t/mod.cppm -emit-reduced-module-interface -o %t/mod.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify
//
//--- mod.cppm
export module mod;
Expand Down
1 change: 0 additions & 1 deletion clang/test/Modules/concept.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// RUN: %clang_cc1 -std=c++20 -fskip-odr-check-in-gmf -fprebuilt-module-path=%t -I%t \
// RUN: -DDIFFERENT -DSKIP_ODR_CHECK_IN_GMF %t/B.cppm -verify


//--- foo.h
#ifndef FOO_H
#define FOO_H
Expand Down
5 changes: 5 additions & 0 deletions clang/test/Modules/concept_differ.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
// RUN: %clang_cc1 -x c++ -std=c++20 %t/A.cppm -I%t -emit-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -x c++ -std=c++20 %t/B.cppm -I%t -emit-module-interface -o %t/B.pcm
// RUN: %clang_cc1 -x c++ -std=c++20 -fprebuilt-module-path=%t %t/foo.cpp -verify
//
// RUN: rm %t/A.pcm %t/B.pcm
// RUN: %clang_cc1 -x c++ -std=c++20 %t/A.cppm -I%t -emit-reduced-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -x c++ -std=c++20 %t/B.cppm -I%t -emit-reduced-module-interface -o %t/B.pcm
// RUN: %clang_cc1 -x c++ -std=c++20 -fprebuilt-module-path=%t %t/foo.cpp -verify

//--- foo.h
template <class T>
Expand Down
4 changes: 4 additions & 0 deletions clang/test/Modules/ctor.arg.dep.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -I%t -emit-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only
//
// RUN: rm %t/A.pcm
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -I%t -emit-reduced-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only
//
//--- foo.h

namespace ns {
Expand Down
16 changes: 16 additions & 0 deletions clang/test/Modules/cxx20-10-1-ex1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@
// RUN: -fmodule-file=A=%t/A.pcm -fmodule-file=A:Foo=%t/A_Foo.pcm \
// RUN: -fmodule-file=A:Internals=%t/A_Internals.pcm -o %t/ex1.o

// RUN: rm %t/A_Internals.pcm %t/A_Foo.pcm %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-1-ex1-tu1.cpp \
// RUN: -o %t/A_Internals.pcm

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-1-ex1-tu2.cpp \
// RUN: -fmodule-file=A:Internals=%t/A_Internals.pcm -o %t/A_Foo.pcm

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-1-ex1-tu3.cpp \
// RUN: -fmodule-file=A:Internals=%t/A_Internals.pcm \
// RUN: -fmodule-file=A:Foo=%t/A_Foo.pcm -o %t/A.pcm

// RUN: %clang_cc1 -std=c++20 -emit-obj %t/std10-1-ex1-tu4.cpp \
// RUN: -fmodule-file=A:Internals=%t/A_Internals.pcm \
// RUN: -fmodule-file=A:Foo=%t/A_Foo.pcm \
// RUN: -fmodule-file=A=%t/A.pcm -o %t/ex1.o

// expected-no-diagnostics

//--- std10-1-ex1-tu1.cpp
Expand Down
36 changes: 30 additions & 6 deletions clang/test/Modules/cxx20-10-1-ex2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,50 @@

// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std10-1-ex2-tu1.cpp \
// RUN: -o %t/B_Y.pcm

//
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std10-1-ex2-tu2.cpp \
// RUN: -fmodule-file=B:Y=%t/B_Y.pcm -o %t/B.pcm

//
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std10-1-ex2-tu3.cpp \
// RUN: -o %t/B_X1.pcm -verify

//
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std10-1-ex2-tu4.cpp \
// RUN: -fmodule-file=B=%t/B.pcm -fmodule-file=B:Y=%t/B_Y.pcm -o %t/B_X2.pcm

//
// RUN: %clang_cc1 -std=c++20 -emit-obj %t/std10-1-ex2-tu5.cpp \
// RUN: -fmodule-file=B=%t/B.pcm -fmodule-file=B:Y=%t/B_Y.pcm -o %t/b_tu5.o

//
// RUN: %clang_cc1 -std=c++20 -S %t/std10-1-ex2-tu6.cpp \
// RUN: -fmodule-file=B=%t/B.pcm -fmodule-file=B:Y=%t/B_Y.pcm -o %t/b_tu6.s -verify

//
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std10-1-ex2-tu7.cpp \
// RUN: -fmodule-file=B:X2=%t/B_X2.pcm -fmodule-file=B=%t/B.pcm \
// RUN: -fmodule-file=B:Y=%t/B_Y.pcm -o %t/B_X3.pcm -verify

// Test again with reduced BMI.
// RUN: rm %t/B_X2.pcm %t/B.pcm %t/B_Y.pcm
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-1-ex2-tu1.cpp \
// RUN: -o %t/B_Y.pcm
//
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-1-ex2-tu2.cpp \
// RUN: -fmodule-file=B:Y=%t/B_Y.pcm -o %t/B.pcm
//
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-1-ex2-tu3.cpp \
// RUN: -o %t/B_X1.pcm -verify
//
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-1-ex2-tu4.cpp \
// RUN: -fmodule-file=B=%t/B.pcm -fmodule-file=B:Y=%t/B_Y.pcm -o %t/B_X2.pcm
//
// RUN: %clang_cc1 -std=c++20 -emit-obj %t/std10-1-ex2-tu5.cpp \
// RUN: -fmodule-file=B=%t/B.pcm -fmodule-file=B:Y=%t/B_Y.pcm -o %t/b_tu5.o
//
// RUN: %clang_cc1 -std=c++20 -S %t/std10-1-ex2-tu6.cpp \
// RUN: -fmodule-file=B=%t/B.pcm -fmodule-file=B:Y=%t/B_Y.pcm -o %t/b_tu6.s -verify
//
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-1-ex2-tu7.cpp \
// RUN: -fmodule-file=B:X2=%t/B_X2.pcm -fmodule-file=B=%t/B.pcm \
// RUN: -fmodule-file=B:Y=%t/B_Y.pcm -o %t/B_X3.pcm -verify

//--- std10-1-ex2-tu1.cpp
module B:Y;
int y();
Expand Down
12 changes: 12 additions & 0 deletions clang/test/Modules/cxx20-10-2-ex2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
// RUN: -fmodule-file=%t/std-10-2-ex2-c.pcm -fmodule-file=X=%t/X.pcm \
// RUN: -pedantic-errors -verify -o %t/M.pcm

// Test again with reduced BMI.
// RUN: %clang_cc1 -std=c++20 -emit-header-unit -I %t \
// RUN: -xc++-user-header std-10-2-ex2-c.h -o %t/std-10-2-ex2-c.pcm

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std-10-2-ex2-tu1.cpp \
// RUN: -o %t/X.pcm

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std-10-2-ex2-tu2.cpp \
// RUN: -fmodule-file=%t/std-10-2-ex2-c.pcm -fmodule-file=X=%t/X.pcm \
// RUN: -pedantic-errors -verify -o %t/M.pcm


//--- std-10-2-ex2-b.h
int f();

Expand Down
12 changes: 12 additions & 0 deletions clang/test/Modules/cxx20-10-2-ex5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@
// RUN: %clang_cc1 -std=c++20 -emit-obj %t/std-10-2-ex5-tu3.cpp \
// RUN: -fmodule-file=M=%t/M.pcm -verify -o %t/main.o

// Test again with reduced BMI.
// RUN: rm %t/M.pcm
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std-10-2-ex5-tu1.cpp \
// RUN: -o %t/M.pcm

// RUN: %clang_cc1 -std=c++20 -emit-obj %t/std-10-2-ex5-tu2.cpp \
// RUN: -fmodule-file=M=%t/M.pcm -o %t/tu-2.o

// RUN: %clang_cc1 -std=c++20 -emit-obj %t/std-10-2-ex5-tu3.cpp \
// RUN: -fmodule-file=M=%t/M.pcm -verify -o %t/main.o


//--- std-10-2-ex5-tu1.cpp
export module M;
export struct X {
Expand Down
14 changes: 14 additions & 0 deletions clang/test/Modules/cxx20-10-3-ex1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std10-3-ex1-tu4.cpp \
// RUN: -fmodule-file=M:Part=%t/M_Part.pcm -o %t/M.pcm

// Test again with reduced BMI.
// RUN: rm %t/M_PartImpl.pcm %t/M.pcm %t/M_Part.pcm
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-3-ex1-tu1.cpp \
// RUN: -o %t/M_PartImpl.pcm

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-3-ex1-tu2.cpp \
// RUN: -fmodule-file=M:PartImpl=%t/M_PartImpl.pcm -o %t/M.pcm -verify

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-3-ex1-tu3.cpp \
// RUN: -o %t/M_Part.pcm

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-3-ex1-tu4.cpp \
// RUN: -fmodule-file=M:Part=%t/M_Part.pcm -o %t/M.pcm

//--- std10-3-ex1-tu1.cpp
module M:PartImpl;

Expand Down
10 changes: 10 additions & 0 deletions clang/test/Modules/cxx20-10-3-ex2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std10-3-ex2-tu3.cpp \
// RUN: -o %t/M.pcm -verify

// Test again with reduced BMI.
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-3-ex2-tu1.cpp \
// RUN: -o %t/M.pcm

// RUN: %clang_cc1 -std=c++20 -S %t/std10-3-ex2-tu2.cpp \
// RUN: -fmodule-file=M=%t/M.pcm -o %t/tu_8.s -verify

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-3-ex2-tu3.cpp \
// RUN: -o %t/M.pcm -verify

//--- std10-3-ex2-tu1.cpp
export module M;

Expand Down
12 changes: 12 additions & 0 deletions clang/test/Modules/cxx20-10-5-ex1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
// RUN: %clang_cc1 -std=c++20 std-10-5-ex1-use.cpp -fmodule-file=A=A.pcm \
// RUN: -fsyntax-only -verify

// Test again with reduced BMI.
// RUN: rm A.pcm
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface std-10-5-ex1-interface.cpp \
// RUN: -DBAD_FWD_DECL -fsyntax-only -verify

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface std-10-5-ex1-interface.cpp \
// RUN: -o A.pcm

// RUN: %clang_cc1 -std=c++20 std-10-5-ex1-use.cpp -fmodule-file=A=A.pcm \
// RUN: -fsyntax-only -verify


//--- std-10-5-ex1-interface.cpp

export module A;
Expand Down
39 changes: 39 additions & 0 deletions clang/test/Modules/cxx20-import-diagnostics-a.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,45 @@
// RUN: %clang_cc1 -std=c++20 -emit-obj %t/import-diags-tu11.cpp \
// RUN: -fmodule-file=C=%t/C.pcm -o %t/impl.o

// Test again with reduced BMI.
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/import-diags-tu1.cpp \
// RUN: -o %t/B.pcm

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/import-diags-tu2.cpp \
// RUN: -o %t/C.pcm

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/import-diags-tu3.cpp \
// RUN: -fmodule-file=B=%t/B.pcm -fmodule-file=C=%t/C.pcm -o %t/AOK1.pcm

// RUN: %clang_cc1 -std=c++20 -S %t/import-diags-tu4.cpp \
// RUN: -fmodule-file=AOK1=%t/AOK1.pcm -fmodule-file=B=%t/B.pcm \
// RUN: -fmodule-file=C=%t/C.pcm -o %t/tu_3.s -verify

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/import-diags-tu5.cpp \
// RUN: -fmodule-file=B=%t/B.pcm -fmodule-file=C=%t/C.pcm -o %t/BC.pcm -verify

// RUN: %clang_cc1 -std=c++20 -S %t/import-diags-tu6.cpp \
// RUN: -fmodule-file=B=%t/B.pcm -fmodule-file=C=%t/C.pcm -o %t/tu_5.s -verify

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/import-diags-tu7.cpp \
// RUN: -fmodule-file=B=%t/B.pcm -o %t/D.pcm -verify

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/import-diags-tu8.cpp \
// RUN: -fmodule-file=B=%t/B.pcm -o %t/D.pcm -verify

// RUN: %clang_cc1 -std=c++20 -S %t/import-diags-tu9.cpp \
// RUN: -fmodule-file=B=%t/B.pcm -o %t/tu_8.s -verify

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/import-diags-tu10.cpp \
// RUN: -o %t/B.pcm -verify

// RUN: %clang_cc1 -std=c++20 -emit-obj %t/import-diags-tu11.cpp \
// RUN: -fmodule-file=C=%t/C.pcm -o %t/impl.o

// Test diagnostics for incorrect module import sequences.

//--- import-diags-tu1.cpp
Expand Down
25 changes: 25 additions & 0 deletions clang/test/Modules/cxx20-import-diagnostics-b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,31 @@
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/g.cpp \
// RUN: -fmodule-file=a=%t/a.pcm -o %t/g.pcm -verify

// Test again with reduced BMI.
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/a.cpp -o %t/a.pcm

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/c.cpp \
// RUN: -fmodule-file=a=%t/a.pcm -o %t/c.pcm

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/d.cpp \
// RUN: -fmodule-file=a=%t/a.pcm -o %t/d.pcm

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/e.cpp \
// RUN: -fmodule-file=a=%t/a.pcm -o %t/e.pcm

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/a-part.cpp \
// RUN: -o %t/a-part.pcm

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/f.cpp \
// RUN: -fmodule-file=a=%t/a.pcm -o %t/f.pcm -verify

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/g.cpp \
// RUN: -fmodule-file=a=%t/a.pcm -o %t/g.pcm -verify

//--- a.cpp
export module a;

Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/cxx20-module-file-info-macros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
// RUN: %clang_cc1 -std=c++20 %t/named_module.cppm -emit-module-interface -o %t/M.pcm
// RUN: %clang_cc1 -module-file-info %t/M.pcm | FileCheck %t/named_module.cppm

// RUN: %clang_cc1 -std=c++20 %t/named_module.cppm -emit-reduced-module-interface -o %t/M.pcm
// RUN: %clang_cc1 -module-file-info %t/M.pcm | FileCheck %t/named_module.cppm

//--- foo.h
#pragma once
#define FOO
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/deduction-guide.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// RUN: %clang_cc1 -std=c++20 %t/Templ.cppm -emit-module-interface -o %t/Templ.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only

// RUN: %clang_cc1 -std=c++20 %t/Templ.cppm -emit-reduced-module-interface -o %t/Templ.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only

//--- foo.h
template <typename T>
class Templ {
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/deduction-guide2.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// RUN: %clang_cc1 -std=c++20 %t/Templ.cppm -emit-module-interface -o %t/Templ.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only

// RUN: %clang_cc1 -std=c++20 %t/Templ.cppm -emit-reduced-module-interface -o %t/Templ.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only

//--- Templ.cppm
export module Templ;
export template <typename T>
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/deduction-guide3.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// RUN: %clang_cc1 -std=c++20 %t/Templ.cppm -emit-module-interface -o %t/Templ.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only

// RUN: %clang_cc1 -std=c++20 %t/Templ.cppm -emit-reduced-module-interface -o %t/Templ.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only

//--- Templ.cppm
export module Templ;
template <typename T>
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/derived_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
//
// RUN: %clang_cc1 -std=c++20 %t/foo.cppm -emit-module-interface -o %t/foo.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify

// RUN: %clang_cc1 -std=c++20 %t/foo.cppm -emit-reduced-module-interface -o %t/foo.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify
//
//--- bar.h
struct bar_base {
Expand Down
4 changes: 4 additions & 0 deletions clang/test/Modules/duplicated-module-file-eq-module-name.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/u.cpp -fmodule-file=a=%t/unexist.pcm \
// RUN: -fmodule-file=a=%t/a.pcm -verify -fsyntax-only
//
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/u.cpp -fmodule-file=a=%t/unexist.pcm \
// RUN: -fmodule-file=a=%t/a.pcm -verify -fsyntax-only

//--- a.cppm
export module a;
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/enum-class.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
//
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only
//
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only

//--- foo.h
enum class foo {
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/explicitly-specialized-template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// RUN: %clang_cc1 -std=c++20 %t/X.cppm -emit-module-interface -o %t/X.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify
//
// RUN: %clang_cc1 -std=c++20 %t/X.cppm -emit-reduced-module-interface -o %t/X.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify
//
//--- foo.h
#ifndef FOO_H
#define FOO_H
Expand Down
8 changes: 7 additions & 1 deletion clang/test/Modules/export-language-linkage.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
// RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-module-interface -o %t/c.pcm
// RUN: %clang_cc1 -std=c++20 %t/d.cpp -fsyntax-only -verify -fmodule-file=c=%t/c.pcm

// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/b.cpp -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
// RUN: %clang_cc1 -std=c++20 %t/c.cppm -fsyntax-only -verify
// RUN: %clang_cc1 -module-file-info %t/a.pcm | FileCheck %t/a.cppm

//--- a.cppm
export module a;
export extern "C++" int foo() { return 43; }
Expand Down Expand Up @@ -43,6 +48,7 @@ int use() {
}

//--- c.cppm
// expected-no-diagnostics
export module c;
extern "C++" {
export int f();
Expand All @@ -59,5 +65,5 @@ int use() {

int use_of_nonexported() {
return h(); // expected-error {{declaration of 'h' must be imported from module 'c' before it is required}}
// expected-note@c.cppm:4 {{declaration here is not visible}}
// expected-note@c.cppm:5 {{declaration here is not visible}}
}
9 changes: 9 additions & 0 deletions clang/test/Modules/ftime-trace.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,14 @@
// RUN: %clang_cc1 -std=c++20 %t/a.pcm -ftime-trace=%t/a.json -o -
// RUN: ls %t | grep "a.json"

// Test again with reduced BMI.
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/a.pcm -ftime-trace=%t/a.json -o -
// RUN: ls %t | grep "a.json"

//--- a.cppm
export module a;
6 changes: 6 additions & 0 deletions clang/test/Modules/inconsistent-deduction-guide-linkage.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
// RUN: %clang_cc1 -std=c++20 %t/D.cppm -I%t -emit-module-interface -o %t/D.pcm
// RUN: %clang_cc1 -std=c++20 -fsyntax-only %t/D-part.cppm -I%t -fprebuilt-module-path=%t -verify

// RUN: %clang_cc1 -std=c++20 %t/B.cppm -I%t -emit-reduced-module-interface -o %t/B.pcm
// RUN: %clang_cc1 -std=c++20 -fsyntax-only %t/A.cppm -I%t -fprebuilt-module-path=%t -verify
//
// RUN: %clang_cc1 -std=c++20 %t/D.cppm -I%t -emit-reduced-module-interface -o %t/D.pcm
// RUN: %clang_cc1 -std=c++20 -fsyntax-only %t/D-part.cppm -I%t -fprebuilt-module-path=%t -verify

//--- A.cppm
module;
export module baz:A;
Expand Down
13 changes: 13 additions & 0 deletions clang/test/Modules/inconsistent-export.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@
// RUN: -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 %t/use.cppm -fprebuilt-module-path=%t -emit-obj

// Test again with reduced BMI.
// RUN: rm -fr %t
// RUN: mkdir %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/m-a.pcm
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-reduced-module-interface -o %t/m-b.pcm \
// RUN: -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 %t/m.cppm -emit-reduced-module-interface -o %t/m.pcm \
// RUN: -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 %t/use.cppm -fprebuilt-module-path=%t -emit-obj


//--- a.cppm
export module m:a;
namespace n {
Expand Down
8 changes: 8 additions & 0 deletions clang/test/Modules/inherited_arg.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -fprebuilt-module-path=%t -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only

// Test again with reduced BMI.
//
// RUN: %clang_cc1 -std=c++20 %t/A-B.cppm -I%t -emit-reduced-module-interface -o %t/A-B.pcm
// RUN: %clang_cc1 -std=c++20 %t/A-C.cppm -I%t -emit-reduced-module-interface -o %t/A-C.pcm
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-module-interface -fprebuilt-module-path=%t -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only


//--- foo.h
template <typename U, typename T>
class pair {};
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/instantiation-argdep-lookup.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -I%t -emit-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only
//
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -I%t -emit-reduced-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only
//
//--- foo.h

namespace ns {
Expand Down
15 changes: 15 additions & 0 deletions clang/test/Modules/lambdas.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@
// RUN: -o %t/lambdas2.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only \
// RUN: -verify -DUSE_LAMBDA2
//
// Test again with reduced BMI.
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/lambdas.cppm -emit-reduced-module-interface \
// RUN: -o %t/lambdas.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only \
// RUN: -verify
//
// RUN: %clang_cc1 -std=c++20 %t/lambdas2.cppm -emit-reduced-module-interface \
// RUN: -o %t/lambdas2.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only \
// RUN: -verify -DUSE_LAMBDA2

//--- lambdas.h
auto l1 = []() constexpr -> int {
Expand Down
12 changes: 12 additions & 0 deletions clang/test/Modules/merge-concepts-cxx-modules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/conflicting.cppm -o %t/conflicting.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cppm -fsyntax-only -verify

// Test again with reduced BMI.
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/same_as.cppm -o %t/same_as.pcm
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface -fprebuilt-module-path=%t %t/concepts.cppm -o %t/concepts.pcm
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface -fprebuilt-module-path=%t %t/format.cppm -o %t/format.pcm
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/conflicting.cppm -o %t/conflicting.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cppm -fsyntax-only -verify


//--- same_as.cppm
export module same_as;
export template <class T, class U>
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/merge-constrained-friends.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// RUN: %clang_cc1 -std=c++23 %t/A.cppm -emit-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++23 %t/Use.cpp -fprebuilt-module-path=%t -fsyntax-only -verify

// RUN: %clang_cc1 -std=c++23 %t/A.cppm -emit-reduced-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++23 %t/Use.cpp -fprebuilt-module-path=%t -fsyntax-only -verify

//--- A.cppm
module;
export module A;
Expand Down
4 changes: 4 additions & 0 deletions clang/test/Modules/merge-lambdas.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-module-interface -o %t/B.pcm
// RUN: %clang_cc1 -std=c++20 %t/use.cppm -fprebuilt-module-path=%t -fsyntax-only -verify

// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-reduced-module-interface -o %t/B.pcm
// RUN: %clang_cc1 -std=c++20 %t/use.cppm -fprebuilt-module-path=%t -fsyntax-only -verify

//--- lambda.h
inline auto cmp = [](auto l, auto r) {
return l < r;
Expand Down
19 changes: 19 additions & 0 deletions clang/test/Modules/merge-requires-with-lambdas.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@
// RUN: %clang_cc1 -std=c++20 %t/A3.cppm -emit-module-interface -o %t/A3.pcm
// RUN: %clang_cc1 -std=c++20 %t/TestA3.cpp -fprebuilt-module-path=%t -fsyntax-only -verify

// Test again with reduced BMI.
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 %t/A0.cppm -emit-reduced-module-interface -o %t/A0.pcm
// RUN: %clang_cc1 -std=c++20 %t/TestA.cpp -fprebuilt-module-path=%t -fsyntax-only -verify
//
// RUN: %clang_cc1 -std=c++20 %t/A1.cppm -emit-reduced-module-interface -o %t/A1.pcm
// RUN: %clang_cc1 -std=c++20 %t/TestA1.cpp -fprebuilt-module-path=%t -fsyntax-only -verify
//
// RUN: %clang_cc1 -std=c++20 %t/A2.cppm -emit-reduced-module-interface -o %t/A2.pcm
// RUN: %clang_cc1 -std=c++20 %t/TestA2.cpp -fprebuilt-module-path=%t -fsyntax-only -verify
//
// RUN: %clang_cc1 -std=c++20 %t/A3.cppm -emit-reduced-module-interface -o %t/A3.pcm
// RUN: %clang_cc1 -std=c++20 %t/TestA3.cpp -fprebuilt-module-path=%t -fsyntax-only -verify


//--- A.h
template <class _Tp>
concept A = requires(const _Tp& __t) { []<class __Up>(const __Up&) {}(__t); };
Expand Down
5 changes: 5 additions & 0 deletions clang/test/Modules/merge-var-template-spec-cxx-modules.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
// RUN: %clang_cc1 -std=c++20 -emit-module-interface -fprebuilt-module-path=%t %t/reexport2.cppm -o %t/reexport2.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/use.cppm -fsyntax-only -verify

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/var_def.cppm -o %t/var_def.pcm
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface -fprebuilt-module-path=%t %t/reexport1.cppm -o %t/reexport1.pcm
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface -fprebuilt-module-path=%t %t/reexport2.cppm -o %t/reexport2.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/use.cppm -fsyntax-only -verify

//--- use.cppm
import reexport1;
import reexport2;
Expand Down
11 changes: 11 additions & 0 deletions clang/test/Modules/mismatch-diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
// RUN: -fprebuilt-module-path=%t/prebuilt_modules -DCHECK_MISMATCH \
// RUN: %t/use.cpp 2>&1 | FileCheck %s

// Test again with reduced BMI.
// RUN: %clang_cc1 -triple %itanium_abi_triple \
// RUN: -std=c++20 -fprebuilt-module-path=%t/prebuilt-modules \
// RUN: -emit-reduced-module-interface -pthread -DBUILD_MODULE \
// RUN: %t/mismatching_module.cppm -o \
// RUN: %t/prebuilt_modules/mismatching_module.pcm
//
// RUN: not %clang_cc1 -triple %itanium_abi_triple -std=c++20 \
// RUN: -fprebuilt-module-path=%t/prebuilt_modules -DCHECK_MISMATCH \
// RUN: %t/use.cpp 2>&1 | FileCheck %s

//--- mismatching_module.cppm
export module mismatching_module;

Expand Down
11 changes: 11 additions & 0 deletions clang/test/Modules/module-init-duplicated-import.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/m.pcm \
// RUN: -fmodule-file=a=%t/a.pcm -S -emit-llvm -o - | FileCheck %t/m.cppm

// Test again with reduced BMI.
// Note that we can't use reduced BMI here for m.cppm since it is required
// to generate the backend code.
// RUN: rm %t/a.pcm %t/m.pcm
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/a.cppm \
// RUN: -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/m.cppm \
// RUN: -emit-module-interface -fmodule-file=a=%t/a.pcm -o %t/m.pcm
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/m.pcm \
// RUN: -fmodule-file=a=%t/a.pcm -S -emit-llvm -o - | FileCheck %t/m.cppm

//--- a.cppm
export module a;
export struct A {
Expand Down
4 changes: 4 additions & 0 deletions clang/test/Modules/named-modules-adl-2.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -emit-module-interface -o %t/b.pcm
// RUN: %clang_cc1 -std=c++20 %t/c.cppm -fmodule-file=a=%t/a.pcm -fmodule-file=b=%t/b.pcm -fsyntax-only -verify

// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -emit-reduced-module-interface -o %t/b.pcm
// RUN: %clang_cc1 -std=c++20 %t/c.cppm -fmodule-file=a=%t/a.pcm -fmodule-file=b=%t/b.pcm -fsyntax-only -verify

//--- a.cppm
export module a;

Expand Down
14 changes: 14 additions & 0 deletions clang/test/Modules/named-modules-adl-3.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@
// RUN: %clang_cc1 -std=c++20 -DEXPORT_OPERATOR %t/c.cppm -fmodule-file=a=%t/a.pcm \
// RUN: -fmodule-file=b=%t/b.pcm -fsyntax-only -verify

// Test again with reduced BMI.
//
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -emit-reduced-module-interface \
// RUN: -o %t/b.pcm
// RUN: %clang_cc1 -std=c++20 %t/c.cppm -fmodule-file=a=%t/a.pcm -fmodule-file=b=%t/b.pcm \
// RUN: -fsyntax-only -verify
//
// RUN: %clang_cc1 -std=c++20 -DEXPORT_OPERATOR %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 -DEXPORT_OPERATOR %t/b.cppm -fmodule-file=a=%t/a.pcm \
// RUN: -emit-reduced-module-interface -o %t/b.pcm
// RUN: %clang_cc1 -std=c++20 -DEXPORT_OPERATOR %t/c.cppm -fmodule-file=a=%t/a.pcm \
// RUN: -fmodule-file=b=%t/b.pcm -fsyntax-only -verify

//--- foo.h
namespace n {

Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/named-modules-adl.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -fsyntax-only -verify

// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -fsyntax-only -verify

//--- a.h
namespace n {

Expand Down
10 changes: 10 additions & 0 deletions clang/test/Modules/no-duplicate-codegen-in-GMF.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/B.pcm -S -emit-llvm -o - \
// RUN: -fprebuilt-module-path=%t | FileCheck %t/B.cppm

// Test again with reduced BMI. Note that we need to generate full BMI for B.cppm
// since it is required to generate backend codes.
// RUN: rm %t/A.pcm %t/B.pcm
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/A.cppm -emit-reduced-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/B.cppm -emit-module-interface -o %t/B.pcm \
// RUN: -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/B.pcm -S -emit-llvm -o - \
// RUN: -fprebuilt-module-path=%t | FileCheck %t/B.cppm


//--- foo.h

template <class T>
Expand Down
9 changes: 9 additions & 0 deletions clang/test/Modules/pair-unambiguous-ctor.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
// RUN: %clang_cc1 -std=c++20 %t/algorithm.cppm -I%t -emit-module-interface -o %t/std-algorithm.pcm
// RUN: %clang_cc1 -std=c++20 %t/Use.cppm -I%t -fprebuilt-module-path=%t -emit-module-interface -verify -o %t/Use.pcm

// Test again with reduced BMI.
// RUN: rm -fr %t
// RUN: mkdir %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/string.cppm -I%t -emit-reduced-module-interface -o %t/std-string.pcm
// RUN: %clang_cc1 -std=c++20 %t/algorithm.cppm -I%t -emit-reduced-module-interface -o %t/std-algorithm.pcm
// RUN: %clang_cc1 -std=c++20 %t/Use.cppm -I%t -fprebuilt-module-path=%t -emit-reduced-module-interface -verify -o %t/Use.pcm

//--- Use.cppm
// expected-no-diagnostics
module;
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/partial_specialization.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/A.cppm -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify
//
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/A.cppm -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify
//
//--- foo.h
template<typename T, typename U>
inline constexpr bool IsSame = false;
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/placement-new-reachable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 %t/Use.cpp -fprebuilt-module-path=%t -fsyntax-only -verify

// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 %t/Use.cpp -fprebuilt-module-path=%t -fsyntax-only -verify

//--- placement.h
namespace std {
using size_t = decltype(sizeof(0));
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/polluted-operator.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
// RUN: %clang_cc1 -std=c++20 -fskip-odr-check-in-gmf %t/b.cppm -fprebuilt-module-path=%t \
// RUN: -emit-module-interface -DSKIP_ODR_CHECK_IN_GMF -o %t/b.pcm -verify

// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/a.cppm -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -fprebuilt-module-path=%t -emit-reduced-module-interface -o %t/b.pcm -verify

//--- foo.h

namespace std
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/pr54457.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
// RUN: %clang_cc1 -std=c++20 %t/C.cppm -emit-module-interface -o %t/C.pcm
// RUN: %clang_cc1 -std=c++20 %t/UseC.cppm -fprebuilt-module-path=%t -verify -S -o -

// RUN: %clang_cc1 -std=c++20 %t/C.cppm -emit-reduced-module-interface -o %t/C.pcm
// RUN: %clang_cc1 -std=c++20 %t/UseC.cppm -fprebuilt-module-path=%t -verify -S -o -

//--- A.cppm
// expected-no-diagnostics
export module A;
Expand Down
12 changes: 12 additions & 0 deletions clang/test/Modules/pr56916.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
// RUN: -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 %t/Use.cpp -fsyntax-only -fprebuilt-module-path=%t -verify

// Test again with reduced BMI.
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-module-interface -o %t/M-A.pcm
// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-reduced-module-interface -o %t/M-B.pcm
// RUN: %clang_cc1 -std=c++20 %t/M.cppm -emit-reduced-module-interface -o %t/M.pcm \
// RUN: -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 %t/Use.cpp -fsyntax-only -fprebuilt-module-path=%t -verify


//--- foo.h
template <typename T>
class Templ {
Expand Down
6 changes: 6 additions & 0 deletions clang/test/Modules/pr58532.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
// RUN: %clang_cc1 -std=c++20 %t/implementation.cpp -fmodule-file=m=%t/m.pcm \
// RUN: -fsyntax-only -verify

// Test again with reduced BMI.
// RUN: %clang_cc1 -std=c++20 %t/interface.cppm -emit-reduced-module-interface \
// RUN: -o %t/m.pcm
// RUN: %clang_cc1 -std=c++20 %t/implementation.cpp -fmodule-file=m=%t/m.pcm \
// RUN: -fsyntax-only -verify

//--- invisible.h
#pragma once // This breaks things.
const int kInvisibleSymbol = 0;
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Modules/pr58716.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// RUN: %clang_cc1 -triple=x86_64-linux-gnu -std=c++20 -emit-module-interface %t/m.cppm -o %t/m.pcm
// RUN: %clang_cc1 -triple=x86_64-linux-gnu -std=c++20 %t/m.pcm -S -emit-llvm -o - | FileCheck %t/m.cppm
//

//--- m.cppm
module;
#include "fail.h"
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/pr59719.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
// RUN: %clang_cc1 -std=c++20 %t/data.cppm -emit-module-interface -o %t/data.pcm
// RUN: %clang_cc1 -std=c++20 %t/main.cpp -fprebuilt-module-path=%t -fsyntax-only -verify

// RUN: %clang_cc1 -std=c++20 %t/data.cppm -emit-reduced-module-interface -o %t/data.pcm
// RUN: %clang_cc1 -std=c++20 %t/main.cpp -fprebuilt-module-path=%t -fsyntax-only -verify

//--- foo.h
namespace std {

Expand Down
10 changes: 10 additions & 0 deletions clang/test/Modules/pr59780.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
// RUN: -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %t/use.cpp
// RUN: %clang_cc1 -std=c++20 %t/a.pcm -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %t/a.cppm

// Test again with reduced BMI.
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -triple %itanium_abi_triple -emit-module-interface \
// RUN: -o %t/a.full.pcm
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -triple %itanium_abi_triple -emit-reduced-module-interface \
// RUN: -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fprebuilt-module-path=%t -S \
// RUN: -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %t/use.cpp
// RUN: %clang_cc1 -std=c++20 %t/a.full.pcm -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %t/a.cppm


//--- a.cppm
export module a;

Expand Down
13 changes: 13 additions & 0 deletions clang/test/Modules/pr59999.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/Object.pcm \
// RUN: -fmodule-file=Module=%t/Module.pcm -S -emit-llvm -o - | FileCheck %t/Object.cppm

// Test again with reduced BMI.
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/Module.cppm \
// RUN: -emit-reduced-module-interface -o %t/Module.pcm
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/Object.cppm \
// RUN: -fmodule-file=Module=%t/Module.pcm -emit-module-interface -o %t/Object.pcm
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/Object.pcm \
// RUN: -fmodule-file=Module=%t/Module.pcm -S -emit-llvm -o - | FileCheck %t/Object.cppm


//--- Module.cppm
export module Module;

Expand Down
14 changes: 14 additions & 0 deletions clang/test/Modules/pr60036.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@
// RUN: -fmodule-file=c=%t/c.pcm -fmodule-file=d=%t/d.pcm -fmodule-file=e=%t/e.pcm \
// RUN: -fmodule-file=f=%t/f.pcm -verify -fsyntax-only

// Test again with reduced BMI
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-reduced-module-interface -fprebuilt-module-path=%t -o %t/b.pcm
// RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-reduced-module-interface -fprebuilt-module-path=%t -o %t/c.pcm
// RUN: %clang_cc1 -std=c++20 %t/d.cppm -emit-reduced-module-interface -fprebuilt-module-path=%t -o %t/d.pcm
// RUN: %clang_cc1 -std=c++20 %t/e.cppm -emit-reduced-module-interface -fprebuilt-module-path=%t -o %t/e.pcm
// RUN: %clang_cc1 -std=c++20 %t/f.cppm -emit-reduced-module-interface -fprebuilt-module-path=%t -o %t/f.pcm
// RUN: %clang_cc1 -std=c++20 %t/g.cppm -fprebuilt-module-path=%t -verify -fsyntax-only


//--- a.cppm
export module a;

Expand Down
17 changes: 17 additions & 0 deletions clang/test/Modules/pr60085.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@
// RUN: -S -emit-llvm -disable-llvm-passes -o - -fprebuilt-module-path=%t \
// RUN: | FileCheck %t/a.cppm

// Test again with reduced BMI.
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/d.cppm \
// RUN: -emit-reduced-module-interface -o %t/d.pcm
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/c.cppm \
// RUN: -emit-reduced-module-interface -o %t/c.pcm -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/b.cppm \
// RUN: -emit-reduced-module-interface -o %t/b.pcm -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/a.cppm \
// RUN: -emit-module-interface -o %t/a.pcm -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/a.pcm \
// RUN: -S -emit-llvm -disable-llvm-passes -o - -fprebuilt-module-path=%t \
// RUN: | FileCheck %t/a.cppm

//--- d.cppm
export module d;

Expand Down
7 changes: 6 additions & 1 deletion clang/test/Modules/pr60275.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple -emit-module-interface %t/a.cppm -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/b.cpp -fmodule-file=%t/a.pcm -emit-llvm -o - | FileCheck %t/b.cpp
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/b.cpp -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/b.cpp

// Test again with reduced BMI
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple -emit-reduced-module-interface %t/a.cppm -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/b.cpp -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/b.cpp

//--- foo.h

consteval void global() {}
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/pr60486.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 -fmodule-file=a=%t/a.pcm %t/b.cppm -fsyntax-only -verify

// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 -fmodule-file=a=%t/a.pcm %t/b.cppm -fsyntax-only -verify

//--- foo.h
template<typename = void>
struct s {
Expand Down
Loading