summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/cpp11-migrate/UseNullptr/macros.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/cpp11-migrate/UseNullptr/macros.cpp')
-rw-r--r--clang-tools-extra/test/cpp11-migrate/UseNullptr/macros.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/clang-tools-extra/test/cpp11-migrate/UseNullptr/macros.cpp b/clang-tools-extra/test/cpp11-migrate/UseNullptr/macros.cpp
index 28de7458c60..8e19e4ab6dc 100644
--- a/clang-tools-extra/test/cpp11-migrate/UseNullptr/macros.cpp
+++ b/clang-tools-extra/test/cpp11-migrate/UseNullptr/macros.cpp
@@ -39,8 +39,22 @@ void test_macro_expansion1() {
#undef MACRO_EXPANSION_HAS_NULL
}
+// Test macro expansion with cast sequence, PR15572
void test_macro_expansion2() {
#define MACRO_EXPANSION_HAS_NULL \
+ dummy((int*)0); \
+ side_effect();
+ // CHECK: dummy((int*)0); \
+ // CHECK-NEXT: side_effect();
+
+ MACRO_EXPANSION_HAS_NULL;
+ // CHECK: MACRO_EXPANSION_HAS_NULL;
+
+#undef MACRO_EXPANSION_HAS_NULL
+}
+
+void test_macro_expansion3() {
+#define MACRO_EXPANSION_HAS_NULL \
dummy(NULL); \
side_effect();
// CHECK: dummy(NULL); \
@@ -57,7 +71,7 @@ void test_macro_expansion2() {
#undef MACRO_EXPANSION_HAS_NULL
}
-void test_macro_expansion3() {
+void test_macro_expansion4() {
#define MY_NULL NULL
int *p = MY_NULL;
// CHECK: int *p = MY_NULL;
@@ -91,5 +105,3 @@ void test_function_like_macro2() {
// CHECK: my_macro(p != nullptr);
#undef my_macro
}
-
-
OpenPOWER on IntegriCloud