summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/Inputs/macros_left.h4
-rw-r--r--clang/test/Modules/Inputs/macros_right.h6
-rw-r--r--clang/test/Modules/Inputs/macros_top.h8
-rw-r--r--clang/test/Modules/macros.c14
4 files changed, 25 insertions, 7 deletions
diff --git a/clang/test/Modules/Inputs/macros_left.h b/clang/test/Modules/Inputs/macros_left.h
index 919dc20ebc9..a2f287e668a 100644
--- a/clang/test/Modules/Inputs/macros_left.h
+++ b/clang/test/Modules/Inputs/macros_left.h
@@ -7,6 +7,8 @@
#define LEFT_RIGHT_IDENTICAL int
-#define LEFT_RIGHT_DIFFERENT float
+
#define LEFT_RIGHT_DIFFERENT2 float
#define LEFT_RIGHT_DIFFERENT3 float
+
+#define LEFT_RIGHT_DIFFERENT float
diff --git a/clang/test/Modules/Inputs/macros_right.h b/clang/test/Modules/Inputs/macros_right.h
index 8e9688223bc..a4a1e2e0cfa 100644
--- a/clang/test/Modules/Inputs/macros_right.h
+++ b/clang/test/Modules/Inputs/macros_right.h
@@ -1,8 +1,8 @@
#include "macros_top.h"
#define RIGHT unsigned short
-#undef TOP_RIGHT_REDEF
-#define TOP_RIGHT_REDEF float
+
+
@@ -13,3 +13,5 @@
#define LEFT_RIGHT_DIFFERENT2 int
#define LEFT_RIGHT_DIFFERENT3 int
+#undef TOP_RIGHT_REDEF
+#define TOP_RIGHT_REDEF float
diff --git a/clang/test/Modules/Inputs/macros_top.h b/clang/test/Modules/Inputs/macros_top.h
index 1a21848f6c5..5264cea2d17 100644
--- a/clang/test/Modules/Inputs/macros_top.h
+++ b/clang/test/Modules/Inputs/macros_top.h
@@ -2,4 +2,12 @@
#define TOP_LEFT_UNDEF 1
+
+
+
+
+
+
+
+
#define TOP_RIGHT_REDEF int
diff --git a/clang/test/Modules/macros.c b/clang/test/Modules/macros.c
index 168e2c6fce6..8f6a20aa938 100644
--- a/clang/test/Modules/macros.c
+++ b/clang/test/Modules/macros.c
@@ -7,8 +7,14 @@
// RUN: %clang_cc1 -E -fmodules -x objective-c -fmodule-cache-path %t %s | FileCheck -check-prefix CHECK-PREPROCESSED %s
// FIXME: When we have a syntax for modules in C, use that.
// These notes come from headers in modules, and are bogus.
+
// FIXME: expected-note{{previous definition is here}}
-// FIXME: expected-note{{previous definition is here}}
+// expected-note{{other definition of 'LEFT_RIGHT_DIFFERENT'}}
+// expected-note{{expanding this definition of 'TOP_RIGHT_REDEF'}}
+// FIXME: expected-note{{previous definition is here}} \
+// expected-note{{expanding this definition of 'LEFT_RIGHT_DIFFERENT'}}
+
+// expected-note{{other definition of 'TOP_RIGHT_REDEF'}}
@__experimental_modules_import macros;
@@ -109,11 +115,11 @@ void test2() {
int i;
float f;
double d;
- TOP_RIGHT_REDEF *ip = &i; // FIXME: warning
+ TOP_RIGHT_REDEF *ip = &i; // expected-warning{{ambiguous expansion of macro 'TOP_RIGHT_REDEF'}}
LEFT_RIGHT_IDENTICAL *ip2 = &i;
- LEFT_RIGHT_DIFFERENT *fp = &f; // FIXME: warning
- LEFT_RIGHT_DIFFERENT2 *dp = &d; // okay
+ LEFT_RIGHT_DIFFERENT *fp = &f; // expected-warning{{ambiguous expansion of macro 'LEFT_RIGHT_DIFFERENT'}}
+ LEFT_RIGHT_DIFFERENT2 *dp = &d;
int LEFT_RIGHT_DIFFERENT3;
}
OpenPOWER on IntegriCloud