21 lines · c
1// Example from C99 6.10.3.4p92 3// RUN: %clang_cc1 -E %s | FileCheck -strict-whitespace %s4 5#define debug(...) fprintf(stderr, __VA_ARGS__) 6#define showlist(...) puts(#__VA_ARGS__) 7#define report(test, ...) ((test)?puts(#test):\8 printf(__VA_ARGS__)) 9debug("Flag");10// CHECK: fprintf(stderr, "Flag");11 12debug("X = %d\n", x);13// CHECK: fprintf(stderr, "X = %d\n", x);14 15showlist(The first, second, and third items.);16// CHECK: puts("The first, second, and third items.");17 18report(x>y, "x is %d but y is %d", x, y);19// CHECK: ((x>y)?puts("x>y"): printf("x is %d but y is %d", x, y));20 21