Clang Project

clang_source_code/test/Driver/cuda-march.cu
1// Checks that cuda compilation does the right thing when passed -march.
2// (Specifically, we want to pass it to host compilation, but not to device
3// compilation or ptxas!)
4//
5// REQUIRES: clang-driver
6// REQUIRES: x86-registered-target
7// REQUIRES: nvptx-registered-target
8
9// RUN: %clang -no-canonical-prefixes -### -target x86_64-linux-gnu -c \
10// RUN: -march=haswell %s 2>&1 | FileCheck %s
11// RUN: %clang -no-canonical-prefixes -### -target x86_64-linux-gnu -c \
12// RUN: -march=haswell --cuda-gpu-arch=sm_20 %s 2>&1 | FileCheck %s
13
14// CHECK: {{.*}}clang{{.*}}" "-cc1"
15// CHECK-SAME: "-triple" "nvptx
16// CHECK-SAME: "-target-cpu" "sm_20"
17
18// CHECK: ptxas
19// CHECK-SAME: "--gpu-name" "sm_20"
20
21// CHECK: {{.*}}clang{{.*}}" "-cc1"
22// CHECK-SAME: "-target-cpu" "haswell"
23