diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-05-24 16:09:25 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-05-24 16:09:25 +0000 |
commit | 99849dba66e7a9b20c9a908bdfc3a8815064c369 (patch) | |
tree | aeb62f5d8294fe92f291ed4164ddb231043230e2 /test/CodeGen/ms-volatile.c | |
parent | 1b8778ca2b466953c8efc74b1d2dff11680dc3c5 (diff) | |
download | clang-99849dba66e7a9b20c9a908bdfc3a8815064c369.tar.gz |
[MS Volatile] Don't make volatile loads/stores to underaligned objects atomic
Underaligned atomic LValues require libcalls which MSVC doesn't have.
MSVC doesn't seem to consider such operations as requiring a barrier
anyway.
This fixes PR27843.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270576 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ms-volatile.c')
-rw-r--r-- | test/CodeGen/ms-volatile.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/CodeGen/ms-volatile.c b/test/CodeGen/ms-volatile.c index 242ce067d6..a3ef35a3fa 100644 --- a/test/CodeGen/ms-volatile.c +++ b/test/CodeGen/ms-volatile.c @@ -7,6 +7,13 @@ struct bar { }; typedef _Complex float __declspec(align(8)) baz; +#pragma pack(push) +#pragma pack(1) +struct qux { + volatile int f; +}; +#pragma pack(pop) + void test1(struct foo *p, struct foo *q) { *p = *q; // CHECK-LABEL: @test1 @@ -58,7 +65,8 @@ void test8(volatile double *p, volatile double *q) { void test9(volatile baz *p, baz *q) { *p = *q; // CHECK-LABEL: @test9 - // CHECK: store atomic volatile {{.*}}, {{.*}} release + // CHECK: store volatile {{.*}}, {{.*}} + // CHECK: store volatile {{.*}}, {{.*}} } void test10(volatile long long *p, volatile long long *q) { *p = *q; @@ -72,3 +80,8 @@ void test11(volatile float *p, volatile float *q) { // CHECK: load atomic volatile {{.*}} acquire // CHECK: store atomic volatile {{.*}}, {{.*}} release } +int test12(struct qux *p) { + return p->f; + // CHECK-LABEL: @test12 + // CHECK: load volatile {{.*}} +} |