diff options
Diffstat (limited to 'test/Instrumentation/DataFlowSanitizer/abilist.ll')
-rw-r--r-- | test/Instrumentation/DataFlowSanitizer/abilist.ll | 54 |
1 files changed, 39 insertions, 15 deletions
diff --git a/test/Instrumentation/DataFlowSanitizer/abilist.ll b/test/Instrumentation/DataFlowSanitizer/abilist.ll index 66ddc14..ebf55d9 100644 --- a/test/Instrumentation/DataFlowSanitizer/abilist.ll +++ b/test/Instrumentation/DataFlowSanitizer/abilist.ll @@ -12,16 +12,38 @@ define i32 @functional(i32 %a, i32 %b) { ret i32 %c } +; CHECK: define i32 (i32, i32)* @discardg(i32) +; CHECK: %[[CALL:.*]] = call { i32 (i32, i32)*, i16 } @"dfs$g"(i32 %0, i16 0) +; CHECK: %[[XVAL:.*]] = extractvalue { i32 (i32, i32)*, i16 } %[[CALL]], 0 +; CHECK: ret {{.*}} %[[XVAL]] +@discardg = alias i32 (i32, i32)* (i32)* @g + declare void @custom1(i32 %a, i32 %b) +; CHECK: define linkonce_odr { i32, i16 } @"dfsw$custom2"(i32, i32, i16, i16) +; CHECK: %[[LABELRETURN2:.*]] = alloca i16 +; CHECK: %[[RV:.*]] = call i32 @__dfsw_custom2 +; CHECK: %[[RVSHADOW:.*]] = load i16* %[[LABELRETURN2]] +; CHECK: insertvalue {{.*}}[[RV]], 0 +; CHECK: insertvalue {{.*}}[[RVSHADOW]], 1 +; CHECK: ret { i32, i16 } declare i32 @custom2(i32 %a, i32 %b) +; CHECK: define linkonce_odr void @"dfsw$custom3"(i32, i16, i16*, ...) +; CHECK: call void @__dfsan_vararg_wrapper(i8* +; CHECK: unreachable +declare void @custom3(i32 %a, ...) + +declare i32 @custom4(i32 %a, ...) + declare void @customcb(i32 (i32)* %cb) declare i32 @cb(i32) ; CHECK: @"dfs$f" -define void @f() { +define void @f(i32 %x) { + ; CHECK: %[[LABELVA2:.*]] = alloca [2 x i16] + ; CHECK: %[[LABELVA1:.*]] = alloca [2 x i16] ; CHECK: %[[LABELRETURN:.*]] = alloca i16 ; CHECK: call void @__dfsw_custom1(i32 1, i32 2, i16 0, i16 0) @@ -33,22 +55,21 @@ define void @f() { ; CHECK: call void @__dfsw_customcb({{.*}} @"dfst0$customcb", i8* bitcast ({{.*}} @"dfs$cb" to i8*), i16 0) call void @customcb(i32 (i32)* @cb) - ret void -} + ; CHECK: %[[LABELVA1_0:.*]] = getelementptr inbounds [2 x i16]* %[[LABELVA1]], i32 0, i32 0 + ; CHECK: store i16 0, i16* %[[LABELVA1_0]] + ; CHECK: %[[LABELVA1_1:.*]] = getelementptr inbounds [2 x i16]* %[[LABELVA1]], i32 0, i32 1 + ; CHECK: store i16 %{{.*}}, i16* %[[LABELVA1_1]] + ; CHECK: %[[LABELVA1_0A:.*]] = getelementptr inbounds [2 x i16]* %[[LABELVA1]], i32 0, i32 0 + ; CHECK: call void (i32, i16, i16*, ...)* @__dfsw_custom3(i32 1, i16 0, i16* %[[LABELVA1_0A]], i32 2, i32 %{{.*}}) + call void (i32, ...)* @custom3(i32 1, i32 2, i32 %x) -; CHECK: define i32 (i32, i32)* @discardg(i32) -; CHECK: %[[CALL:.*]] = call { i32 (i32, i32)*, i16 } @"dfs$g"(i32 %0, i16 0) -; CHECK: %[[XVAL:.*]] = extractvalue { i32 (i32, i32)*, i16 } %[[CALL]], 0 -; CHECK: ret {{.*}} %[[XVAL]] -@discardg = alias i32 (i32, i32)* (i32)* @g + ; CHECK: %[[LABELVA2_0:.*]] = getelementptr inbounds [2 x i16]* %[[LABELVA2]], i32 0, i32 0 + ; CHECK: %[[LABELVA2_0A:.*]] = getelementptr inbounds [2 x i16]* %[[LABELVA2]], i32 0, i32 0 + ; CHECK: call i32 (i32, i16, i16*, i16*, ...)* @__dfsw_custom4(i32 1, i16 0, i16* %[[LABELVA2_0A]], i16* %[[LABELRETURN]], i32 2, i32 3) + call i32 (i32, ...)* @custom4(i32 1, i32 2, i32 3) -; CHECK: define linkonce_odr { i32, i16 } @"dfsw$custom2"(i32, i32, i16, i16) -; CHECK: %[[LABELRETURN2:.*]] = alloca i16 -; CHECK: %[[RV:.*]] = call i32 @__dfsw_custom2 -; CHECK: %[[RVSHADOW:.*]] = load i16* %[[LABELRETURN2]] -; CHECK: insertvalue {{.*}}[[RV]], 0 -; CHECK: insertvalue {{.*}}[[RVSHADOW]], 1 -; CHECK: ret { i32, i16 } + ret void +} ; CHECK: @"dfs$g" define i32 (i32, i32)* @g(i32) { @@ -73,3 +94,6 @@ define i32 (i32, i32)* @g(i32) { ; CHECK: %[[XVAL1:.*]] = extractvalue { i32, i16 } %[[CALL]], 1 ; CHECK: store i16 %[[XVAL1]], i16* %3 ; CHECK: ret i32 %[[XVAL0]] + +; CHECK: declare void @__dfsw_custom3(i32, i16, i16*, ...) +; CHECK: declare i32 @__dfsw_custom4(i32, i16, i16*, i16*, ...) |