diff options
Diffstat (limited to 'clang/test/Interpreter/pretty-print.c')
-rw-r--r-- | clang/test/Interpreter/pretty-print.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/clang/test/Interpreter/pretty-print.c b/clang/test/Interpreter/pretty-print.c index 588df70..d0712fb 100644 --- a/clang/test/Interpreter/pretty-print.c +++ b/clang/test/Interpreter/pretty-print.c @@ -75,9 +75,10 @@ int * ptr = (int*)0x123; ptr int * null_ptr = (int*)0; null_ptr // CHECK-NEXT: (int *) 0x0 +union U { int I; float F; } u; u.I = 12; u.I +// CHECK-NEXT: (int) 12 + // TODO: _Bool, _Complex, _Atomic, and _BitInt -// union U { int I; float F; } u; u.I = 12; u.I -// TODO-CHECK-NEXT: (int) 12 // struct S1{} s1; s1 // TODO-CHECK-NEXT: (S1 &) @0x{{[0-9a-f]+}} @@ -86,4 +87,21 @@ int * null_ptr = (int*)0; null_ptr // E.d // TODO-CHECK-NEXT: (int) 22 +// ----------------------------------------------------------------------------- +// Tentative definition handling (C99 6.9.2) +// Verify that multiple distinct tentative definitions across inputs no longer +// conflict. Each variable should emit correctly in its own incremental module. +// ----------------------------------------------------------------------------- + +int t1; +int t2; +int t3; +t1 = 1; t2 = 2; t3 = 3; +t1 + t2 + t3 +// CHECK-NEXT: (int) 6 + +// A redefinition of an existing tentative variable should still fail. +int t1; +// expected-error {{duplicate definition of symbol '_t1'}} + %quit |