Files
clang-p2996/lldb/test/API/lang/c/set_values/main.c
Raphael Isemann fdea9a4ec9 [lldb] Remove license headers from all test source files
Summary:
Around a third of our test sources have LLVM license headers. This patch removes those headers from all test
sources and also fixes any tests that depended on the length of the license header.

The reasons for this are:

* A few tests verify line numbers and will start failing if the number of lines in the LLVM license header changes. Once I landed my patch for valid SourceLocations in debug info we will probably have even more tests that verify line numbers.
* No other LLVM project is putting license headers in its test files to my knowledge.
* They make the test sources much more verbose than they have to be. Several tests have longer license headers than the actual test source.

For the record, the following tests had their line numbers changed to pass with the removal of the license header:
    lldb-api :: functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py
    lldb-shell :: Reproducer/TestGDBRemoteRepro.test
    lldb-shell :: Reproducer/TestMultipleTargets.test
    lldb-shell :: Reproducer/TestReuseDirectory.test
    lldb-shell :: ExecControl/StopHook/stop-hook-threads.test
    lldb-shell :: ExecControl/StopHook/stop-hook.test
    lldb-api :: lang/objc/exceptions/TestObjCExceptions.py

Reviewers: #lldb, espindola, JDevlieghere

Reviewed By: #lldb, JDevlieghere

Subscribers: emaste, aprantl, arphaman, JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D74839
2020-02-20 08:32:01 +01:00

109 lines
2.9 KiB
C

#include <stdio.h>
void set_char(void)
{
char i = 'a';
printf("before (char) i = %c\n", i);
printf("after (char) i = %c\n", i); // Set break point #1. //// break $source:$line
}
void set_uchar(void)
{
unsigned char i = 'a';
printf("before (unsigned char) i = %c\n", i);
printf("after (unsigned char) i = %c\n", i); //// break $source:$line
}
void set_short(void)
{
short i = 33;
printf("before (short) i = %i\n", i);
printf("after (short) i = %i\n", i); //// break $source:$line
}
void set_ushort(void)
{
unsigned short i = 33;
printf("before (unsigned short) i = %i\n", i);
printf("after (unsigned short) i = %i\n", i); // Set break point #2. //// break $source:$line
}
void set_int(void)
{
int i = 33;
printf("before (int) i = %i\n", i);
printf("after (int) i = %i\n", i); //// break $source:$line
}
void set_uint(void)
{
unsigned int i = 33;
printf("before (unsigned int) i = %u\n", i);
printf("after (unsigned int) i = %u\n", i); //// break $source:$line
}
void set_long(void)
{
long i = 33;
printf("before (long) i = %li\n", i);
printf("after (long) i = %li\n", i); // Set break point #3. //// break $source:$line
}
void set_ulong(void)
{
unsigned long i = 33;
printf("before (unsigned long) i = %lu\n", i);
printf("after (unsigned long) i = %lu\n", i); //// break $source:$line
}
void set_float(void)
{
float i = 2.25;
printf("before (float) i = %g\n", i);
printf("after (float) i = %g\n", i); //// break $source:$line
}
void set_double(void)
{
double i = 2.25;
printf("before (double) i = %g\n", i);
printf("after (double) i = %g\n", i); // Set break point #4. //// break $source:$line
}
void set_long_double(void)
{
long double i = 2.25;
printf("before (long double) i = %Lg\n", i);
printf("after (long double) i = %Lg\n", i); // Set break point #5. //// break $source:$line
}
void set_point (void)
{
struct point_tag {
int x;
int y;
};
struct point_tag points_2[2] = {
{1,2},
{3,4}
};
}
int main (int argc, char const *argv[])
{
// Continue to the breakpoint in set_char()
set_char(); //// continue; var i; val -set 99 1
set_uchar(); //// continue; var i; val -set 99 2
set_short(); //// continue; var i; val -set -42 3
set_ushort(); //// continue; var i; val -set 42 4
set_int(); //// continue; var i; val -set -42 5
set_uint(); //// continue; var i; val -set 42 6
set_long(); //// continue; var i; val -set -42 7
set_ulong(); //// continue; var i; val -set 42 8
set_float(); //// continue; var i; val -set 123.456 9
set_double(); //// continue; var i; val -set 123.456 10
set_long_double(); //// continue; var i; val -set 123.456 11
set_point (); //// continue
return 0;
}