diff options
Diffstat (limited to 'clang/test/CodeGen/ms-intrinsics.c')
| -rw-r--r-- | clang/test/CodeGen/ms-intrinsics.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/clang/test/CodeGen/ms-intrinsics.c b/clang/test/CodeGen/ms-intrinsics.c index e37a4812a54..fb0f62c61c4 100644 --- a/clang/test/CodeGen/ms-intrinsics.c +++ b/clang/test/CodeGen/ms-intrinsics.c @@ -6,12 +6,11 @@ void *test_InterlockedExchangePointer(void * volatile *Target, void *Value) { } // CHECK: define{{.*}}i8* @test_InterlockedExchangePointer(i8** %Target, i8* %Value){{.*}}{ -// CHECK: entry: -// CHECK: %0 = bitcast i8** %Target to i32* -// CHECK: %1 = ptrtoint i8* %Value to i32 -// CHECK: %2 = atomicrmw xchg i32* %0, i32 %1 seq_cst -// CHECK: %3 = inttoptr i32 %2 to i8* -// CHECK: ret i8* %3 +// CHECK: %[[TARGET:[0-9]+]] = bitcast i8** %Target to i32* +// CHECK: %[[VALUE:[0-9]+]] = ptrtoint i8* %Value to i32 +// CHECK: %[[EXCHANGE:[0-9]+]] = atomicrmw xchg i32* %[[TARGET]], i32 %[[VALUE]] seq_cst +// CHECK: %[[RESULT:[0-9]+]] = inttoptr i32 %[[EXCHANGE]] to i8* +// CHECK: ret i8* %[[RESULT]] // CHECK: } void *test_InterlockedCompareExchangePointer(void * volatile *Destination, @@ -20,14 +19,13 @@ void *test_InterlockedCompareExchangePointer(void * volatile *Destination, } // CHECK: define{{.*}}i8* @test_InterlockedCompareExchangePointer(i8** %Destination, i8* %Exchange, i8* %Comparand){{.*}}{ -// CHECK: entry: -// CHECK: %0 = bitcast i8** %Destination to i32* -// CHECK: %1 = ptrtoint i8* %Exchange to i32 -// CHECK: %2 = ptrtoint i8* %Comparand to i32 -// CHECK: %3 = cmpxchg volatile i32* %0, i32 %2, i32 %1 seq_cst seq_cst -// CHECK: %4 = extractvalue { i32, i1 } %3, 0 -// CHECK: %5 = inttoptr i32 %4 to i8* -// CHECK: ret i8* %5 +// CHECK: %[[DEST:[0-9]+]] = bitcast i8** %Destination to i32* +// CHECK: %[[EXCHANGE:[0-9]+]] = ptrtoint i8* %Exchange to i32 +// CHECK: %[[COMPARAND:[0-9]+]] = ptrtoint i8* %Comparand to i32 +// CHECK: %[[XCHG:[0-9]+]] = cmpxchg volatile i32* %[[DEST:[0-9]+]], i32 %[[COMPARAND:[0-9]+]], i32 %[[EXCHANGE:[0-9]+]] seq_cst seq_cst +// CHECK: %[[EXTRACT:[0-9]+]] = extractvalue { i32, i1 } %[[XCHG]], 0 +// CHECK: %[[RESULT:[0-9]+]] = inttoptr i32 %[[EXTRACT]] to i8* +// CHECK: ret i8* %[[RESULT:[0-9]+]] // CHECK: } long test_InterlockedExchange(long *Target, long Value) { @@ -35,7 +33,6 @@ long test_InterlockedExchange(long *Target, long Value) { } // CHECK: define{{.*}}i32 @test_InterlockedExchange(i32* %Target, i32 %Value){{.*}}{ -// CHECK: entry: -// CHECK: %0 = atomicrmw xchg i32* %Target, i32 %Value seq_cst -// CHECK: ret i32 %0 +// CHECK: %[[EXCHANGE:[0-9]+]] = atomicrmw xchg i32* %Target, i32 %Value seq_cst +// CHECK: ret i32 %[[EXCHANGE:[0-9]+]] // CHECK: } |

