1 // RUN: %check_clang_tidy -std=c99 %s bugprone-suspicious-semicolon %t -- -- -fno-objc-arc -fobjc-abi-version=1
3 // This test ensures check_clang_tidy.py allows disabling Objective-C ARC and
4 // Objective-C 2.0 via passing arguments after -- on the command line.
6 // (We could include a test which doesn't pass any arguments after --
7 // to check if ARC and ObjC 2.0 are disabled by default, but that test
8 // could change behavior based on the default Objective-C runtime for
9 // the platform, which would make this test flaky.)
11 #if __has_feature(objc_arc)
12 #error Objective-C ARC unexpectedly enabled even with -fno-objc-arc
16 #error Objective-C 2.0 unexpectedly enabled even with -fobjc-abi-version=1
26 if([f shouldDoStuff]); [f nop];
27 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: potentially unintended semicolon [bugprone-suspicious-semicolon]
28 // CHECK-FIXES: if([f shouldDoStuff]) [f nop];