1 // RUN: %clang_cc1 -triple i386-pc-win32 -fms-extensions -emit-llvm -fms-volatile -o - < %s | FileCheck %s
2 struct foo {
3 volatile int x;
4 };
5 struct bar {
6 int x;
7 };
8 typedef _Complex float __declspec(align(8)) baz;
9
test1(struct foo * p,struct foo * q)10 void 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 }
test2(volatile int * p,volatile int * q)16 void 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 }
test3(struct foo * p,struct foo * q)22 void 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 }
test4(volatile struct foo * p,volatile struct foo * q)28 void 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 }
test5(volatile struct foo * p,volatile struct foo * q)34 void 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 }
test6(struct bar * p,struct bar * q)40 void 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 }
test7(volatile struct bar * p,volatile struct bar * q)46 void 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 }
test8(volatile double * p,volatile double * q)52 void 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 }
test9(volatile baz * p,baz * q)58 void test9(volatile baz *p, baz *q) {
59 *p = *q;
60 // CHECK-LABEL: @test9
61 // CHECK: store atomic volatile {{.*}}, {{.*}} release
62 }
63