aboutsummaryrefslogtreecommitdiffstats
path: root/test/Sema/Inputs/diagnose-if-warn-system-header.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/Inputs/diagnose-if-warn-system-header.h')
-rw-r--r--test/Sema/Inputs/diagnose-if-warn-system-header.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Sema/Inputs/diagnose-if-warn-system-header.h b/test/Sema/Inputs/diagnose-if-warn-system-header.h
new file mode 100644
index 000000000000..753c69d4b532
--- /dev/null
+++ b/test/Sema/Inputs/diagnose-if-warn-system-header.h
@@ -0,0 +1,11 @@
+#pragma GCC system_header
+
+inline int system_header_func(int x)
+ __attribute__((diagnose_if(x == x, "system header warning", "warning"))) // expected-note {{from 'diagnose_if' attribute}}
+{
+ return 0;
+}
+
+void test_system_header() {
+ system_header_func(0); // expected-warning {{system header warning}}
+}