Skip to content

Commit 75d1cce

Browse files
committed
Add missing RUN lines to test
These were intended to be present when 00f9ef2 landed
1 parent e377dc4 commit 75d1cce

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

clang/test/Sema/warn-default-const-init.c

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1+
// Both of these should enable everything.
2+
// RUN: %clang_cc1 -fsyntax-only -verify=unsafe-var,unsafe-field,zero-init-var,zero-init-field -Wc++-compat %s
3+
// RUN: %clang_cc1 -fsyntax-only -verify=unsafe-var,unsafe-field,zero-init-var,zero-init-field -Wdefault-const-init %s
4+
5+
// This should enable nothing.
6+
// RUN: %clang_cc1 -fsyntax-only -verify=good -Wno-default-const-init-unsafe %s
7+
8+
// Only unsafe field and variable diagnostics
9+
// RUN: %clang_cc1 -fsyntax-only -verify=unsafe-var,unsafe-field %s
110
// RUN: %clang_cc1 -fsyntax-only -verify=unsafe-var,unsafe-field -Wdefault-const-init-unsafe %s
211

12+
// Only zero init field and variable diagnostics
13+
// RUN: %clang_cc1 -fsyntax-only -verify=zero-init-var,zero-init-field -Wdefault-const-init -Wno-default-const-init-unsafe %s
14+
15+
// Only zero init and unsafe field diagnostics
16+
// RUN: %clang_cc1 -fsyntax-only -verify=zero-init-field,unsafe-field -Wno-default-const-init-var-unsafe -Wdefault-const-init-field %s
17+
18+
// Only zero init and unsafe variable diagnostics
19+
// RUN: %clang_cc1 -fsyntax-only -verify=zero-init-var,unsafe-var -Wno-default-const-init-field-unsafe -Wdefault-const-init-var %s
20+
21+
// C++ tests
22+
// RUN: %clang_cc1 -fsyntax-only -verify=cxx -x c++ %s
23+
24+
// good-no-diagnostics
25+
326
struct A { int i; };
427
struct S{ const int i; }; // unsafe-field-note 2 {{member 'i' declared 'const' here}} \
528
cxx-note 3 {{default constructor of 'S' is implicitly deleted because field 'i' of const-qualified type 'const int' would not be initialized}}
@@ -45,7 +68,7 @@ static const int j; // zero-init-var-warning {{default initialization of an obje
4568
cxx-error {{default initialization of an object of const type 'const int'}}
4669
const int k; // zero-init-var-warning {{default initialization of an object of type 'const int' is incompatible with C++}} \
4770
cxx-error {{default initialization of an object of const type 'const int'}}
48-
const struct S s; // zero-init-field-warning {{default initialization of an object of type 'const struct S' is incompatible with C++}} \
71+
const struct S s; // zero-init-var-warning {{default initialization of an object of type 'const struct S' is incompatible with C++}} \
4972
cxx-error {{call to implicitly-deleted default constructor of 'const struct S'}}
5073

5174
void func() {

0 commit comments

Comments
 (0)