File: sugar-common-types.c

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (44 lines) | stat: -rw-r--r-- 1,067 bytes parent folder | download | duplicates (10)
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'}}
}