[ELF] Reorder SectionBase/InputSectionBase members
[llvm-project.git] / clang / test / CoverageMapping / statement-expression.c
blob5f9ab5838af3423f6a45ab445d8c4b36997177a4
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
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
8 struct Foo {
9 int field1;
10 int field2;
13 void f1(void) {
14 struct Foo foo = {
15 .field1 = ({
16 switch (0) {
17 case 0:
18 break; // A region terminator
21 }),
22 // ImplicitValueInitExpr introduced here for .field2
26 void f2(void) {
27 int arr[3] = {
28 [0] = ({
29 goto L0; // A region terminator
30 L0:
32 }),
33 // ImplicitValueInitExpr introduced here for subscript [1]
34 [2] = 0,