mirror of
https://github.com/mirror/tinycc.git
synced 2026-09-01 12:07:53 +08:00
Add type promotion in comma expression and update testcase 94
This commit is contained in:
@@ -30,6 +30,12 @@ void void_foo(int i) {}
|
||||
|
||||
typedef int int_type1;
|
||||
|
||||
typedef int T[4];
|
||||
int f(T t)
|
||||
{
|
||||
return _Generic(t, __typeof__( ((void)0, (T){0}) ) : 1 );
|
||||
}
|
||||
|
||||
#define gen_sw(a) _Generic(a, const char *: 1, default: 8, int: 123);
|
||||
|
||||
int main()
|
||||
@@ -40,6 +46,7 @@ int main()
|
||||
const int * const ptr;
|
||||
const char *ti;
|
||||
int_type1 i2;
|
||||
T t;
|
||||
|
||||
i = _Generic(a, int: a_f, const int: b_f)();
|
||||
printf("%d\n", i);
|
||||
@@ -118,5 +125,7 @@ int main()
|
||||
(void)(sizeof(struct { int x:_Generic( 0?(int (*)[5])0 : ar, int (*)[5]:+1, int (*)[4]:(void)0); }));
|
||||
}
|
||||
|
||||
printf ("%d\n", f(t));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -13,3 +13,4 @@ long
|
||||
1
|
||||
3
|
||||
5
|
||||
1
|
||||
|
||||
Reference in New Issue
Block a user