blob: 87393e794f8297d5085c8a3693bf49b5d0c42aad [file] [log] [blame]
Aaron Ballman674cf262015-05-26 19:44:52 +00001// RUN: %clang_cc1 -triple i386-pc-win32 -fms-extensions -emit-llvm -fms-volatile -o - < %s | FileCheck %s
David Majnemera5b195a2015-02-14 01:35:12 +00002struct foo {
3 volatile int x;
4};
5struct bar {
6 int x;
7};
8typedef _Complex float __declspec(align(8)) baz;
9
10void test1(struct foo *p, struct foo *q) {
11 *p = *q;
12 // CHECK-LABEL: @test1
13 // CHECK: load atomic volatile {{.*}} acquire
14 // CHECK: store atomic volatile {{.*}}, {{.*}} release
15}
16void test2(volatile int *p, volatile int *q) {
17 *p = *q;
18 // CHECK-LABEL: @test2
19 // CHECK: load atomic volatile {{.*}} acquire
20 // CHECK: store atomic volatile {{.*}}, {{.*}} release
21}
22void test3(struct foo *p, struct foo *q) {
23 p->x = q->x;
24 // CHECK-LABEL: @test3
25 // CHECK: load atomic volatile {{.*}} acquire
26 // CHECK: store atomic volatile {{.*}}, {{.*}} release
27}
28void test4(volatile struct foo *p, volatile struct foo *q) {
29 p->x = q->x;
30 // CHECK-LABEL: @test4
31 // CHECK: load atomic volatile {{.*}} acquire
32 // CHECK: store atomic volatile {{.*}}, {{.*}} release
33}
34void test5(volatile struct foo *p, volatile struct foo *q) {
35 *p = *q;
36 // CHECK-LABEL: @test5
37 // CHECK: load atomic volatile {{.*}} acquire
38 // CHECK: store atomic volatile {{.*}}, {{.*}} release
39}
40void test6(struct bar *p, struct bar *q) {
41 *p = *q;
42 // CHECK-LABEL: @test6
43 // CHECK-NOT: load atomic volatile {{.*}}
44 // CHECK-NOT: store atomic volatile {{.*}}, {{.*}}
45}
46void test7(volatile struct bar *p, volatile struct bar *q) {
47 *p = *q;
48 // CHECK-LABEL: @test7
49 // CHECK: load atomic volatile {{.*}} acquire
50 // CHECK: store atomic volatile {{.*}}, {{.*}} release
51}
52void test8(volatile double *p, volatile double *q) {
53 *p = *q;
54 // CHECK-LABEL: @test8
55 // CHECK: load atomic volatile {{.*}} acquire
56 // CHECK: store atomic volatile {{.*}}, {{.*}} release
57}
58void test9(volatile baz *p, baz *q) {
59 *p = *q;
60 // CHECK-LABEL: @test9
61 // CHECK: store atomic volatile {{.*}}, {{.*}} release
62}