32 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -Wno-all -Wunsafe-buffer-usage -verify %s -std=c++202// RUN: %clang_cc1 -fsyntax-only -Wno-all -Wunsafe-buffer-usage -verify %s -x c3// expected-no-diagnostics4 5typedef struct {} FILE;6int fprintf( FILE* stream, const char* format, ... );7FILE * stderr;8 9#define DEBUG_ASSERT_MESSAGE(name, assertion, label, message, file, line, value) \10 fprintf(stderr, "AssertMacros: %s, %s file: %s, line: %d, value: %lld\n", \11 assertion, (message!=0) ? message : "", file, line, (long long) (value));12 13 14#define Require(assertion, exceptionLabel) \15 do \16 { \17 if ( __builtin_expect(!(assertion), 0) ) { \18 DEBUG_ASSERT_MESSAGE( \19 "DEBUG_ASSERT_COMPONENT_NAME_STRING", \20 #assertion, #exceptionLabel, 0, __FILE__, __LINE__, 0); \21 goto exceptionLabel; \22 } \23 } while ( 0 )24 25 26void f(int x, int y) {27 Require(x == y, L1);28 L1:29 return;30}31 32