llvm-project
18 строк · 880.0 Байт
1// CPU-side compilation on x86 (no errors expected).
2// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -aux-triple nvptx64 -x cuda -fsyntax-only -verify=cpu %s
3
4// GPU-side compilation on x86 (no errors expected)
5// RUN: %clang_cc1 -triple nvptx64 -aux-triple x86_64-unknown-linux-gnu -fcuda-is-device -x cuda -fsyntax-only -verify=gpu %s
6
7// cpu-no-diagnostics
8typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
9typedef __float128 _Float128;
10
11// gpu-note@+1 {{'a' defined here}}
12__attribute__((device)) __float128 f(__float128 a, float b) {
13// gpu-note@+1 {{'c' defined here}}
14__float128 c = b + 1.0;
15// gpu-error@+2 {{'a' requires 128 bit size '__float128' type support, but target 'nvptx64' does not support it}}
16// gpu-error@+1 {{'c' requires 128 bit size '__float128' type support, but target 'nvptx64' does not support it}}
17return a + c;
18}