diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-01-22 16:36:44 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-01-22 16:36:44 +0000 |
commit | fc80b6e5d816005a6ea33fc9107579a16bb73ae0 (patch) | |
tree | 691e7a2dbb09ccdfb0734fbeb199670d96f3b40c /clang/test | |
parent | f7ed399881ecd7b133ab3b885ba8113b113a0a58 (diff) | |
download | bcm5719-llvm-fc80b6e5d816005a6ea33fc9107579a16bb73ae0.tar.gz bcm5719-llvm-fc80b6e5d816005a6ea33fc9107579a16bb73ae0.zip |
[MSVC Compat] Don't provide /volatile:ms semantics to types > pointer
Volatile loads of type wider than a pointer get split by MSVC because
the base x86 ISA doesn't provide loads which are wider than pointer
width. LLVM assumes that it can emit an cmpxchg8b but this is
problematic if the memory is in a CONST memory segment.
Instead, provide behavior compatible with MSVC: split loads wider than a
pointer.
llvm-svn: 258506
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGen/ms-volatile.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/clang/test/CodeGen/ms-volatile.c b/clang/test/CodeGen/ms-volatile.c index 87393e794f8..242ce067d62 100644 --- a/clang/test/CodeGen/ms-volatile.c +++ b/clang/test/CodeGen/ms-volatile.c @@ -52,11 +52,23 @@ void test7(volatile struct bar *p, volatile struct bar *q) { void test8(volatile double *p, volatile double *q) { *p = *q; // CHECK-LABEL: @test8 - // CHECK: load atomic volatile {{.*}} acquire - // CHECK: store atomic volatile {{.*}}, {{.*}} release + // CHECK: load volatile {{.*}} + // CHECK: store volatile {{.*}}, {{.*}} } void test9(volatile baz *p, baz *q) { *p = *q; // CHECK-LABEL: @test9 // CHECK: store atomic volatile {{.*}}, {{.*}} release } +void test10(volatile long long *p, volatile long long *q) { + *p = *q; + // CHECK-LABEL: @test10 + // CHECK: load volatile {{.*}} + // CHECK: store volatile {{.*}}, {{.*}} +} +void test11(volatile float *p, volatile float *q) { + *p = *q; + // CHECK-LABEL: @test11 + // CHECK: load atomic volatile {{.*}} acquire + // CHECK: store atomic volatile {{.*}}, {{.*}} release +} |