History

Add type promotion in comma expression and update testcase 94

herman ten brugge committed 2 years ago

Commit c13bbb51 parent 6379f2e3 files · +16 −3Browse files

Showing the changes to tests (2 of 3 files). Show all

Unified · Split

2 files
  1. tests/tests2/94_generic.c +9 −0
  2. tests/tests2/94_generic.expect +1 −0
tests/tests2/94_generic.c+9−0
@@ -30,6 +30,12 @@ void void_foo(int i) {} · 29 unmodified lines
3030
3131 typedef int int_type1;
3232
33+typedef int T[4];
34+int f(T t)
35+{
36+ return _Generic(t, __typeof__( ((void)0, (T){0}) ) : 1 );
37+}
38+
3339 #define gen_sw(a) _Generic(a, const char *: 1, default: 8, int: 123);
3440
3541 int main()
@@ -40,6 +46,7 @@ int main() · 4 unmodified lines
4046 const int * const ptr;
4147 const char *ti;
4248 int_type1 i2;
49+ T t;
4350
4451 i = _Generic(a, int: a_f, const int: b_f)();
4552 printf("%d\n", i);
@@ -118,5 +125,7 @@ int main() · 72 unmodified lines
118125 (void)(sizeof(struct { int x:_Generic( 0?(int (*)[5])0 : ar, int (*)[5]:+1, int (*)[4]:(void)0); }));
119126 }
120127
128+ printf ("%d\n", f(t));
129+
121130 return 0;
122131 }
tests/tests2/94_generic.expect+1−0
@@ -13,3 +13,4 @@ long · 12 unmodified lines
1313 1
1414 3
1515 5
16+1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t