Nico Weber | 93dec51 | 2012-09-26 08:19:01 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -E -fms-compatibility %s -o %t |
| 2 | // RUN: FileCheck %s < %t |
Joao Matos | 181cd5b | 2012-08-31 21:10:54 +0000 | [diff] [blame] | 3 | |
| 4 | # define M2(x, y) x + y |
| 5 | # define P(x, y) {x, y} |
| 6 | # define M(x, y) M2(x, P(x, y)) |
| 7 | M(a, b) // CHECK: a + {a, b} |
Nico Weber | 93dec51 | 2012-09-26 08:19:01 +0000 | [diff] [blame] | 8 | |
| 9 | // Regression test for PR13924 |
| 10 | #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar) |
| 11 | #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar |
| 12 | |
| 13 | #define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2 |
| 14 | |
| 15 | #define GMOCK_ACTION_CLASS_(name, value_params)\ |
| 16 | GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params) |
| 17 | |
| 18 | #define ACTION_TEMPLATE(name, template_params, value_params)\ |
| 19 | class GMOCK_ACTION_CLASS_(name, value_params) {\ |
| 20 | } |
| 21 | |
| 22 | ACTION_TEMPLATE(InvokeArgument, |
| 23 | HAS_1_TEMPLATE_PARAMS(int, k), |
| 24 | AND_2_VALUE_PARAMS(p0, p1)); |