brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 5e88bb3 Raw
95 lines · cpp
1// RUN: %check_clang_tidy %s readability-avoid-unconditional-preprocessor-if %t2 3// CHECK-MESSAGES: :[[@LINE+1]]:2: warning: preprocessor condition is always 'false', consider removing both the condition and its contents [readability-avoid-unconditional-preprocessor-if]4#if 05// some code6#endif7 8// CHECK-MESSAGES: :[[@LINE+1]]:2: warning: preprocessor condition is always 'true', consider removing condition but leaving its contents [readability-avoid-unconditional-preprocessor-if]9#if 110// some code11#endif12 13#if test14 15#endif16 17// CHECK-MESSAGES: :[[@LINE+1]]:2: warning: preprocessor condition is always 'true', consider removing condition but leaving its contents [readability-avoid-unconditional-preprocessor-if]18#if 10>519 20#endif21 22// CHECK-MESSAGES: :[[@LINE+1]]:2: warning: preprocessor condition is always 'false', consider removing both the condition and its contents [readability-avoid-unconditional-preprocessor-if]23#if 10<524 25#endif26 27// CHECK-MESSAGES: :[[@LINE+1]]:2: warning: preprocessor condition is always 'true', consider removing condition but leaving its contents [readability-avoid-unconditional-preprocessor-if]28#if 10 > 529// some code30#endif31 32// CHECK-MESSAGES: :[[@LINE+1]]:2: warning: preprocessor condition is always 'false', consider removing both the condition and its contents [readability-avoid-unconditional-preprocessor-if]33#if 10 < 534// some code35#endif36 37// CHECK-MESSAGES: :[[@LINE+1]]:2: warning: preprocessor condition is always 'false', consider removing both the condition and its contents [readability-avoid-unconditional-preprocessor-if]38#if !(10 > \39        5)40// some code41#endif42 43// CHECK-MESSAGES: :[[@LINE+1]]:2: warning: preprocessor condition is always 'true', consider removing condition but leaving its contents [readability-avoid-unconditional-preprocessor-if]44#if !(10 < \45        5)46// some code47#endif48 49// CHECK-MESSAGES: :[[@LINE+1]]:2: warning: preprocessor condition is always 'true', consider removing condition but leaving its contents [readability-avoid-unconditional-preprocessor-if]50#if true51// some code52#endif53 54// CHECK-MESSAGES: :[[@LINE+1]]:2: warning: preprocessor condition is always 'false', consider removing both the condition and its contents [readability-avoid-unconditional-preprocessor-if]55#if false56// some code57#endif58 59#define MACRO60#ifdef MACRO61// some code62#endif63 64#if !SOMETHING65#endif66 67#if !( \68     defined MACRO)69// some code70#endif71 72 73#if __has_include(<string_view>)74// some code75#endif76 77#if __has_include(<string_view_not_exist>)78// some code79#endif80 81#define DDD 1782#define EEE 1883 84#if 10 > DDD85// some code86#endif87 88#if 10 < DDD89// some code90#endif91 92#if EEE > DDD93// some code94#endif95