File: AddUint64-errors.hlsl

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,245,028 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,675; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (46 lines) | stat: -rw-r--r-- 1,645 bytes parent folder | download | duplicates (3)
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
45
46
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify

uint2 test_too_few_arg() {
  return __builtin_hlsl_adduint64();
  // expected-error@-1 {{too few arguments to function call, expected 2, have 0}}
}

uint4 test_too_many_arg(uint4 a) {
  return __builtin_hlsl_adduint64(a, a, a);
  // expected-error@-1 {{too many arguments to function call, expected 2, have 3}}
}

uint2 test_mismatched_arg_types(uint2 a, uint4 b) {
  return __builtin_hlsl_adduint64(a, b);
  // expected-error@-1 {{all arguments to '__builtin_hlsl_adduint64' must have the same type}}
}

uint2 test_bad_num_arg_elements(uint3 a, uint3 b) {
  return __builtin_hlsl_adduint64(a, b);
  // expected-error@-1 {{incorrect number of bits in vector operand (expected a multiple of 64 bits, have 96)}}
}

uint2 test_scalar_arg_type(uint a) {
  return __builtin_hlsl_adduint64(a, a);
  // expected-error@-1 {{1st argument must be a vector of unsigned integer types (was 'uint' (aka 'unsigned int'))}}
}

uint2 test_uint64_args(uint16_t2 a) {
  return __builtin_hlsl_adduint64(a, a);
  // expected-error@-1 {{incorrect number of bits in integer (expected 32 bits, have 16)}}
}

uint2 test_signed_integer_args(int2 a, int2 b) {
  return __builtin_hlsl_adduint64(a, b);
// expected-error@-1 {{1st argument must be a vector of unsigned integer types (was 'int2' (aka 'vector<int, 2>'))}}
}

struct S {
  uint2 a;
};

uint2 test_incorrect_arg_type(S a) {
  return __builtin_hlsl_adduint64(a, a);
  // expected-error@-1 {{1st argument must be a vector of unsigned integer types (was 'S')}}
}