S. Bharadwaj Yadavalli 6d8901488f
[DXIL] Set DXIL Version in DXIL target triple based on shader model version (#91407)
This change set restores commit 080978dd2067d0c9ea7e229aa7696c2480d89ef1 that was reverted to address ASAN
failures and includes a fix for the ASAN failures. 

Following is the description of the change:

An earlier commit provided a way to decouple DXIL version from Shader
Model version by representing the DXIL version as `SubArch` in the DXIL
Target Triple and adding corresponding valid DXIL Arch types.
    
This change constructs DXIL target triple with DXIL version that is
deduced from Shader Model version specified in the following scenarios:
  
1. When compilation target profile is specified:
    For e.g., DXIL target triple `dxilv1.8-unknown-shader6.8-library` is
    constructed when `-T lib_6_8` is specified.
2. When DXIL target triple without DXIL version is specified:
    For e.g., DXIL target triple `dxilv1.8-pc-shadermodel6.8-library` is
    constructed when `-mtriple=dxil-pc-shadermodel6.8-library` is specified.
    
Updated relevant HLSL tests that check for target triple.
2024-05-08 12:20:41 -04:00

11 lines
809 B
C

// RUN: %clang -target dxil-pc-shadermodel6.0-pixel -S -emit-llvm -o - %s | FileCheck %s
// RUN: %clang -target dxil-pc-shadermodel6.0-vertex -S -emit-llvm -o - %s | FileCheck %s
// RUN: %clang -target dxil-pc-shadermodel6.0-compute -S -emit-llvm -o - %s | FileCheck %s
// RUN: %clang -target dxil-pc-shadermodel6.0-library -S -emit-llvm -o - %s | FileCheck %s
// RUN: %clang -target dxil-pc-shadermodel6.0-hull -S -emit-llvm -o - %s | FileCheck %s
// RUN: %clang -target dxil-pc-shadermodel6.0-domain -S -emit-llvm -o - %s | FileCheck %s
// RUN: %clang -target dxil-pc-shadermodel6.0-geometry -S -emit-llvm -o - %s | FileCheck %s
// CHECK: target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64"
// CHECK: target triple = "dxilv1.0-pc-shadermodel6.0-{{[a-z]+}}"