diff options
Diffstat (limited to 'test/CodeGen')
| -rw-r--r-- | test/CodeGen/wrapv-lshr-sanitize.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/wrapv-lshr-sanitize.c b/test/CodeGen/wrapv-lshr-sanitize.c new file mode 100644 index 000000000000..c09dab7cf7b5 --- /dev/null +++ b/test/CodeGen/wrapv-lshr-sanitize.c @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -fsanitize=shift-base -emit-llvm %s -o - -triple x86_64-linux-gnu -fwrapv | FileCheck %s + +// CHECK-LABEL: @lsh_overflow +int lsh_overflow(int a, int b) { + // CHECK-NOT: br + // CHECK-NOT: call void @__ubsan_ + // CHECK-NOT: call void @llvm.trap + + // CHECK: %[[RET:.*]] = shl i32 + // CHECK-NEXT: ret i32 %[[RET]] + return a << b; +} |
