1 // RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
2 // RUN: -triple i686--windows -emit-llvm %s -o - \
4 // RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
5 // RUN: -triple x86_64--windows -emit-llvm %s -o - \
6 // RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-X64
8 // intrin.h needs size_t, but -ffreestanding prevents us from getting it from
9 // stddef.h. Work around it with this typedef.
10 typedef __SIZE_TYPE__
size_t;
14 void test_ReadWriteBarrier(void) { _ReadWriteBarrier(); }
15 // CHECK-LABEL: define dso_local void @test_ReadWriteBarrier
16 // CHECK: fence syncscope("singlethread") seq_cst
20 void test_ReadBarrier(void) { _ReadBarrier(); }
21 // CHECK-LABEL: define dso_local void @test_ReadBarrier
22 // CHECK: fence syncscope("singlethread") seq_cst
26 void test_WriteBarrier(void) { _WriteBarrier(); }
27 // CHECK-LABEL: define dso_local void @test_WriteBarrier
28 // CHECK: fence syncscope("singlethread") seq_cst
32 #if defined(__x86_64__)
33 void test__faststorefence(void) { __faststorefence(); }
34 // CHECK-X64-LABEL: define dso_local void @test__faststorefence
35 // CHECK-X64: fence seq_cst
36 // CHECK-X64: ret void