summaryrefslogtreecommitdiffstats
path: root/test/Preprocessor/mi_opt2.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Preprocessor/mi_opt2.c')
-rw-r--r--test/Preprocessor/mi_opt2.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Preprocessor/mi_opt2.c b/test/Preprocessor/mi_opt2.c
new file mode 100644
index 0000000..198d19f
--- /dev/null
+++ b/test/Preprocessor/mi_opt2.c
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -E %s | FileCheck %s
+// PR6282
+// This test should not trigger the include guard optimization since
+// the guard macro is defined on the first include.
+
+#define ITERATING 1
+#define X 1
+#include "mi_opt2.h"
+#undef X
+#define X 2
+#include "mi_opt2.h"
+
+// CHECK: b: 1
+// CHECK: b: 2
+
OpenPOWER on IntegriCloud