xref: /aosp_15_r20/external/angle/third_party/glslang/src/Test/hlsl.numericsuffixes.frag (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1
2struct PS_OUTPUT { float4 color : SV_Target0; };
3
4#define BIN_UINT 0b00001u
5#define BIN_INT  0b00011
6
7PS_OUTPUT main()
8{
9    // Test numeric suffixes
10    float r00 = 1.0f;    // float
11    uint  r01 = 1u;      // lower uint
12    uint  r02 = 2U;      // upper uint
13    uint  r03 = 0xabcu;  // lower hex uint
14    uint  r04 = 0XABCU;  // upper hex uint
15    int   r05 = 5l;      // lower long int
16    int   r06 = 6L;      // upper long int
17    int   r07 = 071;     // octal
18    uint  r08 = 072u;    // unsigned octal
19    float r09 = 1.h;     // half
20    float r10 = 1.H;     // half
21    float r11 = 1.1h;    // half
22    float r12 = 1.1H;    // half
23    uint  r13 = 0b00001u;// lower binary uint
24    uint  r14 = 0B00010U;// upper binary uint
25    int   r15 = 0b00011; // lower binary int
26    int   r16 = 0B00100; // upper binary int
27    uint  r17 = BIN_UINT;// lower binart define uint
28    int   r18 = BIN_INT; // lower binart define int
29
30    PS_OUTPUT ps_output;
31    ps_output.color = r07; // gets 71 octal = 57 decimal
32    return ps_output;
33}
34