aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/eval/asm-degen.c
diff options
Diffstat (limited to 'validation/eval/asm-degen.c')
-rw-r--r--validation/eval/asm-degen.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/validation/eval/asm-degen.c b/validation/eval/asm-degen.c
new file mode 100644
index 00000000..5f319159
--- /dev/null
+++ b/validation/eval/asm-degen.c
@@ -0,0 +1,37 @@
+#ifdef __CHECKER__
+#define __percpu __attribute__((noderef))
+#else
+#define __percpu
+#endif
+
+static __percpu int var;
+static __percpu int arr[4];
+
+static void foo(void)
+{
+ asm("" :: "r" (var));
+}
+
+static void bar(void)
+{
+ asm("" :: "r" (arr));
+}
+
+static void baz(void)
+{
+ asm("" :: "m" (var));
+}
+
+static void qux(void)
+{
+ asm("" :: "m" (arr));
+}
+
+/*
+ * check-name: asm-degen
+ * check-known-to-fail
+ *
+ * check-error-start
+eval/asm-degen.c:12:24: warning: dereference of noderef expression
+ * check-error-end
+ */