1 // REQUIRES: target={{x86_64.*}}
3 // RUN: %clangxx -fsanitize=builtin -w %s -O3 -o %t
4 // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=RECOVER
5 // RUN: %clangxx -fsanitize=builtin -fno-sanitize-recover=builtin -w %s -O3 -o %t.abort
6 // RUN: not %run %t.abort 2>&1 | FileCheck %s --check-prefix=ABORT
8 void check_ctz(int n
) {
9 // ABORT: builtins.cpp:[[@LINE+2]]:17: runtime error: passing zero to ctz(), which is not a valid argument
10 // RECOVER: builtins.cpp:[[@LINE+1]]:17: runtime error: passing zero to ctz(), which is not a valid argument
13 // RECOVER: builtins.cpp:[[@LINE+1]]:18: runtime error: passing zero to ctz(), which is not a valid argument
16 // RECOVER: builtins.cpp:[[@LINE+1]]:19: runtime error: passing zero to ctz(), which is not a valid argument
20 void check_clz(int n
) {
21 // RECOVER: builtins.cpp:[[@LINE+1]]:17: runtime error: passing zero to clz(), which is not a valid argument
24 // RECOVER: builtins.cpp:[[@LINE+1]]:18: runtime error: passing zero to clz(), which is not a valid argument
27 // RECOVER: builtins.cpp:[[@LINE+1]]:19: runtime error: passing zero to clz(), which is not a valid argument