llvm-project/clang/test/CodeGenHipStdPar/select-accelerator-code-pass-ordering.cpp
Alex Voicu 23e92c985d
[NFC] Fix bot breakage introduced by #134753 (#135697)
This test needs the amdgpu target, and its absence wreaked havoc with
some of the bots, therefore we now require it.
2025-04-15 02:18:30 +03:00

26 lines
1.1 KiB
C++

// REQUIRES: amdgpu-registered-target
// Test that the accelerator code selection pass only gets invoked after linking
// Ensure Pass HipStdParAcceleratorCodeSelectionPass is not invoked in PreLink.
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -mllvm -amdgpu-enable-hipstdpar -flto -emit-llvm-bc -fcuda-is-device -fdebug-pass-manager \
// RUN: %s -o /dev/null 2>&1 | FileCheck --check-prefix=HIPSTDPAR-PRE %s
// HIPSTDPAR-PRE: Running pass: EntryExitInstrumenterPass
// HIPSTDPAR-PRE-NEXT: Running pass: EntryExitInstrumenterPass
// HIPSTDPAR-PRE-NOT: Running pass: HipStdParAcceleratorCodeSelectionPass
// HIPSTDPAR-PRE-NEXT: Running pass: AlwaysInlinerPass
// Ensure Pass HipStdParAcceleratorCodeSelectionPass is invoked in PostLink.
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -mllvm -amdgpu-enable-hipstdpar -fcuda-is-device -fdebug-pass-manager -emit-llvm \
// RUN: %s -o /dev/null 2>&1 | FileCheck --check-prefix=HIPSTDPAR-POST %s
// HIPSTDPAR-POST: Running pass: HipStdParAcceleratorCodeSelection
#define __device__ __attribute__((device))
void foo(float *a, float b) {
*a = b;
}
__device__ void bar(float *a, float b) {
*a = b;
}