File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
clang/test/CoverageMapping Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name statement-expression.c %s
2+
3+ // No crash for the following examples, where GNU Statement Expression extension
4+ // could introduce region terminators (break, goto etc) before implicit
5+ // initializers in a struct or an array.
6+ // See https://github.com/llvm/llvm-project/pull/89564
7+
8+ struct Foo {
9+ int field1 ;
10+ int field2 ;
11+ };
12+
13+ void f1 (void ) {
14+ struct Foo foo = {
15+ .field1 = ({
16+ switch (0 ) {
17+ case 0 :
18+ break ; // A region terminator
19+ }
20+ 0 ;
21+ }),
22+ // ImplicitValueInitExpr introduced here for .field2
23+ };
24+ }
25+
26+ void f2 (void ) {
27+ int arr [3 ] = {
28+ [0 ] = ({
29+ goto L0 ; // A region terminator
30+ L0 :
31+ 0 ;
32+ }),
33+ // ImplicitValueInitExpr introduced here for subscript [1]
34+ [2 ] = 0 ,
35+ };
36+ }
You can’t perform that action at this time.
0 commit comments