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 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 } 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 } 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 } 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 } 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 } 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 } 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 } 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 } 58 void test9(volatile baz *p, baz *q) { 59 *p = *q; 60 // CHECK-LABEL: @test9 61 // CHECK: store atomic volatile {{.*}}, {{.*}} release 62 } 63