summaryrefslogtreecommitdiff
path: root/tests/diagnostics
diff options
context:
space:
mode:
Diffstat (limited to 'tests/diagnostics')
-rw-r--r--tests/diagnostics/size-of.slang8
-rw-r--r--tests/diagnostics/size-of.slang.expected8
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/diagnostics/size-of.slang b/tests/diagnostics/size-of.slang
new file mode 100644
index 000000000..63c55398e
--- /dev/null
+++ b/tests/diagnostics/size-of.slang
@@ -0,0 +1,8 @@
+// sizeof.slang
+
+//DIAGNOSTIC_TEST:SIMPLE:
+
+int func()
+{
+ return sizeof(func);
+}
diff --git a/tests/diagnostics/size-of.slang.expected b/tests/diagnostics/size-of.slang.expected
new file mode 100644
index 000000000..19c837799
--- /dev/null
+++ b/tests/diagnostics/size-of.slang.expected
@@ -0,0 +1,8 @@
+result code = -1
+standard error = {
+tests/diagnostics/size-of.slang(7): error 30099: argument to sizeof is invalid
+ return sizeof(func);
+ ^~~~~~
+}
+standard output = {
+}