[OpenACC] Enable 'attach' clause for combined constructs
[llvm-project.git] / clang / test / CodeGen / ms-volatile.c
bloba7ea10902fd94f41cd715fe2a72fa2977bdc77e0
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;
10 #pragma pack(push)
11 #pragma pack(1)
12 struct qux {
13 volatile int f;
15 #pragma pack(pop)
17 void test1(struct foo *p, struct foo *q) {
18 *p = *q;
19 // CHECK-LABEL: @test1
20 // CHECK: load atomic volatile {{.*}} acquire, align 4
21 // CHECK: store atomic volatile {{.*}}, {{.*}} release, align 4
23 void test2(volatile int *p, volatile int *q) {
24 *p = *q;
25 // CHECK-LABEL: @test2
26 // CHECK: load atomic volatile {{.*}} acquire, align 4
27 // CHECK: store atomic volatile {{.*}}, {{.*}} release, align 4
29 void test3(struct foo *p, struct foo *q) {
30 p->x = q->x;
31 // CHECK-LABEL: @test3
32 // CHECK: load atomic volatile {{.*}} acquire, align 4
33 // CHECK: store atomic volatile {{.*}}, {{.*}} release, align 4
35 void test4(volatile struct foo *p, volatile struct foo *q) {
36 p->x = q->x;
37 // CHECK-LABEL: @test4
38 // CHECK: load atomic volatile {{.*}} acquire, align 4
39 // CHECK: store atomic volatile {{.*}}, {{.*}} release, align 4
41 void test5(volatile struct foo *p, volatile struct foo *q) {
42 *p = *q;
43 // CHECK-LABEL: @test5
44 // CHECK: load atomic volatile {{.*}} acquire, align 4
45 // CHECK: store atomic volatile {{.*}}, {{.*}} release, align 4
47 void test6(struct bar *p, struct bar *q) {
48 *p = *q;
49 // CHECK-LABEL: @test6
50 // CHECK-NOT: load atomic volatile {{.*}}
51 // CHECK-NOT: store atomic volatile {{.*}}, {{.*}}
53 void test7(volatile struct bar *p, volatile struct bar *q) {
54 *p = *q;
55 // CHECK-LABEL: @test7
56 // CHECK: load atomic volatile {{.*}} acquire, align 4
57 // CHECK: store atomic volatile {{.*}}, {{.*}} release, align 4
59 void test8(volatile double *p, volatile double *q) {
60 *p = *q;
61 // CHECK-LABEL: @test8
62 // CHECK: load volatile {{.*}}, align 8
63 // CHECK: store volatile {{.*}}, {{.*}}, align 8
65 void test9(volatile baz *p, baz *q) {
66 *p = *q;
67 // CHECK-LABEL: @test9
68 // CHECK: store volatile {{.*}}, {{.*}}, align 8
69 // CHECK: store volatile {{.*}}, {{.*}}, align 4
71 void test10(volatile long long *p, volatile long long *q) {
72 *p = *q;
73 // CHECK-LABEL: @test10
74 // CHECK: load volatile {{.*}}, align 8
75 // CHECK: store volatile {{.*}}, {{.*}}, align 8
77 void test11(volatile float *p, volatile float *q) {
78 *p = *q;
79 // CHECK-LABEL: @test11
80 // CHECK: load atomic volatile {{.*}} acquire, align 4
81 // CHECK: store atomic volatile {{.*}}, {{.*}} release, align 4
83 int test12(struct qux *p) {
84 return p->f;
85 // CHECK-LABEL: @test12
86 // CHECK: load volatile {{.*}}, align 1