forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsycl-nvptx-id-queries-fit-in-int.cpp
More file actions
44 lines (35 loc) · 2.2 KB
/
sycl-nvptx-id-queries-fit-in-int.cpp
File metadata and controls
44 lines (35 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// REQUIRES: nvptx-registered-target
// Test default behavior (no flag specified - should not add NVVM flag)
// RUN: %clang -### -fno-sycl-libspirv -nocudalib \
// RUN: -fsycl -fsycl-targets=nvptx64-nvidia-cuda %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s
// Test new normalized option with different values
// RUN: %clang -### -fno-sycl-libspirv -nocudalib \
// RUN: -fsycl -fsycl-targets=nvptx64-nvidia-cuda -fsycl-id-queries-range=int %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-INT %s
// RUN: %clang -### -fno-sycl-libspirv -nocudalib \
// RUN: -fsycl -fsycl-targets=nvptx64-nvidia-cuda -fsycl-id-queries-range=uint %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-UINT %s
// RUN: %clang -### -fno-sycl-libspirv -nocudalib \
// RUN: -fsycl -fsycl-targets=nvptx64-nvidia-cuda -fsycl-id-queries-range=size_t %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s
// Test legacy compatibility flags
// RUN: %clang -### -fno-sycl-libspirv -nocudalib \
// RUN: -fsycl -fsycl-targets=nvptx64-nvidia-cuda -fsycl-id-queries-fit-in-int %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-INT %s
// RUN: %clang -### -fno-sycl-libspirv -nocudalib \
// RUN: -fsycl -fsycl-targets=nvptx64-nvidia-cuda -fno-sycl-id-queries-fit-in-int %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s
// Test precedence: last one wins
// RUN: %clang -### -fno-sycl-libspirv -nocudalib \
// RUN: -fsycl -fsycl-targets=nvptx64-nvidia-cuda -fsycl-id-queries-range=uint -fsycl-id-queries-fit-in-int %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-INT %s
// RUN: %clang -### -fno-sycl-libspirv -nocudalib \
// RUN: -fsycl -fsycl-targets=nvptx64-nvidia-cuda -fsycl-id-queries-fit-in-int -fsycl-id-queries-range=size_t %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s
// CHECK-INT: "-mllvm" "-nvvm-reflect-add=__CUDA_ID_QUERIES_FIT_IN_INT=1"
// CHECK-INT-NOT: "-nvvm-reflect-add=__CUDA_ID_QUERIES_FIT_IN_UINT=1"
// CHECK-UINT: "-mllvm" "-nvvm-reflect-add=__CUDA_ID_QUERIES_FIT_IN_UINT=1"
// CHECK-UINT-NOT: "-nvvm-reflect-add=__CUDA_ID_QUERIES_FIT_IN_INT=1"
// CHECK-DEFAULT-NOT: "-nvvm-reflect-add=__CUDA_ID_QUERIES_FIT_IN_INT=1"
// CHECK-DEFAULT-NOT: "-nvvm-reflect-add=__CUDA_ID_QUERIES_FIT_IN_UINT=1"