25 lines · c
1/* RUN: %clang_cc1 -std=c99 -verify -emit-llvm -o - %s | FileCheck %s2 RUN: %clang_cc1 -std=c11 -verify -emit-llvm -o - %s | FileCheck %s3 RUN: %clang_cc1 -std=c17 -verify -emit-llvm -o - %s | FileCheck %s4 RUN: %clang_cc1 -std=c2x -verify -emit-llvm -o - %s | FileCheck %s5 */6 7/* WG14 DR208: yes8 * Ambiguity in initialization9 */10int dr208_init(int);11void dr208(void) {12 int a[2] = {13 dr208_init(0), /* expected-note {{previous initialization with side effects is here (side effects will not occur at run time)}} */14 dr208_init(1),15 [0] = dr208_init(2) /* expected-warning {{initializer overrides prior initialization of this subobject}} */16 };17 18 /* CHECK-NOT: call {{signext i32|i32}} @dr208_init(i32 noundef {{(signext )?}}0)19 CHECK-DAG: call {{signext i32|i32}} @dr208_init(i32 noundef {{(signext )?}}1)20 CHECK-DAG: call {{signext i32|i32}} @dr208_init(i32 noundef {{(signext )?}}2)21 CHECK-NOT: call {{signext i32|i32}} @dr208_init(i32 noundef {{(signext )?}}0)22 */23}24 25