diff options
Diffstat (limited to 'test')
20 files changed, 73 insertions, 47 deletions
diff --git a/test/Assembler/atomic.ll b/test/Assembler/atomic.ll new file mode 100644 index 0000000..fa6f1f4 --- /dev/null +++ b/test/Assembler/atomic.ll @@ -0,0 +1,26 @@ +; RUN: opt -S < %s | FileCheck %s +; Basic smoke test for atomic operations. + +define void @f(i32* %x) { + ; CHECK: load atomic i32* %x unordered, align 4 + load atomic i32* %x unordered, align 4 + ; CHECK: load atomic volatile i32* %x singlethread acquire, align 4 + load atomic volatile i32* %x singlethread acquire, align 4 + ; CHECK: store atomic i32 3, i32* %x release, align 4 + store atomic i32 3, i32* %x release, align 4 + ; CHECK: store atomic volatile i32 3, i32* %x singlethread monotonic, align 4 + store atomic volatile i32 3, i32* %x singlethread monotonic, align 4 + ; CHECK: cmpxchg i32* %x, i32 1, i32 0 singlethread monotonic + cmpxchg i32* %x, i32 1, i32 0 singlethread monotonic + ; CHECK: cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel + cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel + ; CHECK: atomicrmw add i32* %x, i32 10 seq_cst + atomicrmw add i32* %x, i32 10 seq_cst + ; CHECK: atomicrmw volatile xchg i32* %x, i32 10 monotonic + atomicrmw volatile xchg i32* %x, i32 10 monotonic + ; CHECK: fence singlethread release + fence singlethread release + ; CHECK: fence seq_cst + fence seq_cst + ret void +} diff --git a/test/Transforms/DeadArgElim/deadexternal.ll b/test/Transforms/DeadArgElim/deadexternal.ll index 8409261..b2d63ec 100644 --- a/test/Transforms/DeadArgElim/deadexternal.ll +++ b/test/Transforms/DeadArgElim/deadexternal.ll @@ -31,7 +31,7 @@ define void @h() { entry: %i = alloca i32, align 4 volatile store i32 10, i32* %i, align 4 -; CHECK: %tmp = volatile load i32* %i, align 4 +; CHECK: %tmp = load volatile i32* %i, align 4 ; CHECK-next: call void @f(i32 undef) %tmp = volatile load i32* %i, align 4 call void @f(i32 %tmp) diff --git a/test/Transforms/DeadStoreElimination/simple.ll b/test/Transforms/DeadStoreElimination/simple.ll index 5f143fc..ec2f157 100644 --- a/test/Transforms/DeadStoreElimination/simple.ll +++ b/test/Transforms/DeadStoreElimination/simple.ll @@ -42,20 +42,20 @@ define i32 @test3(i32* %g_addr) nounwind { define void @test4(i32* %Q) { %a = load i32* %Q - volatile store i32 %a, i32* %Q + store volatile i32 %a, i32* %Q ret void ; CHECK: @test4 ; CHECK-NEXT: load i32 -; CHECK-NEXT: volatile store +; CHECK-NEXT: store volatile ; CHECK-NEXT: ret void } define void @test5(i32* %Q) { - %a = volatile load i32* %Q + %a = load volatile i32* %Q store i32 %a, i32* %Q ret void ; CHECK: @test5 -; CHECK-NEXT: volatile load +; CHECK-NEXT: load volatile ; CHECK-NEXT: ret void } diff --git a/test/Transforms/EarlyCSE/basic.ll b/test/Transforms/EarlyCSE/basic.ll index e3c75f9..57b1697 100644 --- a/test/Transforms/EarlyCSE/basic.ll +++ b/test/Transforms/EarlyCSE/basic.ll @@ -13,21 +13,21 @@ define void @test1(i8 %V, i32 *%P) { volatile store i32 %C, i32* %P volatile store i32 %D, i32* %P ; CHECK-NEXT: %C = zext i8 %V to i32 - ; CHECK-NEXT: volatile store i32 %C - ; CHECK-NEXT: volatile store i32 %C + ; CHECK-NEXT: store volatile i32 %C + ; CHECK-NEXT: store volatile i32 %C %E = add i32 %C, %C %F = add i32 %C, %C volatile store i32 %E, i32* %P volatile store i32 %F, i32* %P ; CHECK-NEXT: %E = add i32 %C, %C - ; CHECK-NEXT: volatile store i32 %E - ; CHECK-NEXT: volatile store i32 %E + ; CHECK-NEXT: store volatile i32 %E + ; CHECK-NEXT: store volatile i32 %E %G = add nuw i32 %C, %C ;; not a CSE with E volatile store i32 %G, i32* %P ; CHECK-NEXT: %G = add nuw i32 %C, %C - ; CHECK-NEXT: volatile store i32 %G + ; CHECK-NEXT: store volatile i32 %G ret void } diff --git a/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll b/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll index 0c81700..a6803ab 100644 --- a/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll +++ b/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -globalopt -S | grep {volatile load} +; RUN: opt < %s -globalopt -S | grep {load volatile} @t0.1441 = internal global double 0x3FD5555555555555, align 8 ; <double*> [#uses=1] define double @foo() nounwind { diff --git a/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll b/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll index 626564d..6847f5e 100644 --- a/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll +++ b/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -instcombine -S | grep {volatile store} +; RUN: opt < %s -instcombine -S | grep {store volatile} define void @test() { %votf = alloca <4 x float> ; <<4 x float>*> [#uses=1] diff --git a/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll b/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll index f2cc725..a24f307 100644 --- a/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll +++ b/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -instcombine -S | grep {volatile load} | count 2 +; RUN: opt < %s -instcombine -S | grep {load volatile} | count 2 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i386-apple-darwin8" @g_1 = internal global i32 0 ; <i32*> [#uses=3] diff --git a/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll b/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll index 176162d..5fb11ff 100644 --- a/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll +++ b/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -instcombine -S | grep {volatile load} | count 2 +; RUN: opt < %s -instcombine -S | grep {load volatile} | count 2 ; PR2262 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i386-apple-darwin8" diff --git a/test/Transforms/InstCombine/2008-07-08-VolatileLoadMerge.ll b/test/Transforms/InstCombine/2008-07-08-VolatileLoadMerge.ll index ccfb118..8104408 100644 --- a/test/Transforms/InstCombine/2008-07-08-VolatileLoadMerge.ll +++ b/test/Transforms/InstCombine/2008-07-08-VolatileLoadMerge.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -instcombine -S | grep {volatile load} | count 2 +; RUN: opt < %s -instcombine -S | grep {load volatile} | count 2 ; PR2496 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i386-apple-darwin8" diff --git a/test/Transforms/InstCombine/extractvalue.ll b/test/Transforms/InstCombine/extractvalue.ll index 64edc18..cf36b8f 100644 --- a/test/Transforms/InstCombine/extractvalue.ll +++ b/test/Transforms/InstCombine/extractvalue.ll @@ -96,7 +96,7 @@ define i32 @nogep-multiuse({i32, i32}* %pair) { } ; CHECK: define i32 @nogep-volatile -; CHECK-NEXT: volatile load {{.*}} %pair +; CHECK-NEXT: load volatile {{.*}} %pair ; CHECK-NEXT: extractvalue ; CHECK-NEXT: ret define i32 @nogep-volatile({i32, i32}* %pair) { diff --git a/test/Transforms/InstCombine/intrinsics.ll b/test/Transforms/InstCombine/intrinsics.ll index 0d84ae4..f033e51 100644 --- a/test/Transforms/InstCombine/intrinsics.ll +++ b/test/Transforms/InstCombine/intrinsics.ll @@ -152,9 +152,9 @@ entry: ret void ; CHECK: @powi ; CHECK: %A = fdiv double 1.0{{.*}}, %V -; CHECK: volatile store double %A, -; CHECK: volatile store double 1.0 -; CHECK: volatile store double %V +; CHECK: store volatile double %A, +; CHECK: store volatile double 1.0 +; CHECK: store volatile double %V } define i32 @cttz(i32 %a) { @@ -194,11 +194,11 @@ entry: ; CHECK: @cmp.simplify ; CHECK-NEXT: entry: ; CHECK-NEXT: %lz.cmp = icmp eq i32 %a, 0 -; CHECK-NEXT: volatile store i1 %lz.cmp, i1* %c +; CHECK-NEXT: store volatile i1 %lz.cmp, i1* %c ; CHECK-NEXT: %tz.cmp = icmp ne i32 %a, 0 -; CHECK-NEXT: volatile store i1 %tz.cmp, i1* %c +; CHECK-NEXT: store volatile i1 %tz.cmp, i1* %c ; CHECK-NEXT: %pop.cmp = icmp eq i32 %b, 0 -; CHECK-NEXT: volatile store i1 %pop.cmp, i1* %c +; CHECK-NEXT: store volatile i1 %pop.cmp, i1* %c } diff --git a/test/Transforms/InstCombine/volatile_store.ll b/test/Transforms/InstCombine/volatile_store.ll index 5316bd7..0518e5a 100644 --- a/test/Transforms/InstCombine/volatile_store.ll +++ b/test/Transforms/InstCombine/volatile_store.ll @@ -1,5 +1,5 @@ -; RUN: opt < %s -instcombine -S | grep {volatile store} -; RUN: opt < %s -instcombine -S | grep {volatile load} +; RUN: opt < %s -instcombine -S | grep {store volatile} +; RUN: opt < %s -instcombine -S | grep {load volatile} @x = weak global i32 0 ; <i32*> [#uses=2] diff --git a/test/Transforms/JumpThreading/no-irreducible-loops.ll b/test/Transforms/JumpThreading/no-irreducible-loops.ll index 97276b0..7c7fe39 100644 --- a/test/Transforms/JumpThreading/no-irreducible-loops.ll +++ b/test/Transforms/JumpThreading/no-irreducible-loops.ll @@ -1,5 +1,5 @@ ; RUN: opt < %s -jump-threading -loop-rotate -instcombine -indvars -loop-unroll -simplifycfg -S -verify-dom-info -verify-loop-info > %t -; RUN: grep {volatile store} %t | count 3 +; RUN: grep {store volatile} %t | count 3 ; RUN: not grep {br label} %t ; Jump threading should not prevent this loop from being unrolled. diff --git a/test/Transforms/LICM/2007-05-22-VolatileSink.ll b/test/Transforms/LICM/2007-05-22-VolatileSink.ll index c12e13b..17383c2 100644 --- a/test/Transforms/LICM/2007-05-22-VolatileSink.ll +++ b/test/Transforms/LICM/2007-05-22-VolatileSink.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -licm -S | grep {volatile store} +; RUN: opt < %s -licm -S | grep {store volatile} ; PR1435 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" target triple = "i686-apple-darwin8" diff --git a/test/Transforms/LICM/2011-04-06-HoistMissedASTUpdate.ll b/test/Transforms/LICM/2011-04-06-HoistMissedASTUpdate.ll index 5774f58..fd114f4 100644 --- a/test/Transforms/LICM/2011-04-06-HoistMissedASTUpdate.ll +++ b/test/Transforms/LICM/2011-04-06-HoistMissedASTUpdate.ll @@ -15,7 +15,7 @@ for.body4.lr.ph: br label %for.body4 ; CHECK: for.body4: -; CHECK: volatile load i16* @g_39 +; CHECK: load volatile i16* @g_39 for.body4: %l_612.11 = phi i32* [ undef, %for.body4.lr.ph ], [ %call19, %for.body4 ] diff --git a/test/Transforms/LICM/scalar_promote.ll b/test/Transforms/LICM/scalar_promote.ll index d8acdc1..9aefc4f 100644 --- a/test/Transforms/LICM/scalar_promote.ll +++ b/test/Transforms/LICM/scalar_promote.ll @@ -65,7 +65,7 @@ Loop: br i1 true, label %Out, label %Loop ; CHECK: Loop: -; CHECK-NEXT: volatile load +; CHECK-NEXT: load volatile Out: ; preds = %Loop ret void diff --git a/test/Transforms/ObjCARC/contract-storestrong.ll b/test/Transforms/ObjCARC/contract-storestrong.ll index 50ed260..25c93f4 100644 --- a/test/Transforms/ObjCARC/contract-storestrong.ll +++ b/test/Transforms/ObjCARC/contract-storestrong.ll @@ -25,7 +25,7 @@ entry: ; CHECK: define void @test1(i8* %p) { ; CHECK-NEXT: entry: ; CHECK-NEXT: %0 = tail call i8* @objc_retain(i8* %p) nounwind -; CHECK-NEXT: %tmp = volatile load i8** @x, align 8 +; CHECK-NEXT: %tmp = load volatile i8** @x, align 8 ; CHECK-NEXT: store i8* %0, i8** @x, align 8 ; CHECK-NEXT: tail call void @objc_release(i8* %tmp) nounwind ; CHECK-NEXT: ret void @@ -45,7 +45,7 @@ entry: ; CHECK-NEXT: entry: ; CHECK-NEXT: %0 = tail call i8* @objc_retain(i8* %p) nounwind ; CHECK-NEXT: %tmp = load i8** @x, align 8 -; CHECK-NEXT: volatile store i8* %0, i8** @x, align 8 +; CHECK-NEXT: store volatile i8* %0, i8** @x, align 8 ; CHECK-NEXT: tail call void @objc_release(i8* %tmp) nounwind ; CHECK-NEXT: ret void ; CHECK-NEXT: } diff --git a/test/Transforms/ScalarRepl/volatile.ll b/test/Transforms/ScalarRepl/volatile.ll index 3ff322e..ab276b0 100644 --- a/test/Transforms/ScalarRepl/volatile.ll +++ b/test/Transforms/ScalarRepl/volatile.ll @@ -1,5 +1,5 @@ -; RUN: opt < %s -scalarrepl -S | grep {volatile load} -; RUN: opt < %s -scalarrepl -S | grep {volatile store} +; RUN: opt < %s -scalarrepl -S | grep {load volatile} +; RUN: opt < %s -scalarrepl -S | grep {store volatile} define i32 @voltest(i32 %T) { %A = alloca {i32, i32} diff --git a/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll b/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll index 7bca5f5..ebf4f17 100644 --- a/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll +++ b/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll @@ -11,14 +11,14 @@ entry: br i1 %0, label %bb, label %return bb: ; preds = %entry - %1 = volatile load i32* null + %1 = load volatile i32* null unreachable br label %return return: ; preds = %entry ret void ; CHECK: @test1 -; CHECK: volatile load +; CHECK: load volatile } ; rdar://7958343 @@ -35,10 +35,10 @@ entry: ; PR7369 define void @test3() nounwind { entry: - volatile store i32 4, i32* null + store volatile i32 4, i32* null ret void ; CHECK: @test3 -; CHECK: volatile store i32 4, i32* null +; CHECK: store volatile i32 4, i32* null ; CHECK: ret } diff --git a/test/Transforms/SimplifyLibCalls/memcmp.ll b/test/Transforms/SimplifyLibCalls/memcmp.ll index ee99501..6ca4dc9 100644 --- a/test/Transforms/SimplifyLibCalls/memcmp.ll +++ b/test/Transforms/SimplifyLibCalls/memcmp.ll @@ -10,26 +10,26 @@ declare i32 @memcmp(i8*, i8*, i32) define void @test(i8* %P, i8* %Q, i32 %N, i32* %IP, i1* %BP) { %A = call i32 @memcmp( i8* %P, i8* %P, i32 %N ) ; <i32> [#uses=1] ; CHECK-NOT: call {{.*}} memcmp -; CHECK: volatile store - volatile store i32 %A, i32* %IP +; CHECK: store volatile + store volatile i32 %A, i32* %IP %B = call i32 @memcmp( i8* %P, i8* %Q, i32 0 ) ; <i32> [#uses=1] ; CHECK-NOT: call {{.*}} memcmp -; CHECK: volatile store - volatile store i32 %B, i32* %IP +; CHECK: store volatile + store volatile i32 %B, i32* %IP %C = call i32 @memcmp( i8* %P, i8* %Q, i32 1 ) ; <i32> [#uses=1] ; CHECK: load ; CHECK: zext ; CHECK: load ; CHECK: zext ; CHECK: sub -; CHECK: volatile store - volatile store i32 %C, i32* %IP - %F = call i32 @memcmp(i8* getelementptr ([4 x i8]* @hel, i32 0, i32 0), - i8* getelementptr ([8 x i8]* @hello_u, i32 0, i32 0), - i32 3) +; CHECK: store volatile + store volatile i32 %C, i32* %IP + %F = call i32 @memcmp(i8* getelementptr ([4 x i8]* @hel, i32 0, i32 0), + i8* getelementptr ([8 x i8]* @hello_u, i32 0, i32 0), + i32 3) ; CHECK-NOT: call {{.*}} memcmp -; CHECK: volatile store - volatile store i32 %F, i32* %IP +; CHECK: store volatile + store volatile i32 %F, i32* %IP ret void } |