File: ms-volatile.c

package info (click to toggle)
llvm-toolchain-3.7 1%3A3.7.1-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 345,556 kB
  • ctags: 362,199
  • sloc: cpp: 2,156,381; ansic: 458,339; objc: 91,547; python: 89,988; asm: 86,305; sh: 21,479; makefile: 6,853; perl: 5,601; ml: 5,458; pascal: 3,933; lisp: 2,429; xml: 686; cs: 239; php: 202; csh: 117
file content (62 lines) | stat: -rw-r--r-- 1,905 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// RUN: %clang_cc1 -triple i386-pc-win32 -fms-extensions -emit-llvm -fms-volatile -o - < %s | FileCheck %s
struct foo {
  volatile int x;
};
struct bar {
  int x;
};
typedef _Complex float __declspec(align(8)) baz;

void test1(struct foo *p, struct foo *q) {
  *p = *q;
  // CHECK-LABEL: @test1
  // CHECK: load atomic volatile {{.*}} acquire
  // CHECK: store atomic volatile {{.*}}, {{.*}} release
}
void test2(volatile int *p, volatile int *q) {
  *p = *q;
  // CHECK-LABEL: @test2
  // CHECK: load atomic volatile {{.*}} acquire
  // CHECK: store atomic volatile {{.*}}, {{.*}} release
}
void test3(struct foo *p, struct foo *q) {
  p->x = q->x;
  // CHECK-LABEL: @test3
  // CHECK: load atomic volatile {{.*}} acquire
  // CHECK: store atomic volatile {{.*}}, {{.*}} release
}
void test4(volatile struct foo *p, volatile struct foo *q) {
  p->x = q->x;
  // CHECK-LABEL: @test4
  // CHECK: load atomic volatile {{.*}} acquire
  // CHECK: store atomic volatile {{.*}}, {{.*}} release
}
void test5(volatile struct foo *p, volatile struct foo *q) {
  *p = *q;
  // CHECK-LABEL: @test5
  // CHECK: load atomic volatile {{.*}} acquire
  // CHECK: store atomic volatile {{.*}}, {{.*}} release
}
void test6(struct bar *p, struct bar *q) {
  *p = *q;
  // CHECK-LABEL: @test6
  // CHECK-NOT: load atomic volatile {{.*}}
  // CHECK-NOT: store atomic volatile {{.*}}, {{.*}}
}
void test7(volatile struct bar *p, volatile struct bar *q) {
  *p = *q;
  // CHECK-LABEL: @test7
  // CHECK: load atomic volatile {{.*}} acquire
  // CHECK: store atomic volatile {{.*}}, {{.*}} release
}
void test8(volatile double *p, volatile double *q) {
  *p = *q;
  // CHECK-LABEL: @test8
  // CHECK: load atomic volatile {{.*}} acquire
  // CHECK: store atomic volatile {{.*}}, {{.*}} release
}
void test9(volatile baz *p, baz *q) {
  *p = *q;
  // CHECK-LABEL: @test9
  // CHECK: store atomic volatile {{.*}}, {{.*}} release
}