The test was trying to do too much by both checking for an error, and
checking the resulting assembly. Of course, due to the error no asm was
produced, so the scan-asm went unresolved. Split it into two separate
tests to fix the issue.
gcc/testsuite/
* gcc.target/bpf/memset-1.c: Move error test case to...
* gcc.target/bpf/memset-2.c: ... here. New test.
__builtin_memset (dest, 0xfe, 130);
}
-void
-set_variable (struct context *ctx)
-{
- void *data = (void *)(long)ctx->data;
- char *dest = data;
- __builtin_memset (dest, 0xbc, ctx->data_meta); /* { dg-error "could not inline call" } */
-}
-
/* { dg-final { scan-assembler-times "call" 0 } } */
--- /dev/null
+/* Test that we error if memset cannot be expanded inline. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct context {
+ unsigned int data;
+ unsigned int data_end;
+ unsigned int data_meta;
+ unsigned int ingress;
+ unsigned int queue_index;
+ unsigned int egress;
+};
+
+
+void
+set_variable (struct context *ctx)
+{
+ void *data = (void *)(long)ctx->data;
+ char *dest = data;
+ __builtin_memset (dest, 0xbc, ctx->data_meta); /* { dg-error "could not inline call" } */
+}