File: sugar-common-types.c

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 (44 lines) | stat: -rw-r--r-- 1,067 bytes parent folder | download | duplicates (14)
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
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c99 -triple aarch64 -target-feature +bf16 -target-feature +sve

typedef struct N {} N;

typedef int B1;
typedef B1 X1;
typedef B1 Y1;

typedef void B2;
typedef B2 X2;
typedef B2 Y2;

typedef struct B3 {} B3;
typedef B3 X3;
typedef B3 Y3;

typedef struct B4 {} *B4;
typedef B4 X4;
typedef B4 Y4;

typedef __bf16 B5;
typedef B5 X5;
typedef B5 Y5;

typedef __SVInt8_t B6;
typedef B6 X6;
typedef B6 Y6;

N t1 = 0 ? (X1)0 : (Y1)0;   // expected-error {{incompatible type 'B1'}}
N t2 = 0 ? (X2)0 : 0;       // expected-error {{incompatible type 'X2'}}
N t3 = 0 ? 0 : (Y2)0;       // expected-error {{incompatible type 'Y2'}}
N t4 = 0 ? (X2)0 : (Y2)0;   // expected-error {{incompatible type 'B2'}}
N t5 = 0 ? (X3){} : (Y3){}; // expected-error {{incompatible type 'B3'}}
N t6 = 0 ? (X4)0 : (Y4)0;   // expected-error {{incompatible type 'B4'}}

X5 x5;
Y5 y5;
N t7 = 0 ? x5 : y5; // expected-error {{incompatible type 'B5'}}

void f8() {
  X6 x6;
  Y6 y6;
  N t8 = 0 ? x6 : y6; // expected-error {{incompatible type 'B6'}}
}