| 1 |
// RUN: %clang_cc1 %s -E -dM -o - -triple dxil-pc-shadermodel6.0-amplification | FileCheck -match-full-lines %s --check-prefixes=CHECK,AMPLIFICATION,NOHALF |
| 2 |
// RUN: %clang_cc1 %s -E -dM -o - -triple dxil-pc-shadermodel6.0-compute | FileCheck -match-full-lines %s --check-prefixes=CHECK,COMPUTE,NOHALF |
| 3 |
// RUN: %clang_cc1 %s -E -dM -o - -triple dxil-pc-shadermodel6.0-domain | FileCheck -match-full-lines %s --check-prefixes=CHECK,DOMAIN,NOHALF |
| 4 |
// RUN: %clang_cc1 %s -E -dM -o - -triple dxil-pc-shadermodel6.0-geometry | FileCheck -match-full-lines %s --check-prefixes=CHECK,GEOMETRY,NOHALF |
| 5 |
// RUN: %clang_cc1 %s -E -dM -o - -triple dxil-pc-shadermodel6.0-hull | FileCheck -match-full-lines %s --check-prefixes=CHECK,HULL,NOHALF |
| 6 |
// RUN: %clang_cc1 %s -E -dM -o - -triple dxil-pc-shadermodel6.0-library | FileCheck -match-full-lines %s --check-prefixes=CHECK,LIBRARY,NOHALF |
| 7 |
// RUN: %clang_cc1 %s -E -dM -o - -triple dxil-pc-shadermodel6.0-mesh | FileCheck -match-full-lines %s --check-prefixes=CHECK,MESH,NOHALF |
| 8 |
// RUN: %clang_cc1 %s -E -dM -o - -triple dxil-pc-shadermodel6.0-pixel | FileCheck -match-full-lines %s --check-prefixes=CHECK,PIXEL,NOHALF |
| 9 |
// RUN: %clang_cc1 %s -E -dM -o - -triple dxil-pc-shadermodel6.0-vertex | FileCheck -match-full-lines %s --check-prefixes=CHECK,VERTEX,NOHALF |
| 10 |
// RUN: %clang_cc1 %s -E -dM -o - -triple dxil-pc-shadermodel6.3-vertex -fnative-half-type -fnative-int16-type | FileCheck -match-full-lines %s --check-prefixes=CHECK,VERTEX,HALF |
| 11 |
|
| 12 |
// RUN: %clang_cc1 %s -E -dM -o - -triple spirv-unknown-vulkan-compute | FileCheck -match-full-lines %s --check-prefixes=CHECK,COMPUTE,NOHALF,SPIRV |
| 13 |
|
| 14 |
// HALF: #define __HLSL_ENABLE_16_BIT 1 |
| 15 |
// NOHALF-NOT: __HLSL_ENABLE_16_BIT |
| 16 |
|
| 17 |
// CHECK: #define __HLSL_VERSION 2028 |
| 18 |
|
| 19 |
// CHECK: #define __SHADER_STAGE_AMPLIFICATION 14 |
| 20 |
// CHECK: #define __SHADER_STAGE_COMPUTE 5 |
| 21 |
// CHECK: #define __SHADER_STAGE_DOMAIN 4 |
| 22 |
// CHECK: #define __SHADER_STAGE_GEOMETRY 2 |
| 23 |
// CHECK: #define __SHADER_STAGE_HULL 3 |
| 24 |
// CHECK: #define __SHADER_STAGE_LIBRARY 6 |
| 25 |
// CHECK: #define __SHADER_STAGE_MESH 13 |
| 26 |
// CHECK: #define __SHADER_STAGE_PIXEL 0 |
| 27 |
// CHECK: #define __SHADER_STAGE_VERTEX 1 |
| 28 |
|
| 29 |
// AMPLIFICATION: #define __SHADER_TARGET_STAGE 14 |
| 30 |
// COMPUTE: #define __SHADER_TARGET_STAGE 5 |
| 31 |
// DOMAIN: #define __SHADER_TARGET_STAGE 4 |
| 32 |
// GEOMETRY: #define __SHADER_TARGET_STAGE 2 |
| 33 |
// HULL: #define __SHADER_TARGET_STAGE 3 |
| 34 |
// LIBRARY: #define __SHADER_TARGET_STAGE 6 |
| 35 |
// MESH: #define __SHADER_TARGET_STAGE 13 |
| 36 |
// PIXEL: #define __SHADER_TARGET_STAGE 0 |
| 37 |
// VERTEX: #define __SHADER_TARGET_STAGE 1 |
| 38 |
|
| 39 |
// SPIRV: #define __spirv__ 1 |
| 40 |
|
| 41 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library %s -E -dM -o - -x hlsl -std=hlsl2015 2>&1 | FileCheck -match-full-lines %s --check-prefixes=STD2015 |
| 42 |
// STD2015: warning: support for HLSL language version hlsl2015 is incomplete, recommend using hlsl202x instead |
| 43 |
// STD2015: #define __HLSL_VERSION 2015 |
| 44 |
|
| 45 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library %s -E -dM -o - -x hlsl -std=hlsl2016 2>&1 | FileCheck -match-full-lines %s --check-prefixes=STD2016 |
| 46 |
// STD2016: warning: support for HLSL language version hlsl2016 is incomplete, recommend using hlsl202x instead |
| 47 |
// STD2016: #define __HLSL_VERSION 2016 |
| 48 |
|
| 49 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library %s -E -dM -o - -x hlsl -std=hlsl2017 2>&1 | FileCheck -match-full-lines %s --check-prefixes=STD2017 |
| 50 |
// STD2017: warning: support for HLSL language version hlsl2017 is incomplete, recommend using hlsl202x instead |
| 51 |
// STD2017: #define __HLSL_VERSION 2017 |
| 52 |
|
| 53 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library %s -E -dM -o - -x hlsl -std=hlsl2018 2>&1 | FileCheck -match-full-lines %s --check-prefixes=STD2018 |
| 54 |
// STD2018: warning: support for HLSL language version hlsl2018 is incomplete, recommend using hlsl202x instead |
| 55 |
// STD2018: #define __HLSL_VERSION 2018 |
| 56 |
|
| 57 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library %s -E -dM -o - -x hlsl -std=hlsl2021 2>&1 | FileCheck -match-full-lines %s --check-prefixes=STD2021 |
| 58 |
// STD2021: warning: support for HLSL language version hlsl2021 is incomplete, recommend using hlsl202x instead |
| 59 |
// STD2021: #define __HLSL_VERSION 2021 |
| 60 |
|
| 61 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library %s -E -dM -o - -x hlsl -std=hlsl202x | FileCheck -match-full-lines %s --check-prefixes=STD202x |
| 62 |
// STD202x-NOT: warning |
| 63 |
// STD202x: #define __HLSL_VERSION 2028 |
| 64 |
|
| 65 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library %s -E -dM -o - -x hlsl -std=hlsl202y | FileCheck -match-full-lines %s --check-prefixes=STD202y |
| 66 |
// STD202y-NOT: warning |
| 67 |
// STD202y: #define __HLSL_VERSION 2029 |