peter klausler 01def7f7c3 [flang] Rework preprocessing of stringification
Hew more closely to the C17 standard; perform macro replacement
of arguments to function-like macros unless they're being stringified
or pasted.  Test with a model "assert" macro idiom that exposed
the problem.

Differential Revision: https://reviews.llvm.org/D87650
2020-09-18 10:45:57 -07:00

9 lines
343 B
Fortran

!RUN: %f18 -E %s 2>&1 | FileCheck %s
!CHECK: if(.not.(.true.)) error stop "assert(" // ".TRUE." // ") failed " // "at ""
!CHECK-SAME: assert.F90"": " // "7"
#define STR(x) #x
#define POSITION(f,ln) "at "f": " // STR(ln)
#define assert(x) if(.not.(x)) error stop "assert(" // #x // ") failed " // POSITION(__FILE__,__LINE__)
assert(.TRUE.)
end