annotate clang/test/Sema/builtin-prefetch.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 void foo() {
anatofuz
parents:
diff changeset
4 int a;
anatofuz
parents:
diff changeset
5 __builtin_prefetch(&a);
anatofuz
parents:
diff changeset
6 __builtin_prefetch(&a, 1);
anatofuz
parents:
diff changeset
7 __builtin_prefetch(&a, 1, 2);
anatofuz
parents:
diff changeset
8 __builtin_prefetch(&a, 1, 9, 3); // expected-error{{too many arguments to function}}
anatofuz
parents:
diff changeset
9 __builtin_prefetch(&a, "hello", 2); // expected-error{{argument to '__builtin_prefetch' must be a constant integer}}
anatofuz
parents:
diff changeset
10 __builtin_prefetch(&a, a, 2); // expected-error{{argument to '__builtin_prefetch' must be a constant integer}}
anatofuz
parents:
diff changeset
11 __builtin_prefetch(&a, 2); // expected-error{{argument value 2 is outside the valid range [0, 1]}}
anatofuz
parents:
diff changeset
12 __builtin_prefetch(&a, 0, 4); // expected-error{{argument value 4 is outside the valid range [0, 3]}}
anatofuz
parents:
diff changeset
13 __builtin_prefetch(&a, -1, 4); // expected-error{{argument value -1 is outside the valid range [0, 1]}}
anatofuz
parents:
diff changeset
14 }