diff options
Diffstat (limited to 'test/FixIt/fixit.c')
-rw-r--r-- | test/FixIt/fixit.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/FixIt/fixit.c b/test/FixIt/fixit.c index ba45cf28e694..5ba0aac4509b 100644 --- a/test/FixIt/fixit.c +++ b/test/FixIt/fixit.c @@ -1,7 +1,7 @@ // RUN: cp %s %t -// RUN: %clang_cc1 -pedantic -fixit -x c %t || true +// RUN: not %clang_cc1 -pedantic -Wunused-label -fixit -x c %t // RUN: grep -v CHECK %t > %t2 -// RUN: %clang_cc1 -pedantic -Werror -x c %t +// RUN: %clang_cc1 -pedantic -Wunused-label -Werror -x c %t // RUN: FileCheck -input-file=%t2 %t /* This is a test of the various code modification hints that are @@ -59,3 +59,14 @@ struct test_struct { // CHECK: struct test_struct *struct_ptr; test_struct *struct_ptr; // expected-error {{must use 'struct' tag to refer to type 'test_struct'}} }; + +void removeUnusedLabels(char c) { + L0 /*removed comment*/: c++; + removeUnusedLabels(c); + L1: + c++; + /*preserved comment*/ L2 : c++; + LL + : c++; + c = c + 3; L4: return; +} |