Quentin Colombet | 043406b | 2016-02-03 22:41:00 +0000 | [diff] [blame^] | 1 | // RUN: rm -rf %t |
| 2 | // RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs %s -verify |
| 3 | |
| 4 | // RUN: rm -rf %t.pch.cache |
| 5 | // 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 |
| 6 | // RUN: %clang_cc1 -fmodules-cache-path=%t.pch.cache -fmodules -fimplicit-module-maps -I %S/Inputs %s -include-pch %t.pch %s -verify |
| 7 | |
| 8 | // expected-no-diagnostics |
| 9 | |
| 10 | void use_constant_string_builtins1(void) { |
| 11 | (void)__builtin___CFStringMakeConstantString(""); |
| 12 | (void)__builtin___NSStringMakeConstantString(""); |
| 13 | } |
| 14 | |
Douglas Gregor | 1519766 | 2013-04-03 23:06:26 +0000 | [diff] [blame] | 15 | @import builtin; |
| 16 | |
| 17 | int foo() { |
| 18 | return __builtin_object_size(p, 0); |
| 19 | } |
| 20 | |
| 21 | @import builtin.sub; |
| 22 | |
| 23 | int bar() { |
| 24 | return __builtin_object_size(p, 0); |
| 25 | } |
| 26 | |
Ben Langmuir | b9ad4e6 | 2015-10-28 22:25:37 +0000 | [diff] [blame] | 27 | int baz() { |
| 28 | return IS_CONST(0); |
| 29 | } |
Douglas Gregor | 1519766 | 2013-04-03 23:06:26 +0000 | [diff] [blame] | 30 | |
Quentin Colombet | 043406b | 2016-02-03 22:41:00 +0000 | [diff] [blame^] | 31 | void use_constant_string_builtins2(void) { |
| 32 | (void)__builtin___CFStringMakeConstantString(""); |
| 33 | (void)__builtin___NSStringMakeConstantString(""); |
| 34 | } |