[RISCV] Rename a lambda to have plural nouns to reflect that it contains a loop. NFC
[llvm-project.git] / clang / test / CodeGen / sanitize-numerical-stability-attr.cpp
blobf51fb79bda6afdb901493beb1bec4d0db9ad77c0
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck -check-prefix=WITHOUT %s
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s -fsanitize=numerical | FileCheck -check-prefix=NSAN %s
3 // RUN: echo "src:%s" | sed -e 's/\\/\\\\/g' > %t
4 // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s -fsanitize=numerical -fsanitize-ignorelist=%t | FileCheck -check-prefix=BL %s
6 // WITHOUT: NoNSAN3{{.*}}) [[NOATTR:#[0-9]+]]
7 // BL: NoNSAN3{{.*}}) [[NOATTR:#[0-9]+]]
8 // NSAN: NoNSAN3{{.*}}) [[NOATTR:#[0-9]+]]
9 __attribute__((no_sanitize("numerical")))
10 int NoNSAN3(int *a) { return *a; }
12 // WITHOUT: NSANOk{{.*}}) [[NOATTR]]
13 // BL: NSANOk{{.*}}) [[NOATTR]]
14 // NSAN: NSANOk{{.*}}) [[WITH:#[0-9]+]]
15 int NSANOk(int *a) { return *a; }
17 // WITHOUT: TemplateNSANOk{{.*}}) [[NOATTR]]
18 // BL: TemplateNSANOk{{.*}}) [[NOATTR]]
19 // NSAN: TemplateNSANOk{{.*}}) [[WITH]]
20 template<int i>
21 int TemplateNSANOk() { return i; }
23 // WITHOUT: TemplateNoNSAN{{.*}}) [[NOATTR]]
24 // BL: TemplateNoNSAN{{.*}}) [[NOATTR]]
25 // NSAN: TemplateNoNSAN{{.*}}) [[NOATTR]]
26 template<int i>
27 __attribute__((no_sanitize("numerical")))
28 int TemplateNoNSAN() { return i; }
30 int force_instance = TemplateNSANOk<42>() + TemplateNoNSAN<42>();
32 // WITHOUT: attributes [[NOATTR]] = { mustprogress noinline nounwind{{.*}} }
33 // BL: attributes [[NOATTR]] = { mustprogress noinline nounwind{{.*}} }
34 // NSAN: attributes [[WITH]] = { mustprogress noinline nounwind optnone sanitize_numerical_stability{{.*}} }