[Mesa-dev] [PATCH 09/10] automake: nir: add a C++ compile time test

Emil Velikov emil.l.velikov at gmail.com
Wed Oct 7 03:11:36 PDT 2015


It should allow us to catch any constructs in our headers which are not
allowed in the C++ standard

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 src/glsl/Makefile.am            | 11 ++++++++++-
 src/glsl/nir/tests/cpp_test.cpp | 17 +++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 src/glsl/nir/tests/cpp_test.cpp

diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
index 3265391..fc57416 100644
--- a/src/glsl/Makefile.am
+++ b/src/glsl/Makefile.am
@@ -57,7 +57,8 @@ include Makefile.sources
 
 TESTS = glcpp/tests/glcpp-test				\
 	glcpp/tests/glcpp-test-cr-lf			\
-        nir/tests/control_flow_tests			\
+	nir/tests/cpp-test				\
+	nir/tests/control_flow_tests			\
 	tests/blob-test					\
 	tests/general-ir-test				\
 	tests/optimization-test				\
@@ -72,6 +73,7 @@ noinst_LTLIBRARIES = libnir.la libglsl.la libglcpp.la
 check_PROGRAMS =					\
 	glcpp/glcpp					\
 	glsl_test					\
+	nir/tests/cpp-test				\
 	nir/tests/control_flow_tests			\
 	tests/blob-test					\
 	tests/general-ir-test				\
@@ -267,6 +269,13 @@ nir/nir_opt_algebraic.c: nir/nir_opt_algebraic.py nir/nir_algebraic.py
 	$(MKDIR_GEN)
 	$(PYTHON_GEN) $(srcdir)/nir/nir_opt_algebraic.py > $@
 
+nir_tests_cpp_test_SOURCES =				\
+	nir/tests/cpp_test.cpp
+nir_tests_cpp_test_CFLAGS =				\
+	$(PTHREAD_CFLAGS)
+nir_tests_cpp_test_LDADD =				\
+	$(PTHREAD_LIBS)
+
 nir_tests_control_flow_tests_SOURCES =			\
 	nir/tests/control_flow_tests.cpp
 nir_tests_control_flow_tests_CFLAGS =			\
diff --git a/src/glsl/nir/tests/cpp_test.cpp b/src/glsl/nir/tests/cpp_test.cpp
new file mode 100644
index 0000000..1eb1983
--- /dev/null
+++ b/src/glsl/nir/tests/cpp_test.cpp
@@ -0,0 +1,17 @@
+#include "glsl_to_nir.h"
+#include "nir_worklist.h"
+#include "nir_vla.h"
+#include "nir_types.h"
+#include "nir_search.h"
+#include "nir_intrinsics.h"
+#include "nir_constant_expressions.h"
+#include "nir_builder_opcodes.h"
+#include "nir_builder.h"
+#include "nir_array.h"
+#include "nir.h"
+
+int
+main()
+{
+    return 0;
+}
-- 
2.5.0



More information about the mesa-dev mailing list