summaryrefslogtreecommitdiffstats
path: root/tests/preprocessor
diff options
context:
space:
mode:
Diffstat (limited to 'tests/preprocessor')
-rw-r--r--tests/preprocessor/include/include-pragma-once-c.h5
-rw-r--r--tests/preprocessor/output-includes.slang10
-rw-r--r--tests/preprocessor/output-includes.slang.expected15
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/preprocessor/include/include-pragma-once-c.h b/tests/preprocessor/include/include-pragma-once-c.h
new file mode 100644
index 000000000..5c07d2846
--- /dev/null
+++ b/tests/preprocessor/include/include-pragma-once-c.h
@@ -0,0 +1,5 @@
+// include-pragma-once-c.h
+
+#pragma once
+
+#include "pragma-once-c.h" \ No newline at end of file
diff --git a/tests/preprocessor/output-includes.slang b/tests/preprocessor/output-includes.slang
new file mode 100644
index 000000000..9e40056ed
--- /dev/null
+++ b/tests/preprocessor/output-includes.slang
@@ -0,0 +1,10 @@
+//DIAGNOSTIC_TEST:SIMPLE:-output-includes
+
+int foo() { return 0; }
+
+#include "include-a.slang.h"
+#include "include/include-pragma-once-c.h"
+#include "../preprocessor/include-a.slang.h"
+#include "./include-a.slang.h"
+
+int baz() { return bar(); } \ No newline at end of file
diff --git a/tests/preprocessor/output-includes.slang.expected b/tests/preprocessor/output-includes.slang.expected
new file mode 100644
index 000000000..791621aa3
--- /dev/null
+++ b/tests/preprocessor/output-includes.slang.expected
@@ -0,0 +1,15 @@
+result code = -1
+standard error = {
+(0): note: include 'tests/preprocessor/output-includes.slang'
+(0): note: include 'tests/preprocessor/include-a.slang.h'
+(0): note: include 'tests/preprocessor/include/include-pragma-once-c.h'
+(0): note: include 'tests/preprocessor/include/pragma-once-c.h'
+(0): note: include 'tests/preprocessor/include-a.slang.h'
+(0): note: include 'tests/preprocessor/include-a.slang.h'
+tests/preprocessor/include-a.slang.h(3): error 30201: function 'bar' already has a body
+tests/preprocessor/include-a.slang.h(3): note: see previous definition of 'bar'
+tests/preprocessor/include-a.slang.h(3): error 30201: function 'bar' already has a body
+tests/preprocessor/include-a.slang.h(3): note: see previous definition of 'bar'
+}
+standard output = {
+}