File tree 3 files changed +43
-0
lines changed
3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: rm -rf %t*
2
+ // RUN: 3c -base-dir=%S -alltypes -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
3
+ // RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s
4
+ // RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null -
5
+ // RUN: 3c -base-dir=%S -output-dir=%t.checked -alltypes %s --
6
+ // RUN: 3c -base-dir=%t.checked -alltypes %t.checked/function_typedef.c -- | diff %t.checked/function_typedef.c
7
+
8
+ // Tests for the single file case in issue #430
9
+ // Functions declared using a typedef should be rewritten in a way that doesn't
10
+ // crash 3C or generate uncompilable code. The expected output for these tests
11
+ // expected to change when issue #437.
12
+
13
+ typedef void foo (int * );
14
+ foo foo_impl ;
15
+ void foo_imp (int * a ) {};
16
+
17
+ typedef int * bar ();
18
+ bar bar_impl ;
19
+ int * bar_impl () {
20
+ return 0 ;
21
+ };
22
+
23
+ typedef int * baz (int * );
24
+ baz baz_impl ;
25
+ int * baz_impl (int * a ) {
26
+ return 0 ;
27
+ };
Original file line number Diff line number Diff line change
1
+ // RUN: rm -rf %t*
2
+ // RUN: 3c -base-dir=%S -addcr -output-dir=%t.checked %S/function_typedef_multi.c %S/function_typedef_multi.h --
3
+ // RUN: test ! -f %t.checked/function_typedef_multi.h -a ! -f %t.checked/function_typedef_multi.c
4
+
5
+ // Test for the two file case in issue #430
6
+ // This test caused an assertion to fail prior to PR #436
7
+ // This test function_typedef_multi.h. The header is deliberately not included
8
+ // in this file. Including the header prevented the assertion fail even without
9
+ // the changes in PR #436.
10
+
11
+ int foo (int a , int b [1 ]) {
12
+ return 0 ;
13
+ }
Original file line number Diff line number Diff line change
1
+ // Used with function_typedef_multi.c
2
+ typedef int a (int , int [1 ]);
3
+ a foo ;
You can’t perform that action at this time.
0 commit comments