File: target-builtin-error-3.c

package info (click to toggle)
llvm-toolchain-snapshot 1%3A21~%2B%2B20250612091244%2B3f0cf742ac4e-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,204,364 kB
  • sloc: cpp: 7,565,811; ansic: 1,415,365; asm: 1,031,257; python: 250,248; f90: 93,670; objc: 70,556; lisp: 41,926; pascal: 17,847; sh: 10,009; ml: 5,111; perl: 4,720; awk: 3,523; makefile: 3,423; javascript: 2,272; xml: 892; fortran: 763
file content (29 lines) | stat: -rw-r--r-- 1,514 bytes parent folder | download | duplicates (21)
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
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -S -verify -o - -target-feature +avx

// RUN: not %clang_cc1 %s -triple=x86_64-apple-darwin -emit-obj -target-feature +avx 2> %t.err
// RUN: FileCheck < %t.err %s
// CHECK: 1 error generated

typedef unsigned short uint16_t;
typedef long long __m128i __attribute__((__vector_size__(16)));
typedef float __v8sf __attribute__ ((__vector_size__ (32)));
typedef float __m256 __attribute__ ((__vector_size__ (32)));
typedef uint16_t half;
typedef __attribute__ ((ext_vector_type( 8),__aligned__( 16))) half half8;
typedef __attribute__ ((ext_vector_type(16),__aligned__( 32))) half half16;
typedef __attribute__ ((ext_vector_type(16),__aligned__( 2))) half half16U;
typedef __attribute__ ((ext_vector_type( 8),__aligned__( 32))) float float8;
typedef __attribute__ ((ext_vector_type(16),__aligned__( 64))) float float16;
static inline half8 __attribute__((__overloadable__)) convert_half( float8 a ) {
  return __extension__ ({ __m256 __a = (a); (__m128i)__builtin_ia32_vcvtps2ph256((__v8sf)__a, (0x00)); }); // expected-error {{'__builtin_ia32_vcvtps2ph256' needs target feature f16c}}
}
static inline half16 __attribute__((__overloadable__)) convert_half( float16 a ) {
  half16 r;
  r.lo = convert_half(a.lo);
  return r;
}
void avx_test( uint16_t *destData, float16 argbF)
{
  // expected-warning@+1{{AVX vector argument of type 'float16' (vector of 16 'float' values) without 'avx512f' enabled changes the ABI}}
  ((half16U *)destData)[0] = convert_half(argbF);
}