|
| 1 | +// REQUIRES: system-linux |
| 2 | +// REQUIRES: x86-registered-target |
| 3 | +// REQUIRES: nvptx-registered-target |
| 4 | +// REQUIRES: shell |
| 5 | + |
| 6 | +// Check that -fsplit-machine-functions is passed to both x86 and cuda |
| 7 | +// compilation and does not cause driver error. |
| 8 | +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \ |
| 9 | +// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions -S %s 2>&1 \ |
| 10 | +// RUN: | FileCheck %s --check-prefix=MFS1 |
| 11 | +// MFS1: "-target-cpu" "x86-64"{{.*}}"-fsplit-machine-functions" |
| 12 | +// MFS1: "-target-cpu" "sm_70"{{.*}}"-fsplit-machine-functions" |
| 13 | + |
| 14 | +// Check that -fsplit-machine-functions is passed to cuda and it |
| 15 | +// causes a warning. |
| 16 | +// RUN: %clang --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \ |
| 17 | +// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions -S %s 2>&1 \ |
| 18 | +// RUN: | FileCheck %s --check-prefix=MFS2 |
| 19 | +// MFS2: warning: -fsplit-machine-functions is not valid for nvptx |
| 20 | + |
| 21 | +// Check that -Xarch_host -fsplit-machine-functions is passed only to |
| 22 | +// native compilation. |
| 23 | +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \ |
| 24 | +// RUN: --cuda-gpu-arch=sm_70 -x cuda -Xarch_host \ |
| 25 | +// RUN: -fsplit-machine-functions -S %s \ |
| 26 | +// RUN: 2>&1 | FileCheck %s --check-prefix=MFS3 |
| 27 | +// MFS3: "-target-cpu" "x86-64"{{.*}}"-fsplit-machine-functions" |
| 28 | +// MFS3-NOT: "-target-cpu" "sm_70"{{.*}}"-fsplit-machine-functions" |
| 29 | + |
| 30 | +// Check that -Xarch_host -fsplit-machine-functions does not cause any warning. |
| 31 | +// RUN: %clang --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \ |
| 32 | +// RUN --cuda-gpu-arch=sm_70 -x cuda -Xarch_host \ |
| 33 | +// RUN -fsplit-machine-functions -S %s || { echo \ |
| 34 | +// RUN "warning: -fsplit-machine-functions is not valid for" ; } \ |
| 35 | +// RUN 2>&1 | FileCheck %s --check-prefix=MFS4 |
| 36 | +// MFS4-NOT: warning: -fsplit-machine-functions is not valid for |
| 37 | + |
| 38 | +// Check that -Xarch_device -fsplit-machine-functions does cause the warning. |
| 39 | +// RUN: %clang --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \ |
| 40 | +// RUN: --cuda-gpu-arch=sm_70 -x cuda -Xarch_device \ |
| 41 | +// RUN: -fsplit-machine-functions -S %s 2>&1 | \ |
| 42 | +// RUN: FileCheck %s --check-prefix=MFS5 |
| 43 | +// MFS5: warning: -fsplit-machine-functions is not valid for |
| 44 | + |
| 45 | +// Check that -fsplit-machine-functions -Xarch_device |
| 46 | +// -fno-split-machine-functions only passes MFS to x86 |
| 47 | +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \ |
| 48 | +// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions \ |
| 49 | +// RUN: -Xarch_device -fno-split-machine-functions -S %s \ |
| 50 | +// RUN: 2>&1 | FileCheck %s --check-prefix=MFS6 |
| 51 | +// MFS6: "-target-cpu" "x86-64"{{.*}}"-fsplit-machine-functions" |
| 52 | +// MFS6-NOT: "-target-cpu" "sm_70"{{.*}}"-fsplit-machine-functions" |
| 53 | + |
| 54 | +// Check that -fsplit-machine-functions -Xarch_device |
| 55 | +// -fno-split-machine-functions has no warnings |
| 56 | +// RUN: %clang --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \ |
| 57 | +// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions \ |
| 58 | +// RUN: -Xarch_device -fno-split-machine-functions -S %s \ |
| 59 | +// RUN: || { echo "warning: -fsplit-machine-functions is not valid for"; } \ |
| 60 | +// RUN: 2>&1 | FileCheck %s --check-prefix=MFS7 |
| 61 | +// MFS7-NOT: warning: -fsplit-machine-functions is not valid for |
0 commit comments