1 | // RUN: rm -rf %t |
2 | // RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs %s -verify |
3 | // RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs -x c %s -verify |
4 | // RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs -x objective-c++ %s -verify |
5 | |
6 | // RUN: rm -rf %t.pch.cache |
7 | // RUN: %clang_cc1 -fmodules-cache-path=%t.pch.cache -fmodules -fimplicit-module-maps -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %S/Inputs/use-builtin.h |
8 | // RUN: %clang_cc1 -fmodules-cache-path=%t.pch.cache -fmodules -fimplicit-module-maps -I %S/Inputs %s -include-pch %t.pch %s -verify |
9 | |
10 | // expected-no-diagnostics |
11 | // REQUIRES: shell |
12 | |
13 | void use_constant_string_builtins1(void) { |
14 | (void)__builtin___CFStringMakeConstantString(""); |
15 | (void)__builtin___NSStringMakeConstantString(""); |
16 | } |
17 | |
18 | #include "builtin.h" |
19 | |
20 | int foo() { |
21 | return __builtin_object_size(p, 0); |
22 | } |
23 | |
24 | #include "builtin_sub.h" |
25 | |
26 | int bar() { |
27 | return __builtin_object_size(p, 0); |
28 | } |
29 | |
30 | int baz() { |
31 | return IS_CONST(0); |
32 | } |
33 | |
34 | void use_constant_string_builtins2(void) { |
35 | (void)__builtin___CFStringMakeConstantString(""); |
36 | (void)__builtin___NSStringMakeConstantString(""); |
37 | } |
38 | |