blob: b2fa9615085694f10105344a8cc938fae0150799 [file] [log] [blame]
Stephen Hines2d1fdb22014-05-28 23:58:16 -07001// RUN: %clangxx_msan -O3 %s -o %t && %run %t
2
3// Test that no_sanitize_memory attribute applies even when the function would
4// be normally inlined.
5
6#include <stdlib.h>
7
8__attribute__((no_sanitize_memory))
9int f(int *p) {
10 if (*p) // BOOOM?? Nope!
11 exit(0);
12 return 0;
13}
14
15int main(int argc, char **argv) {
16 int x;
17 int * volatile p = &x;
18 int res = f(p);
19 return 0;
20}