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 | a38c9f1fa58abdbee68672fe7e3748c07962964b (patch) | |
tree | 545b8166261e176a8b9c866e1391294a26dcbb62 /clang/test | |
parent | ef88dc8fe4d28976ccd157493066a7f57ba98ce8 (diff) | |
download | bcm5719-llvm-a38c9f1fa58abdbee68672fe7e3748c07962964b.tar.gz bcm5719-llvm-a38c9f1fa58abdbee68672fe7e3748c07962964b.zip |
[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.
llvm-svn: 270576
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGen/ms-volatile.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/test/CodeGen/ms-volatile.c b/clang/test/CodeGen/ms-volatile.c index 242ce067d62..a3ef35a3faa 100644 --- a/clang/test/CodeGen/ms-volatile.c +++ b/clang/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 {{.*}} +} |