summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/integer-overflow.c
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-07-25 05:57:24 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-07-25 05:57:24 +0000
commit6cd35912c0486dd73c62f94dc924731e0c1f195a (patch)
treeea35e0093b63a684983b59243b88b3b3000b94de /clang/test/CodeGen/integer-overflow.c
parent3dd9372d2ba883ed46eda3fd23d81b78b7785d1b (diff)
downloadbcm5719-llvm-6cd35912c0486dd73c62f94dc924731e0c1f195a.tar.gz
bcm5719-llvm-6cd35912c0486dd73c62f94dc924731e0c1f195a.zip
[CodeGen] Don't UBSan-ize the argument to __builtin_frame_address
__builtin_frame_address requires its argument to be a constant expression which already implies that it cannot have undefined behavior. However, we used EmitScalarExpr to emit the argument causing UBSan to try to check for overflow. Instead, use the constant expression emission system. This fixes PR24256. llvm-svn: 243206
Diffstat (limited to 'clang/test/CodeGen/integer-overflow.c')
-rw-r--r--clang/test/CodeGen/integer-overflow.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/CodeGen/integer-overflow.c b/clang/test/CodeGen/integer-overflow.c
index de3b53f4b5b..6a7c3e51ee1 100644
--- a/clang/test/CodeGen/integer-overflow.c
+++ b/clang/test/CodeGen/integer-overflow.c
@@ -72,4 +72,11 @@ void test1() {
// TRAPV: add i8 {{.*}}, 1
// CATCH_UB: add i8 {{.*}}, 1
++PR9350;
+
+ // PR24256: don't instrument __builtin_frame_address.
+ __builtin_frame_address(0 + 0);
+ // DEFAULT: call i8* @llvm.frameaddress(i32 0)
+ // WRAPV: call i8* @llvm.frameaddress(i32 0)
+ // TRAPV: call i8* @llvm.frameaddress(i32 0)
+ // CATCH_UB: call i8* @llvm.frameaddress(i32 0)
}
OpenPOWER on IntegriCloud